The goal is to create a custom MFT for video processing and synchronization with an external application. Details are not important. What I would like to do as a first step is to start the MFT using DXVA or DXVA-HD video processing. I could not do that.
Here's what I did: I started building the topology with the original input node (my webcam), MFT (example MFT_Grayscale) and EVR. I have included this in a small application. The topology worked, and I saw a monochrome stream from the camera. Now I want to change the example code MF_Grayscale so that it supports DXVA video processing and can use the hardware acceleration provided by the VideoProcessBlt method. Microsoft documentation provides bits and pieces of information, but I could not get the MFT to start.
What i have done so far:
pStreamInfo->dwFlags = MFT_OUTPUT_STREAM_PROVIDES_SAMPLES | MFT_OUTPUT_STREAM_WHOLE_SAMPLES | MFT_OUTPUT_STREAM_SINGLE_SAMPLE_PER_BUFFER | MFT_OUTPUT_STREAM_FIXED_SAMPLE_SIZE;
Everything seems to be in order while here. Now my questions (sorry I can't be more specific):
Do I need to adapt the GetOutputAvailableType/SetOutputType ?
In the ProcessInput method ProcessInput I get IMFSample and retrieve IMFMediaBuffer . The buffer does not control IDirect3DSurface9 according to my function calls. Do I need to store buffer data on a Direct3D surface?
In the ProcessOutput method, to make a starting point, I want to forward the incoming frame to the output. VideoProcessBlt should make a 1: 1 flare from input to output. The documentation states:
Get an accessible surface that is currently not in use.
How to determine if a surface is used?
How can I output the surface? Should I use MFCreateVideoSampleFromSurface or MFCreateDXSurfaceBuffer ?
Unfortunately, I really lost and could not achieve any results using the documentation.
Now the situation is that I do not see any video output (the window has a default background color for the window), and the webcam stops to capture frames after the first frame (the LED turns off). In addition, nothing happens - the application just continues to work, not showing anything).
I hope someone can help me. I would also appreciate if someone could direct me to the sample code for the MFT using DXVA or DXVA-HD video processing. I could not find anything ...
thanks
source share