Expand Minimize

MFP_EVENT_TYPE enumeration

Important  Deprecated. This API may be removed from future releases of Windows. Applications should use the Media Session for playback.

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
} MFP_EVENT_TYPE;

Constants

MFP_EVENT_TYPE_PLAY

Playback has started. This event is sent when the IMFPMediaPlayer::Play method completes.

MFP_EVENT_TYPE_PAUSE

Playback has paused. This event is sent when the IMFPMediaPlayer::Pause method completes.

MFP_EVENT_TYPE_STOP

Playback has stopped. This event is sent when the IMFPMediaPlayer::Stop method completes.

MFP_EVENT_TYPE_POSITION_SET

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

The playback rate has changed. This event is sent when the IMFPMediaPlayer::SetRate method completes.

MFP_EVENT_TYPE_MEDIAITEM_CREATED

A new media item was created. This event is sent when the IMFPMediaPlayer::CreateMediaItemFromURL or CreateMediaItemFromObject method completes.

MFP_EVENT_TYPE_MEDIAITEM_SET

A media item is ready for playback. This event is sent when the IMFPMediaPlayer::SetMediaItem method completes.

MFP_EVENT_TYPE_FRAME_STEP

A frame-step operation has completed. This event is sent when the IMFPMediaPlayer::FrameStep method completes.

MFP_EVENT_TYPE_MEDIAITEM_CLEARED

The current media item was cleared. This event is sent when the IMFPMediaPlayer::ClearMediaItem method completes.

MFP_EVENT_TYPE_MF

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

A playback error has occurred.

MFP_EVENT_TYPE_PLAYBACK_ENDED

Playback has ended. The player object sends this event when playback reaches the end of the media file.

MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL

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_PLAY_EVENT

MFP_GET_PLAY_EVENT

MFP_EVENT_TYPE_PAUSE

MFP_PAUSE_EVENT

MFP_GET_PAUSE_EVENT

MFP_EVENT_TYPE_STOP

MFP_STOP_EVENT

MFP_GET_STOP_EVENT

MFP_EVENT_TYPE_POSITION_SET

MFP_POSITION_SET_EVENT

MFP_GET_POSITION_SET_EVENT

MFP_EVENT_TYPE_RATE_SET

MFP_RATE_SET_EVENT

MFP_GET_RATE_SET_EVENT

MFP_EVENT_TYPE_MEDIAITEM_CREATED

MFP_MEDIAITEM_CREATED_EVENT

MFP_GET_MEDIAITEM_CREATED_EVENT

MFP_EVENT_TYPE_MEDIAITEM_SET

MFP_MEDIAITEM_SET_EVENT

MFP_GET_MEDIAITEM_SET_EVENT

MFP_EVENT_TYPE_FRAME_STEP

MFP_FRAME_STEP_EVENT

MFP_GET_FRAME_STEP_EVENT

MFP_EVENT_TYPE_MEDIAITEM_CLEARED

MFP_MEDIAITEM_CLEARED_EVENT

MFP_GET_MEDIAITEM_CLEARED_EVENT

MFP_EVENT_TYPE_MF

MFP_MF_EVENT

MFP_GET_MF_EVENT

MFP_EVENT_TYPE_ERROR

MFP_ERROR_EVENT

MFP_GET_ERROR_EVENT

MFP_EVENT_TYPE_PLAYBACK_ENDED

MFP_PLAYBACK_ENDED_EVENT

MFP_GET_PLAYBACK_ENDED_EVENT

MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL

MFP_ACQUIRE_USER_CREDENTIAL_EVENT

MFP_GET_ACQUIRE_USER_CREDENTIAL_EVENT

 

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Mfplay.h

See also

Media Foundation Enumerations
IMFPMediaPlayerCallback

 

 

Community Additions

ADD
Show:
© 2014 Microsoft