description | ms.assetid | title | ms.topic | ms.date | topic_type | api_name | api_type | api_location | ms.custom | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The DecideAllocator method selects a memory allocator. |
cdc15b0e-ea1b-43aa-9267-95fa9db56ed5 |
CBaseOutputPin.DecideAllocator method (Amfilter.h) |
reference |
4/26/2023 |
|
|
|
|
UpdateFrequency5 |
[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
The DecideAllocator
method selects a memory allocator.
virtual HRESULT DecideAllocator(
IMemInputPin *pPin,
IMemAllocator **pAlloc
);
-
pPin
-
Pointer to the input pin's IMemInputPin interface.
-
pAlloc
-
Address of a variable that receives a pointer to the allocator's IMemAllocator interface.
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:
- Calls the IMemInputPin::GetAllocatorRequirements method to retrieve the input pin's buffer requirements, if any.
- 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.
- Calls the CBaseOutputPin::DecideBufferSize class method, which sets the allocator properties. This is a pure virtual method; the derived class must implement it.
- Calls the IMemInputPin::NotifyAllocator method, which notifies the input pin of the allocator being used.
Requirement | Value |
---|---|
Header |
|
Library |
|