Quantcast
Channel: Media Foundation Development for Windows Desktop forum
Viewing all articles
Browse latest Browse all 1079

EVR: Minimal video decode overhead when video not visible.

$
0
0
Hi,
Trying to keep a video running even when not visible but want decode overhead minimal when it can't be seen.

From your sample EVR :

https://github.com/pauldotknopf/WindowsSDK7-Samples/blob/master/multimedia/mediafoundation/evrpresenter/Presenter.cpp

... the code that does the frame decode seems to be :

// ------------------------------------------------------------------------------------------------------------
dataBuffer.dwStreamID = 0;
dataBuffer.pSample = pSample;
dataBuffer.dwStatus = 0;
hr = m_pMixer->ProcessOutput(0, 1, &dataBuffer, &dwStatus);

// ------------------------------------------------------------------------------------------------------------

This performs a full frame decode. What should I do if (not_visible) to keep everything running smoothly please.

Have tried skipping the ProcessOutput but that buffers samples so need to be able to discard them somehow.

This : https://docs.microsoft.com/en-us/windows/desktop/api/mftransform/ns-mftransform-_mft_output_data_buffer

... says MFT_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER & set pSample above to null but that requires the output stream to have MFT_OUTPUT_STREAM_DISCARDABLE or MFT_OUTPUT_STREAM_LAZY_READ flag set, which I can read but not write.

So unclear how to skip unseen video frames (we're rendering in 3D, so sometimes you see it sometimes you don't but want audio to continue & everything to sync as it should).

Thanks in advance for any guidance. Have searched for sample code but have been unable to identify anything performing this function.

Can't pause as that breaks flow. Need audio to keep going as you can hear even when you can't see.

Viewing all articles
Browse latest Browse all 1079

Trending Articles