如何使用Media Foundation在给定的时间运行/启动线程? [英] How to run/start a thread at a given time using Media Foundation?

查看:70
本文介绍了如何使用Media Foundation在给定的时间运行/启动线程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找在指定时间使用Media Foundation启动线程。



我知道DirectShow中有一个 IMediaFilter 其中 tStart 是参考时钟的时间值。

  Interface :: HRESULT运行(REFERENCE_TIME tStart); 

但是在Media Foundation中,没有这样的函数可以运行或启动线程。参数。



在Media Foundation中是否有解决方案?

解决方案

DirectShow或Media Foundation都没有与问题描述匹配的功能。



两个API都有在请求后立即开始活动的方法。



DirectShow的 IMediaFilter.Run 不会首先启动线程。那么该方法是技巧,而不是预期的用途:


...当应用程序调用 IMediaControl :: Run 方法时,过滤器图形管理器将调用 IMediaFilter :: Run 在每个过滤器上。它会在将来稍微设置tStart的值,以解决图形延迟。 code> IMediaFilter :: Run ,该方法应该在内部调用。



Media Foundation的内部设计有所不同。您无法安排启动时间,也不会影响内部工作线程。假定您开始了媒体会话活动,并且它会尽快开始。


I am looking for to start a thread at a specified time with Media Foundation.

I know that in DirectShow there is a function called by IMediaFilter where tStart is the time value of the reference clock.:

Interface::HRESULT Run(REFERENCE_TIME tStart);

But in Media Foundation there is no such function that will run or start a thread with a time as a parameter.

Is there a solution to do this in Media Foundation?

解决方案

Neither DirectShow or Media Foundation have functionality that matches the question description.

Both APIs have methods to start activity immediately following the request.

DirectShow's IMediaFilter.Run does not start thread in first place. Then the method is a trick rather than intended use:

... When an application calls the IMediaControl::Run method, the Filter Graph Manager calls IMediaFilter::Run on each filter. It sets the value of tStart slightly in the future, to account for graph latency.

Note that there is no word on you calling IMediaFilter::Run, the method is supposed to be called internally.

Media Foundation's internal design is different. You cannot schedule startup and you have no effect on internal working threads either. It is suppose that you start media session activity and it gets started as soon as possible.

这篇关于如何使用Media Foundation在给定的时间运行/启动线程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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