Insufficient buffers returned by MFXVideoDECODE_QueryIOSurf in software decoding

Insufficient buffers returned by MFXVideoDECODE_QueryIOSurf in software decoding

Hello
As there's no real control over the latency of the hardware decoder in 3.0beta2, I've switched out video conf application to a combination of hardware encoding, software decoding.
This gave rise to a new issue : the MFXVideoDECODE_QueryIOSurf function, called by the decoder (software) to decode the incoming stream (hardware) returns an insufficient number of buffers, causing the application to hang, looking for a free buffer to use.
Namely, it returns 1 buffer, when testing has shown that 9 are required for it to work properly (with much greater latency than with the software encoder, for some reason !)
in short, only this combination of hardware encoder and software decoder seems to have this issue (all settings are for lowest possible latency). Following is the code for the decoder.
Please inform me what else is needed to identify the issue (full source ? a recorded stream ?).

regards

Jack Chimasera

memset (&m_DecodedVideoParameters,0,sizeof (m_DecodedVideoParameters));
m_DecodedVideoParameters.mfx.CodecId=MFX_CODEC_AVC;
m_DecodedVideoParameters.AsyncDepth=1;
Status=MFXVideoDECODE_DecodeHeader (m_DecodingSession, m_InputBitStream,&m_DecodedVideoParameters);
m_DecodedVideoParameters.mfx.NumThread=1;
if (Status==MFX_ERR_NONE)
{
// initialize
m_DecodedVideoParameters.IOPattern = MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
m_DecodedVideoParameters.mfx.DecodedOrder = 0;

Status=MFXVideoDECODE_Init (m_DecodingSession,&m_DecodedVideoParameters);
if (CheckError (Status,L"MFXVideoDECODE_Init")) return;
if (Status==MFX_ERR_NONE)
{
// initialize the frames
mfxFrameAllocRequest AllocRequest;
Status=MFXVideoDECODE_QueryIOSurf (m_EncodingSession,&m_DecodedVideoParameters,&AllocRequest);
if (CheckError (Status,L"MFXVideoDECODE_QueryIOSurf")) return;
AllocRequest.NumFrameMin+=8;
AllocRequest.NumFrameSuggested+=8;
mfxFrameAllocResponse AllocResponse;
Status=m_SysmemAllocator->Alloc (m_SysmemAllocator->pthis,&AllocRequest,&AllocResponse);

3 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Best Reply

Hello Jack,
I believe the problem is in passing m_EncodingSession to DECODE_QueryIOSurf which is the hw session as far as I understood. It's not consistent to call DECODE methods with different sessions.
Please try fixing this.
Regards,Nina

You are obviously correct, how utterly embarassing...

Melden Sie sich an, um einen Kommentar zu hinterlassen.