IAsyncReader::RequestAllocator method (strmif.h)

The RequestAllocator method requests an allocator during the pin connection.

Syntax

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

Parameters

pPreferred

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

pProps

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

Address of a variable that receives an IMemAllocator interface pointer.

Return value

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.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header strmif.h (include Dshow.h)
Library Strmiids.lib

See also

Error and Success Codes

IAsyncReader Interface