Export (0) Print
Expand All

IMemAllocatorCallbackTemp::SetNotify method

The SetNotify method sets or removes a callback on the allocator. The allocator calls the callback method whenever the allocator's IMemAllocator::ReleaseBuffer method is called.

Syntax


HRESULT SetNotify(
  IMemAllocatorNotifyCallbackTemp *pNotify
);

Parameters

pNotify

Pointer to the IMemAllocatorNotifyCallbackTemp interface that will be used for the callback. The caller must implement the interface. Use the value NULL to remove the callback.

Return value

Returns S_OK if successful, or an error code otherwise.

Remarks

Whenever the allocator's ReleaseBuffer method is called, the allocator calls the NotifyRelease method on the interface provided in pNotify. The ReleaseBuffer method returns a media sample to the allocator's free list. Samples call this method when their reference counts reach zero.

The allocator holds a reference count on the caller's IMemAllocatorNotifyCallbackTemp interface. This can create circular reference counts, thereby preventing objects in the graph from being released correctly. Therefore, when the caller no longer needs callback notifications, it should call this method again with the value NULL. An appropriate time to do this is when the graph stops, or else when the pins are disconnected.

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
IMemAllocatorCallbackTemp Interface

 

 

Community Additions

ADD
Show:
© 2014 Microsoft