Export (0) Print
Expand All

IAsyncReader::RequestAllocator method

The RequestAllocator method requests an allocator during the pin connection.

Syntax


HRESULT RequestAllocator(
  [in]   IMemAllocator *pPreferred,
  [in]   ALLOCATOR_PROPERTIES *pProps,
  [out]  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 value

Returns an HRESULT value. Possible values include the following.

Return codeDescription
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]

Header

Strmif.h (include Dshow.h)

Library

Strmiids.lib

See also

Error and Success Codes
IAsyncReader Interface

 

 

Community Additions

ADD
Show:
© 2014 Microsoft