msdkh265dec: Add support for error report too

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/909>
This commit is contained in:
Haihao Xiang 2020-02-17 14:11:15 +08:00 committed by GStreamer Marge Bot
parent 5d891eb40c
commit 449f0ee52a

View file

@ -83,6 +83,17 @@ gst_msdkh265dec_configure (GstMsdkDec * decoder)
* customers still using this for low-latency streaming of non-b-frame
* encoded streams */
decoder->param.mfx.DecodedOrder = h265dec->output_order;
#if (MFX_VERSION >= 1025)
if (decoder->report_error) {
decoder->error_report.Header.BufferId = MFX_EXTBUFF_DECODE_ERROR_REPORT;
decoder->error_report.Header.BufferSz = sizeof (decoder->error_report);
decoder->error_report.ErrorTypes = 0;
gst_msdkdec_add_bs_extra_param (decoder,
(mfxExtBuffer *) & decoder->error_report);
}
#endif
return TRUE;
}
@ -91,6 +102,9 @@ gst_msdkdec_h265_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstMsdkH265Dec *thiz = GST_MSDKH265DEC (object);
#if (MFX_VERSION >= 1025)
GstMsdkDec *dec = GST_MSDKDEC (object);
#endif
GstState state;
GST_OBJECT_LOCK (thiz);
@ -105,6 +119,11 @@ gst_msdkdec_h265_set_property (GObject * object, guint prop_id,
case GST_MSDKDEC_PROP_OUTPUT_ORDER:
thiz->output_order = g_value_get_enum (value);
break;
#if (MFX_VERSION >= 1025)
case GST_MSDKDEC_PROP_ERROR_REPORT:
dec->report_error = g_value_get_boolean (value);
break;
#endif
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@ -118,12 +137,20 @@ gst_msdkdec_h265_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstMsdkH265Dec *thiz = GST_MSDKH265DEC (object);
#if (MFX_VERSION >= 1025)
GstMsdkDec *dec = GST_MSDKDEC (object);
#endif
GST_OBJECT_LOCK (thiz);
switch (prop_id) {
case GST_MSDKDEC_PROP_OUTPUT_ORDER:
g_value_set_enum (value, thiz->output_order);
break;
#if (MFX_VERSION >= 1025)
case GST_MSDKDEC_PROP_ERROR_REPORT:
g_value_set_boolean (value, dec->report_error);
break;
#endif
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@ -155,6 +182,10 @@ gst_msdkh265dec_class_init (GstMsdkH265DecClass * klass)
gst_msdkdec_prop_install_output_oder_property (gobject_class);
#if (MFX_VERSION >= 1025)
gst_msdkdec_prop_install_error_report_property (gobject_class);
#endif
gst_element_class_add_static_pad_template (element_class, &sink_factory);
gst_element_class_add_static_pad_template (element_class, &src_factory);
}