共用方式為


MFP_MF_EVENT structure (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.]

Event structure for the MFP_EVENT_TYPE_MF event. The MFPlay player object uses this event to forward certain events from the Media Foundation pipeline to the application.

Syntax

typedef struct MFP_MF_EVENT {
  MFP_EVENT_HEADER header;
  MediaEventType   MFEventType;
  IMFMediaEvent    *pMFMediaEvent;
  IMFPMediaItem    *pMediaItem;
} MFP_MF_EVENT;

Members

header

MFP_EVENT_HEADER structure that contains data common to all IMFPMediaPlayer events.

MFEventType

Media Foundation event type. Currently, the MFPlay player object forwards the following pipeline events to the application:

Event Description
MEBufferingStarted The source has started buffering data.
MEBufferingStopped The source has stopped buffering data.
MEExtendedType Custom event type.
MEReconnectEnd The source has completed an attempt to reconnect to the server.
MEReconnectStart The source is attempting to reconnect to the server.
MERendererEvent Event sent by a renderer, such as the Enhanced Video Renderer (EVR).
MEStreamSinkFormatChanged A stream format has changed.

pMFMediaEvent

Pointer to the IMFMediaEvent interface of the Media Foundation event.

pMediaItem

Pointer to the IMFPMediaItem interface of the current media item.

Remarks

To get a pointer to this structure, cast the pEventHeader parameter of the IMFPMediaPlayerCallback::OnMediaPlayerEvent method. You can use the MFP_GET_MF_EVENT macro for this purpose.

If MFEventType is MEStreamSinkFormatChanged, the following property may be stored in the event property store, which can be accessed through the header.pPropertyStore member.

Property Description
MFP_PKEY_StreamIndex The index of the stream whose format changed.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Header mfplay.h

See also

IMFPMediaPlayerCallback

Media Foundation Structures

Using MFPlay for Audio/Video Playback