简体   繁体   English

使用Media Foundation播放IMFSamples

[英]Playing IMFSamples using Media Foundation

I am creating sample application using Windows Media Foundation. 我正在使用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 . 我已使用Source Reader IMFSourceReader读取媒体文件,然后使用自定义MFT IMFTransform处理样本IMFSamples IMFTransform

In the MFT I have processed IMFSamples, How can I play/display them in a windows. 在MFT中,我已经处理了IMFSamples,如何在窗口中播放/显示它们。 I don't want to use EVR for display. 我不想使用EVR进行显示。

Also I have read the question: 我也读过这个问题:
How to play IMFMediaSample in media foundation? 如何在媒体基础中播放IMFMediaSample?

As per the suggestion I need to use MFPlay for playing the samples, but exactly how this can be done. 根据建议,我需要使用MFPlay播放样本,但具体如何完成。

In the interface IMFPMediaPlayer I am not able to find any method where I can push the media samples. 在接口IMFPMediaPlayer我找不到任何可以推送媒体样本的方法。
https://msdn.microsoft.com/en-us/library/windows/desktop/dd374329(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/dd374329(v=vs.85).aspx

IMFSample is a wrapper over raw data. IMFSample是原始数据的包装。 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. 如果您碰巧放弃用于回放/演示的标准API提供(例如视频的EVR),则必须从媒体样本对象中提取数据并以其他方式使用它,例如,自行决定使用其他API。

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. 不必精确地进行可视化,您也不受使用思路的限制:写入文件,通过网络发送等。对于可视化,您可以选择其他Windows API:DirectX,DirectShow,旧版DirectDraw,GDI,GDI +,Direct2D等。

IMFSample is not immediately accepted by other APIs right away because it is not what it is designed for. IMFSample并非立即为其他API所接受,因为这不是它的设计目的。 In Media Foundation API EVR is designed for presentation, and EVR is what you are supposed to use. 在Media Foundation API中,EVR专为演示而设计,您应该使用EVR。

The video sample object is a specialized implementation of the IMFSample interface for use with the Enhanced Video Renderer (EVR)... 视频样本对象是IMFSample接口的专用实现,可与增强型视频呈现器(EVR)一起使用...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM