how to use async IMFTransform?

mc 4,436 Reputation points
2024-08-20T15:52:43.36+00:00

how to use IMFTransform for async? I want to encode nv12 to h264.

I have to use while and again and again .

Is there is way to do nothing .and do not need to start thread.

If I need to ProcessInput then it will call my asynccallback?

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,592 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jeanine Zhang-MSFT 9,666 Reputation points Microsoft Vendor
    2024-08-21T01:56:33.71+00:00

    I suggest you could refer to the Doc: Asynchronous MFTs

    You need to implement IMFMediaEventGenerator interface. An MFT sends out-of-band events through the IMFMediaEventGenerator interface. During streaming, the MFT requests data by sending an METransformNeedInput event. For each METransformNeedInput event, the client calls ProcessInput for the specified stream.

    You needn't to call this function, but only respond to the events you receive.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.