Community
cancel
Showing results for 
Search instead for 
Did you mean: 
dr_asik
Beginner
128 Views

What to do on MFX_WRN_DEVICE_BUSY?

Jump to solution

I am implementing a video player using the Intel MSDK for decoding. At the end of a file, I flush the remaining frames by passing null to DecodeFrameAsync, like so:

mfxFrameSurface1* outSurface = nullptr;
mfxSyncPoint syncPoint;
int index = GetFreeSurfaceIndex(...);
mfxStatus sts = m_mfxVideoDecoder->DecodeFrameAsync(nullptr, &(m_mfxFrameSurfaces[index]), &outSurface, &syncPoint);
if (sts == MFX_ERR_MORE_DATA) { return; }
DebugPrint(sts);
sts = m_mfxVideoSession->SyncOperation(syncPoint, MSDK_DEC_WAIT_INTERVAL);
DebugPrint(sts);
// now outSurface is a new frame, enqueue it
return;
I've elided some of the error checking for conciseness.
 

This works fine in general, however with one particular video file the first DebugPrint shows MFX_WRN_DEVICE_BUSY, and then the second shows MFX_ERR_NULL_PTR. First, I am puzzled as to why the API would return DEVICE_BUSY since I am stepping through my code very slowly in the debugger and it has had ample time to finish the operation, but anyway, the most important question is, what am I supposed to do in this case? Should I just repeat the method call until it returns something else? 

0 Kudos
1 Solution
Petter_L_Intel
Employee
128 Views

Hi,

MFX_WRN_DEVICE_BUSY is a normal and expected return code. It means that the HW device is busy or unable to respond at that moment in time. As illustrated by the Media SDK samples, just insert small delay and reissue the Media SDK API call.

Regards,
Petter

 

View solution in original post

1 Reply
Petter_L_Intel
Employee
129 Views

Hi,

MFX_WRN_DEVICE_BUSY is a normal and expected return code. It means that the HW device is busy or unable to respond at that moment in time. As illustrated by the Media SDK samples, just insert small delay and reissue the Media SDK API call.

Regards,
Petter

 

View solution in original post

Reply