How to run/start a thread at a given time using Media Foundation?

微笑、不失礼 提交于 2019-12-06 15:11:54

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/46301426/how-to-run-start-a-thread-at-a-given-time-using-media-foundation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!