Supported Microsoft Media Foundation APIs for Windows Phone 8
July 21, 2014
The following sections list the Microsoft Media Foundation (MF) interfaces and methods that are supported on Windows Phone 8. For information on developing Windows Phone apps using MF, see Walkthrough: Using Microsoft Media Foundation for Windows Phone 8.
This topic contains the following sections.
- IMFMediaEngine interface
- IMFMediaEngineEx interface
- IMFMediaEngineClassFactory interface
- IMFMediaError interface
IMFMediaEngine interface
Create an instance of the IMFMediaEngine interface by calling IMFMediaEngineClassFactory::CreateInstance.
There are two differences between the phone and desktop implementations of IMFMediaEngineClassFactory::CreateInstance.
On the phone, the IMFMediaEngine only supports frame-server mode. Attempting to initialize the interface in either rendering mode or audio mode will fail.
On the desktop, the MF_MEDIA_ENGINE_DXGI_MANAGER initialization attribute is used to specify that hardware acceleration should be used for video decoding and video processing. On the phone, hardware acceleration is always used, when possible.
Supported methods
Methods of this interface that are not in the following list cannot be used in Windows Phone 8 apps.
Method |
Description |
---|---|
Gets the URL of the current media resource, or an empty string if no media resource is present. |
|
Gets the current playback position. |
|
Gets the duration of the media resource. |
|
Gets the most recent error status. |
|
Queries whether the Media Engine will loop playback. |
|
Queries whether the audio is muted. |
|
Gets the size of the video frame, adjusted for aspect ratio. |
|
Gets the ready state, which indicates whether the current media resource can be rendered.
Note:
On Windows Phone 8, this method will only return MF_MEDIA_ENGINE_READY_HAVE_NOTHING or MF_MEDIA_ENGINE_READY_HAVE_ENOUGH_DATA.
|
|
Gets the picture aspect ratio of the video stream. |
|
Gets the audio volume level. |
|
Queries whether the current media resource contains an audio stream. |
|
Queries whether the current media resource contains a video stream. |
|
Queries whether playback has ended. |
|
Queries whether playback is currently paused. |
|
Queries whether the Media Engine is currently seeking to a new playback position. |
|
Queries the Media Engine to find out whether a new video frame is ready. |
|
Pauses playback. |
|
Starts playback. |
|
Seeks to a new playback position. |
|
Specifies whether the Media Engine loops playback. |
|
Mutes or unmutes the audio. |
|
Sets the URL of a media resource. |
|
Sets the audio volume level. |
|
Shuts down the Media Engine and releases the resources it is using. |
|
Copies the current video frame to a DXGI surface or WIC bitmap.
Note:
Windows Imaging Component (WIC) is not supported on Windows Phone 8, so frames must be copied to a DXGI surface. Also, on the phone TransferVideoFrame may occasionally return E_FAIL when you’re seeking in the video stream (using SetCurrentTime) or when changing video streams. Your app should simply ignore this error call the method again when the next frame is available.
|
IMFMediaEngineEx interface
Supported methods
Methods of this interface that are not in the following list cannot be used in Windows Phone 8 apps.
Method |
Description |
---|---|
Gets the audio balance. |
|
Sets the audio balance. |
|
Opens a media resource from a byte stream. |
IMFMediaEngineClassFactory interface
Before using this interface, call CoInitializeEx. To get a pointer to this interface, call CoCreateInstanceFromApp using the class identifier CLSID_MFMediaEngineClassFactory.
Supported methods
Methods of this interface that are not in the following list cannot be used in Windows Phone 8 apps.
Method |
Description |
---|---|
Creates a new instance of the Media Engine. |
IMFMediaError interface
Get a pointer to this interface by calling IMFMediaEngine::GetError.
Supported Methods
Methods of this interface that are not in the following list cannot be used in Windows Phone 8 apps.
Method |
Description |
---|---|
Gets the error code. |
|
Gets the extended error code. |