IMFPMediaPlayerCallback interface
Callback interface for the IMFPMediaPlayer interface.
To set the callback, pass an IMFPMediaPlayerCallback pointer to the MFPCreateMediaPlayer function in the pCallback parameter. The application implements the IMFPMediaPlayerCallback interface.
Members
The IMFPMediaPlayerCallback interface inherits from the IUnknown interface. IMFPMediaPlayerCallback also has these types of members:
Methods
The IMFPMediaPlayerCallback interface has these methods.
| Method | Description |
|---|---|
| OnMediaPlayerEvent |
Called by the MFPlay player object to notify the application of a playback event. |
Examples
The following example shows the basic framework for implementing this interface. The application would need to add the implementation of the OnMediaPlayerEvent method.
#include <shlwapi.h> class PlayerCallback : public IMFPMediaPlayerCallback { public: PlayerCallback() : m_refcount(1) { } STDMETHODIMP QueryInterface(REFIID riid, void** ppv) { static const QITAB qit[] = { QITABENT(PlayerCallback, IMFPMediaPlayerCallback), { 0 }, }; return QISearch(this, qit, riid, ppv); } STDMETHODIMP_(ULONG) AddRef() { return InterlockedIncrement(&m_refcount); } STDMETHODIMP_(ULONG) Release() { ULONG count = InterlockedDecrement(&m_refcount); if (count == 0) { delete this; return 0; } return count; } // IMFPMediaPlayerCallback methods // TODO: Implement this method. void STDMETHODCALLTYPE OnMediaPlayerEvent(MFP_EVENT_HEADER *pEventHeader); private: long m_refcount; };
Requirements
|
Minimum supported client |
Windows 7 [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2008 R2 [desktop apps only] |
|
Header |
|
See also