MFP_EVENT_TYPE enumeration (mfplay.h)
[The feature associated with this page, MFPlay, is a legacy feature. It has been superseded by MediaPlayer and IMFMediaEngine. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer and IMFMediaEngine instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
Defines event types for the IMFPMediaPlayerCallback interface.
Syntax
typedef enum MFP_EVENT_TYPE {
MFP_EVENT_TYPE_PLAY = 0,
MFP_EVENT_TYPE_PAUSE = 1,
MFP_EVENT_TYPE_STOP = 2,
MFP_EVENT_TYPE_POSITION_SET = 3,
MFP_EVENT_TYPE_RATE_SET = 4,
MFP_EVENT_TYPE_MEDIAITEM_CREATED = 5,
MFP_EVENT_TYPE_MEDIAITEM_SET = 6,
MFP_EVENT_TYPE_FRAME_STEP = 7,
MFP_EVENT_TYPE_MEDIAITEM_CLEARED = 8,
MFP_EVENT_TYPE_MF = 9,
MFP_EVENT_TYPE_ERROR = 10,
MFP_EVENT_TYPE_PLAYBACK_ENDED = 11,
MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL = 12
} ;
Constants
MFP_EVENT_TYPE_PLAY Value: 0 Playback has started. This event is sent when the IMFPMediaPlayer::Play method completes. |
MFP_EVENT_TYPE_PAUSE Value: 1 Playback has paused. This event is sent when the IMFPMediaPlayer::Pause method completes. |
MFP_EVENT_TYPE_STOP Value: 2 Playback has stopped. This event is sent when the IMFPMediaPlayer::Stop method completes. |
MFP_EVENT_TYPE_POSITION_SET Value: 3 The MFPlay player object has seeked to a new playback position. This event is sent when the IMFPMediaPlayer::SetPosition method completes. |
MFP_EVENT_TYPE_RATE_SET Value: 4 The playback rate has changed. This event is sent when the IMFPMediaPlayer::SetRate method completes. |
MFP_EVENT_TYPE_MEDIAITEM_CREATED Value: 5 A new media item was created. This event is sent when the IMFPMediaPlayer::CreateMediaItemFromURL or CreateMediaItemFromObject method completes. |
MFP_EVENT_TYPE_MEDIAITEM_SET Value: 6 A media item is ready for playback. This event is sent when the IMFPMediaPlayer::SetMediaItem method completes. |
MFP_EVENT_TYPE_FRAME_STEP Value: 7 A frame-step operation has completed. This event is sent when the IMFPMediaPlayer::FrameStep method completes. |
MFP_EVENT_TYPE_MEDIAITEM_CLEARED Value: 8 The current media item was cleared. This event is sent when the IMFPMediaPlayer::ClearMediaItem method completes. |
MFP_EVENT_TYPE_MF Value: 9 A pipeline object sent an event. The player object forwards certain pipeline events to the application. For more information, see MFP_MF_EVENT. |
MFP_EVENT_TYPE_ERROR Value: 10 A playback error has occurred. |
MFP_EVENT_TYPE_PLAYBACK_ENDED Value: 11 Playback has ended. The player object sends this event when playback reaches the end of the media file. |
MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL Value: 12 The media source requires authentication before it can play the file. |
Remarks
For each event type, the IMFPMediaPlayerCallback::OnMediaPlayerEvent callback receives a pointer to a data structure. The first part of the data structure is always an MFP_EVENT_HEADER structure. The following table lists the data structure for each event type.
In your implementation of OnMediaPlayerEvent, you must cast the pEventHeader parameter to the correct structure type. A set of macros is defined for this purpose. These macros check the value of the event type and return NULL if there is a mismatch; otherwise they return a pointer to the correct structure type.
Event type |
Event structure
Pointer cast macro |
MFP_EVENT_TYPE_PLAY | |
MFP_EVENT_TYPE_PAUSE | |
MFP_EVENT_TYPE_STOP | |
MFP_EVENT_TYPE_POSITION_SET | |
MFP_EVENT_TYPE_RATE_SET | |
MFP_EVENT_TYPE_MEDIAITEM_CREATED | |
MFP_EVENT_TYPE_MEDIAITEM_SET | |
MFP_EVENT_TYPE_FRAME_STEP | |
MFP_EVENT_TYPE_MEDIAITEM_CLEARED | |
MFP_EVENT_TYPE_MF | |
MFP_EVENT_TYPE_ERROR | |
MFP_EVENT_TYPE_PLAYBACK_ENDED | |
MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL |
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps only] |
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
Header | mfplay.h |