如何在WinRT中动态更改MFT组件的设置? [英] How to dynamic change settings of a MFT component in WinRT?

查看:84
本文介绍了如何在WinRT中动态更改MFT组件的设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I知道如何使用函数"msInsertVideoEffect"的第三个参数将参数设置为MFT。注册时。

但是因为我想在播放时更改参数,有什么方法可以使用吗?我有一些猜测,但不太确定。

 

< span lang ="EN-US"> 1。 WInRT库中是否有方法在播放时设置参数,或者函数"SetProperties"是否存在。可以在没有msInsertVideoEffect的情况下直接调用。如果它是
,那么我如何确定我想要配置哪个组件?

 

2。如果猜测一个失败,我可以实现接口以及如何将其暴露给应用程序?我可以直接调用界面还是需要通过MediaExtensionManager
或??

 

3。或者我可以通过任何方式获取实例并查询我想要设置参数的接口??  

3. Or is any way I can get the instance and query the interface I want to set the parameter?? 

 

4。或者我只能清除效果并使用新参数再次插入?

谢谢。

推荐答案

插入效果时,管道实例化WinRT组件并调用

IMediaExtension.SetProperties
否则会发生,因为SetProperties需要

IPropertySet
由定制的应用程序设置,有几种不同的方法可以建立通信。

When you insert an effect the pipeline instantiates the WinRT component and calls IMediaExtension.SetProperties before anything else happens, since SetProperties takes an IPropertySet which is set by the tailored app there are several different approaches to establish communication.

 

一种方法是定义一个与效果交互的接口,实现IMediaExtension和您的自定义接口,并在SetProperties的末尾向属性集添加一个值,指向当前效果实例(this)。通过
执行此操作,metro风格的应用程序可以使用您的自定义界面在播放期间通过传递属性集来与效果进行通信,添加效果并在媒体元素事件(如" canplay
被触发。

One approach would be to define an interface to interact with the effect, implement both IMediaExtension and your custom interface, and at the end of SetProperties add a value to the property set pointing to the current instance of the effect (this). By doing this the metro style app can use your custom interface to communicate with the effect during playback by passing a property set when adding the effect and getting the effect instance when a media element event such as “canplay” is triggered.

 

另一种解决方案是
在Metro风格应用和效果中注册IPropertySet事件
任何人修改时都可以采取行动。

Another solution would be to register for IPropertySet events in both the metro style app and the effect so action can be taken when is modified by any of them.


这篇关于如何在WinRT中动态更改MFT组件的设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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