如何在没有拓扑的情况下将 Windows Media Foundation 与 UWP 结合使用 [英] How to use Windows Media Foundation with UWP without a topology

查看:29
本文介绍了如何在没有拓扑的情况下将 Windows Media Foundation 与 UWP 结合使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了理解 Hololens 的 Microsoft 示例 MixedRemoteViewCompositor,我一直在阅读 Polinger 的书Developing Microsoft Media Foundation Applications".文本的一个关键概念是媒体基础组件是连接到称为拓扑的图形结构中的 COM 对象.但是,示例代码适用于通用 Windows 平台 (UWP),并且代码中的任何地方都不存在拓扑"一词.代码中不存在创建拓扑的调用.

所以我的问题是 UWP 应用程序是否使用 Media Foundation 中的拓扑,如果没有,如何将 Media Foundation COM 组件连接在一起以形成处理管道?示例代码有源和接收器,但我不知道它们是如何连接的.

斯科特

解决方案

所以我的问题是 UWP 应用程序是否使用 Media Foundation 中的拓扑 否.

首先,IMFTopologyNode 接口在 UWP 中是不允许的.

其次,UWP 中不允许包含 IMFTopologyNodeIMFTopology 接口.

第三,通过IMFTopology创建媒体管道的IMFMediaSession接口在UWP中是不允许的,

第四,MFCreateMediaSession - 创建 IMFMediaSession 的C"函数在 UWP 中是不允许的.

不是如何将 Media Foundation COM 组件连接在一起以形成处理管道? - 它是在 MF 组件后面使用 IMFSourceReaderIMFSinkWriter - 开发人员不能直接访问这些处理管道.

那么是否可以将媒体基础转换 (MFT) 与 UWP 架构一起使用? 是的.如果您想使用 IMFTransform 接口添加您的组件 - 那么您必须使用带有 IMFSourceReaderEx 接口 - 它有方法 AddTransformForStream - 向流添加变换,例如音频或视频效果. >

关于 How create Source Reader 你可以在那里阅读 - 源代码阅读器

I have been reading the Polinger book "Developing Microsoft Media Foundation Applications" in order to understand the Microsoft sample MixedRemoteViewCompositor for the Hololens. A key concept of the text is that Media Foundation components are COM objects that are connected into a graph structure called a Topology. However, the sample code is for Universal Windows Platform (UWP) and the word "topology" does not exist anywhere in the code. The call to create a topology does not exist in the code.

So my question is whether UWP applications use a topology in Media Foundation and if not how does one connect the Media Foundation COM components together to form a processing pipeline? The sample code has sources and sinks but I cannot tell how they connect.

Scott

解决方案

So my question is whether UWP applications use a topology in Media Foundation No.

Firstly, IMFTopologyNode interface is not allowed in UWP.

Secondly, IMFTopology interface which contains IMFTopologyNode, is not allowed in UWP.

Thirdly, IMFMediaSession interface which creates media pipeline by IMFTopology, is not allowed in UWP,

Fourthly, MFCreateMediaSession - "C" function which creates IMFMediaSession, is not allowed in UWP.

not how does one connect the Media Foundation COM components together to form a processing pipeline? - it is done behind of MF components with IMFSourceReader and IMFSinkWriter - developer CANNOT have direct access to those processing pipelines.

So is it possible to use Media Foundation Transforms (MFT) with the UWP architecture? Yes. If you want add your's component with IMFTransform interface - then you must use component with IMFSourceReaderEx interface - it has method AddTransformForStream - Adds a transform, such as an audio or video effect, to a stream.

About How create Source Reader you can read there - Source Reader

这篇关于如何在没有拓扑的情况下将 Windows Media Foundation 与 UWP 结合使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆