0
votes

I am creating sample application using Windows Media Foundation.

I have used Source Reader IMFSourceReader to Read the media file and then After I am processing the samples IMFSamples using Custom MFT IMFTransform.

In the MFT I have processed IMFSamples, How can I play/display them in a windows. I don't want to use EVR for display.

Also I have read the question:
How to play IMFMediaSample in media foundation?

As per the suggestion I need to use MFPlay for playing the samples, but exactly how this can be done.

In the interface IMFPMediaPlayer I am not able to find any method where I can push the media samples.
https://msdn.microsoft.com/en-us/library/windows/desktop/dd374329(v=vs.85).aspx

1
If the IMFSample contains a DXGI or D3D9 surface you can display it using DX. Otherwise you can use GDI to display the IMFMediaBuffer into a window. Is that what you need? - VuVirt
@VuVirt : How do I find if IMFSample contain DXGI or D3D9 surface. Also how we can use GDI to display IMFMediaBuffer in window, any example of it in case you have. I have a custom mixer which is blending one image in the video samples and generating sample. I need to display this sample in the video window. - User7723337

1 Answers

0
votes

IMFSample is a wrapper over raw data. If you happen to waive standard API offering for playback/presentation (such as EVR for video), you will have to extract the data from the media sample object and consume it otherwise, such as using another API at your discretion.

This does not have to be visualization exactly, you are not limited in consumption ideas: writing to file, sending via network etc. For visualization you have other Windows APIs at your choice: DirectX, DirectShow, legacy DirectDraw, GDI, GDI+, Direct2D etc.

IMFSample is not immediately accepted by other APIs right away because it is not what it is designed for. In Media Foundation API EVR is designed for presentation, and EVR is what you are supposed to use.

The video sample object is a specialized implementation of the IMFSample interface for use with the Enhanced Video Renderer (EVR)...