Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

What to do on MFX_WRN_DEVICE_BUSY?

dr_asik
Beginner
786 Views

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
786 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

0 Kudos
1 Reply
Petter_L_Intel
Employee
787 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

 

0 Kudos
Reply