Microsoft DirectX 9.0

IAsyncReader::RequestAllocator

The RequestAllocator method requests an allocator during the pin connection.

Syntax

HRESULT RequestAllocator(
  IMemAllocator *pPreferred,
  ALLOCATOR_PROPERTIES *pProps,
  IMemAllocator **ppActual
);

Parameters

pPreferred

[in] Pointer to the IMemAllocator interface on the input pin's preferred allocator, or NULL.

pProps

[in] Specifies the address of an ALLOCATOR_PROPERTIES structure, allocated by the caller. The caller should fill in any allocator properties that the input pin requires, and set the remaining members to zero.

ppActual

[out] Address of a variable that receives an IMemAllocator interface pointer. 

Return Values

Returns an HRESULT value. Possible values include the following.

Return code Description
E_FAIL Failure to initialize an allocator.
VFW_E_BADALIGN An invalid alignment was specified.
S_OK Allocator was returned.

Remarks

The downstream input pin should call this method during the connection process. If the pin has a preferred allocator, specify it in the pPreferred parameter. Specify any buffer requirements, such as buffer size or alignment, in the pProps parameter. The output pin chooses the allocator and returns a pointer to it in the ppActual parameter.

The output pin is not required to honor the input pin's requests. If the input pin has any absolute requirements, it should call the IMemAllocator::GetProperties method on the returned allocator. It can fail the connect if the allocator properties are not suitable. Once the connection is established, the input pin must use the allocator chosen by the output pin.

The input pin is responsible for committing and decommitting the allocator.

See Also