Muokkaa

Jaa


CBaseAllocator.CBaseAllocator constructor

[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.]

Constructor method.

Syntax

CBaseAllocator(
   TCHAR     *pName,
   LPUNKNOWN pUnk,
   HRESULT   *phr,
   BOOL      bEvent = TRUE,
   BOOL      fEnableReleaseCallback = FALSE
);

Parameters

pName

Pointer to a string containing the debug name of the allocator. For more information, see CBaseObject.

pUnk

Pointer to the owner of this object. If the object is aggregated, pass a pointer to the aggregating object's IUnknown interface. Otherwise, set this parameter to NULL.

phr

Pointer to an HRESULT value. Set the value to S_OK before creating the object. If the constructor fails, the value is set to an error code.

bEvent

Boolean value indicating whether to create a semaphore. If TRUE, the allocator creates a semaphore (CBaseAllocator::m_hSem), which is signaled whenever a sample becomes available. Set the value to FALSE if you are implementing a derived class that does not require a semaphore.

fEnableReleaseCallback

Boolean value indicating whether the release callback mechanism is enabled. Set the value to TRUE if you want to supply a callback interface, which is called when buffers are released. Specify the callback by calling the CBaseAllocator::SetNotify method.

Requirements

Requirement Value
Header
Amfilter.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CBaseAllocator Class