Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The Media Session exposes the IMFMediaSession interface. There are two ways to create the Media Session, depending on whether your application will support protected content:
Any application that uses the Media Session will follow these general steps:
When using the Media Session, the application should not directly start, pause, or stop the media source. All state changes must be initiated by calling IMFMediaSession methods. State changes in the media source are handled by the Media Session.
Many other details will depend on the specific functionality of your application.
To play protected content, you must create the Media Session inside the protected media path (PMP), by calling MFCreatePMPMediaSession. This function creates an instance of the Media Session inside the PMP and returns a pointer to a proxy object that marshals interfaces across the process boundary.
In most respects, using the Media Session inside the PMP is transparent to the application. However, the application might need to invoke certain actions that enable the user to play the content. For example, the user might need to obtain a DRM license. Media Foundation defines a generic mechanism for these actions using the IMFContentEnabler interface.
For more information, see the following topics:
The Media Session manages all aspects of the presentation clock:
Creating the presentation clock.
Selecting the time source.
Notifying the media sinks about the clock
Starting, stopping, and pausing the clock as necessary.
Shutting down the clock.
To get a pointer to the presentation clock, call IMFMediaSession::GetClock on the Media Session. The presentation clock does not return a valid time until the Media Session sends the MESessionTopologyStatus event with the MF_TOPOSTATUS_READY flag. Until then, GetClock returns MF_E_CLOCK_NO_TIME_SOURCE.
An application that uses the Media Session should never start, stop, or pause the presentation clock; change the clock rate; or shut down the clock.
When the application calls IMFMediaSession::Start, the Media Session starts the presentation clock with a starting time equal to the starting position specified in the Start method. For more information about the Media Session, see Media Session.
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today