Microsoft DirectX 9.0


The DecideAllocator method selects a memory allocator.


virtual HRESULT DecideAllocator(
    IMemInputPin *pPin,
    IMemAllocator **pAlloc



Pointer to the input pin's IMemInputPin interface.


Address of a variable that receives a pointer to the allocator's IMemAllocator interface.

Return Value

Returns S_OK if successful, or an HRESULT value indicating the cause of the error.


This method is called at the end of the pin connection process. It performs the following steps:

  1. Calls the IMemInputPin::GetAllocatorRequirements method to retrieve the input pin's buffer requirements, if any.
  2. Calls the IMemInputPin::GetAllocator method to request an allocator from the input pin. If the input pin does not provide an allocator, the output pin creates one by calling the CBaseOutputPin::InitAllocator class method.
  3. Calls the CBaseOutputPin::DecideBufferSize class method, which sets the allocator properties. This is a pure virtual method; the derived class must implement it.
  4. Calls the IMemInputPin::NotifyAllocator method, which notifies the input pin of the allocator being used.

See Also