Reputation: 273
how to use async? should i use IMFMediaEventGenerator
?
but I can not query it using hr= transform.QueryInterface(__uuidof(IMFMediaEventGenerator),(void**)&pEventGenerator);
and what I want it when I need ProcessInput
or ProcessOutput
it will inform me.
so I do not need while(true)
right?
Upvotes: -1
Views: 67
Reputation: 69724
The transforms can be synchronous (originally there were only these), and then also asynchronous. Asynchronous MFTs are different, they have significantly different workflow.
When you use higher level Media Foundation APIs, they are all capable to work with both types of transforms, however if you want to consume them directly you have to implement both models, or at the very least apply the appropriate model.
You must use event generator interface IMFMediaEventGenerator
and consume events. The events tell you when it is time to do ProcessInput
and ProcessOutput
, you are not supposed to call this randomly or in a poll fashion, only in response to events you receive.
Upvotes: 1