Sets the callback object that receives notification whenever a video sample is returned to the allocator.
public:
HRESULT SetCallback(
IMFVideoSampleAllocatorNotify *pNotify
)
pNotify
Type: IMFVideoSampleAllocatorNotify *
A pointer to the IMFVideoSampleAllocatorNotify interface that receives notification, or NULL to remove the callback.
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Refer to Media Foundation return codes.
To get a video sample from the allocator, call the IMFVideoSampleAllocator::AllocateSample method. When the sample is released, it returns to the pool of available samples. When this happens, the allocator invokes the IMFVideoSampleAllocatorNotify::NotifyRelease callback.
The allocator holds at most one callback pointer. Calling this method again replaces the previous callback pointer.
Header: Declared in mfidl.h.