Using IMediaEventSink to post user message (DirectShow) from the pin methods

Viewed 18

Can DirectShow (Win10, C++) graph elements - pins use IMediaEventSink interface to post own messages (Notify method) ? For example, in my FillBuffer() implementation I would like to pass information about error occured while receiving data from the external source to the main application extended. Is it possible to use this interface to do that ? If yes, how the pin (owner of FillBuffer) can get this interface ? As I know, the FillBuffer() work in the separate thread. Will the call of the Notify() be thread-safe ?

1 Answers

Your filter class already has a member method CBaseFilter::NotifyEvent to help you with delivery of the event/message.

Here is an example how filter implementation sends an event.

Application is to handle such events in a regular way: Handle Graph Events.

You don't need to bother abouto additional thread safety, runtime and base class take care of this.

Related