diff options
author | Sreerenj Balachandran <sreerenj.balachandran@intel.com> | 2018-07-02 16:48:11 -0800 |
---|---|---|
committer | Sreerenj Balachandran <sreerenj.balachandran@intel.com> | 2018-07-02 16:48:11 -0800 |
commit | ad6162e99b8b06d11a783929720c7e94c113b57b (patch) | |
tree | 1330d71153a442397742dfb7009d57e19992a667 /sys | |
parent | 9efb4c9179aa48437d8d4dbe7fc78f4494602005 (diff) |
msdkdec: Fix advanced profile vc1 decode when codec_data presents
The gst-msdk decoders only support packetized formats for
all codecs except VC1. For VC1, it supports codec_data for advanced
profiles and this codec_data wan't submitting to MSDK's DecodeHeader APIs.
Make sure the subclass deocders correctly configured so that
the codec_data buffers are in place in the internal adapter for
MediaSDK's DecoderHeader usage.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/msdk/gstmsdkdec.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/sys/msdk/gstmsdkdec.c b/sys/msdk/gstmsdkdec.c index c78280d89..a9a82c463 100644 --- a/sys/msdk/gstmsdkdec.c +++ b/sys/msdk/gstmsdkdec.c @@ -842,6 +842,30 @@ gst_msdkdec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame) gsize data_size; gboolean hard_reset = FALSE; + /* configure the subclss inorder to fill the CodecID field of mfxVideoParam + * and also to load the PluginID for some of the codecs which is mandatory + * to invoke the MFXVideoDECODE_DecodeHeader API. + * + * For non packetized formats (currently only vc1), there + * could be headers received as codec_data which are not available + * instream and in that case subclass implementation will + * push it to the internal adapter. We invoke the subclass configure + * well early to make sure the codec_data received has been correctly + * pushed to the adapter by the subclasses before doing + * the DecodeHeader() later on + */ + if (!thiz->initialized || thiz->do_renego) { + /* Clear the internal adapter in renegotiation for non-packetized + * formats */ + if (!thiz->is_packetized) + gst_adapter_clear (thiz->adapter); + + if (!klass->configure || !klass->configure (thiz)) { + flow = GST_FLOW_OK; + goto error; + } + } + if (!gst_buffer_map (frame->input_buffer, &map_info, GST_MAP_READ)) return GST_FLOW_ERROR; @@ -871,14 +895,6 @@ gst_msdkdec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame) if (!thiz->initialized || thiz->do_renego) { - /* configure the subclss inorder to fill the CodecID field of mfxVideoParam - * and also to load the PluginID for some of the codecs which is mandatory - * to invoke the MFXVideoDECODE_DecodeHeader API */ - if (!klass->configure || !klass->configure (thiz)) { - flow = GST_FLOW_OK; - goto error; - } - /* gstreamer caps will not bring all the necessary parameters * required for optimal decode configuration. For eg: the required numbers * of surfaces to be allocated can be calculated based on H264 SEI header |