- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In our application, we have 6 decoders and their MFXVideosession are joined together. One of the decoders may be interrupted and provided a new video. For example, one decoder is playing a mp4 video, now we want to stop video and to receive a camera H264 stream. But other decoders are still asked to work as before (not interrupted). Should we have to close the decoder's MFXVideosession, or just reset decoder as Media SDK' sample_decode does?
Thanks
Jiuxiang
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jiuxiang,
If the parameters and required resources of the stream are changing you will likely need to do more than reset. I beleive you can setup a new decoder without closing the MFXVideoSession however. I will investigate.
-Tony
If the parameters and required resources of the stream are changing you will likely need to do more than reset. I beleive you can setup a new decoder without closing the MFXVideoSession however. I will investigate.
-Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tony,
Yes, the parameter (e.g. video resolution) maybe change. But all of them are H264 stream with AVC type. The folloing is the method that we are using to reset of decoder. Is it enough? Should I deleteMFXVideoDECODE* before I setup a new
MFXVideoDECODE?
mfxStatus H264Decoder::ResetDecoder(sInputParams *pParams)
{
mfxStatus sts = MFX_ERR_NONE;
// close decoder
sts = m_pmfxDEC->Close();
MSDK_IGNORE_MFX_STS(sts, MFX_ERR_NOT_INITIALIZED);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
// free allocated frames
DeleteFrames();
// initialize parameters with values from parsed header
sts = InitMfxParams(pParams);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
// allocate frames prior to decoder initialization (if allocator used as external)
sts = AllocFrames();
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
// init decoder
sts = m_pmfxDEC->Init(&m_mfxVideoParams);
MSDK_IGNORE_MFX_STS(sts, MFX_WRN_PARTIAL_ACCELERATION);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
return MFX_ERR_NONE;
}
Thanks.
Jiuxiang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jiuxiang,
It looks like your code is good. The call to m_pmfxDEC->Close() exectutes all the same steps thatdeleting and creating a new MFXVideoDecode object would do, so there is not reason for you to do any more than what your code is currently doing.
Thank you for the question.
-Tony
It looks like your code is good. The call to m_pmfxDEC->Close() exectutes all the same steps thatdeleting and creating a new MFXVideoDecode object would do, so there is not reason for you to do any more than what your code is currently doing.
Thank you for the question.
-Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tony,
It works as you said after I fixed the data stream pipeline.
Thanks.
Jiuxiang
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page