- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI,
this is my function:
BOOL CIntelDecode::DecodeInputData(BYTE *pData , int size)
{
mfxStatus sts = MFX_ERR_NONE;
BOOL ret = TRUE;
_mfxBS.Data = (mfxU8 *)pData;
_mfxBS.MaxLength = size;
_mfxBS.DataLength = size;
_mfxBS.DataOffset = 0;
while (MFX_ERR_NONE <= sts || MFX_ERR_MORE_DATA == sts || MFX_ERR_MORE_SURFACE == sts)
{
if (MFX_WRN_DEVICE_BUSY == sts)
{
MSDK_SLEEP(1); // Wait if device is busy, then repeat the same call to DecodeFrameAsync
}
if (MFX_ERR_MORE_DATA == sts)
{
break;
}
if (MFX_ERR_MORE_SURFACE == sts || MFX_ERR_NONE == sts)
{
_currentIndex = GetFreeSurfaceIndex(_pmfxSurfaces, _numSurfaces); // Find free frame surface
if(MFX_ERR_NOT_FOUND == _currentIndex)
{
continue;
}
}
sts = _mfxDEC->DecodeFrameAsync(&_mfxBS, _pmfxSurfaces[_currentIndex], &_pmfxOutSurface, &_syncp);
if (MFX_ERR_NONE < sts && _syncp)
{
sts = MFX_ERR_NONE;
}
if (MFX_ERR_NONE == sts)
{
sts = _mfxSession.SyncOperation(_syncp, 60000); // Synchronize. Wait until decoded frame is ready
}
if (MFX_ERR_NONE == sts)
{
ConvertToRGB(_pmfxOutSurface);
break;
}
}
return ret;
}
It's only different with "simple_decode" at MFX_ERR_MORE_DATA "break".
I put "DecodeInputData" one frame each time, but the image was error. When I instead "MFX_ERR_MORE_DATA break " of "read one frame" , the image is right.
Link Copied
![](/skins/images/91F5C79BC69312EC7F389BB9532EE3D4/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page