diff --git a/sys/va/gstvaav1dec.c b/sys/va/gstvaav1dec.c index 0ac65a228c..ff055ca2a0 100644 --- a/sys/va/gstvaav1dec.c +++ b/sys/va/gstvaav1dec.c @@ -80,9 +80,6 @@ struct _GstVaAV1Dec gboolean need_negotiation; }; -#define parent_class gst_va_base_dec_parent_class -extern gpointer gst_va_base_dec_parent_class; - /* *INDENT-OFF* */ static const gchar *src_caps_str = GST_VIDEO_CAPS_MAKE_WITH_FEATURES ("memory:VAMemory", "{ NV12, P010_10LE }") " ;" GST_VIDEO_CAPS_MAKE ("{ NV12, P010_10LE }"); @@ -136,7 +133,8 @@ gst_va_av1_dec_negotiate (GstVideoDecoder * decoder) GST_INFO_OBJECT (self, "Negotiated caps %" GST_PTR_FORMAT, base->output_state->caps); - return GST_VIDEO_DECODER_CLASS (parent_class)->negotiate (decoder); + return GST_VIDEO_DECODER_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS + (decoder))->negotiate (decoder); } static GstCaps * @@ -871,7 +869,7 @@ static void gst_va_av1_dec_dispose (GObject * object) { gst_va_base_dec_close (GST_VIDEO_DECODER (object)); - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS (object))->dispose (object); } static void diff --git a/sys/va/gstvabasedec.c b/sys/va/gstvabasedec.c index 1bf2ca827e..028e0cf0ae 100644 --- a/sys/va/gstvabasedec.c +++ b/sys/va/gstvabasedec.c @@ -28,9 +28,6 @@ #define GST_CAT_DEFAULT (base->debug_category) -#define parent_class gst_va_base_dec_parent_class -gpointer gst_va_base_dec_parent_class = NULL; - static gboolean gst_va_base_dec_open (GstVideoDecoder * decoder) { @@ -86,7 +83,8 @@ gst_va_base_dec_stop (GstVideoDecoder * decoder) gst_buffer_pool_set_active (base->other_pool, FALSE); gst_clear_object (&base->other_pool); - return GST_VIDEO_DECODER_CLASS (parent_class)->stop (decoder); + return GST_VIDEO_DECODER_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS + (decoder))->stop (decoder); } static GstCaps * @@ -175,7 +173,8 @@ gst_va_base_dec_src_query (GstVideoDecoder * decoder, GstQuery * query) /* else jump to default */ } default: - ret = GST_VIDEO_DECODER_CLASS (parent_class)->src_query (decoder, query); + ret = GST_VIDEO_DECODER_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS + (decoder))->src_query (decoder, query); break; } @@ -187,7 +186,8 @@ gst_va_base_dec_sink_query (GstVideoDecoder * decoder, GstQuery * query) { if (GST_QUERY_TYPE (query) == GST_QUERY_CONTEXT) return _query_context (GST_VA_BASE_DEC (decoder), query); - return GST_VIDEO_DECODER_CLASS (parent_class)->sink_query (decoder, query); + return GST_VIDEO_DECODER_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS + (decoder))->sink_query (decoder, query); } static GstAllocator * @@ -408,7 +408,8 @@ gst_va_base_dec_set_context (GstElement * element, GstContext * context) gst_clear_object (&old_display); gst_clear_object (&new_display); - GST_ELEMENT_CLASS (parent_class)->set_context (element, context); + GST_ELEMENT_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS + (element))->set_context (element, context); } void @@ -426,7 +427,7 @@ gst_va_base_dec_class_init (GstVaBaseDecClass * klass, GstVaCodecs codec, GstElementClass *element_class = GST_ELEMENT_CLASS (klass); GstVideoDecoderClass *decoder_class = GST_VIDEO_DECODER_CLASS (klass); - gst_va_base_dec_parent_class = g_type_class_peek_parent (klass); + klass->parent_decoder_class = g_type_class_peek_parent (klass); klass->codec = codec; klass->render_device_path = g_strdup (render_device_path); diff --git a/sys/va/gstvabasedec.h b/sys/va/gstvabasedec.h index e3d034baa7..4718d45f1c 100644 --- a/sys/va/gstvabasedec.h +++ b/sys/va/gstvabasedec.h @@ -37,6 +37,7 @@ G_BEGIN_DECLS #define GST_VA_BASE_DEC(obj) ((GstVaBaseDec *)(obj)) #define GST_VA_BASE_DEC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_FROM_INSTANCE (obj), GstVaBaseDecClass)) #define GST_VA_BASE_DEC_CLASS(klass) ((GstVaBaseDecClass *)(klass)) +#define GST_VA_BASE_DEC_GET_PARENT_CLASS(obj) (GST_VA_BASE_DEC_GET_CLASS(obj)->parent_decoder_class) typedef struct _GstVaBaseDec GstVaBaseDec; typedef struct _GstVaBaseDecClass GstVaBaseDecClass; @@ -90,6 +91,8 @@ struct _GstVaBaseDecClass GstVaCodecs codec; gchar *render_device_path; + /* The parent class in GType hierarchy */ + GstObjectClass *parent_decoder_class; }; struct CData diff --git a/sys/va/gstvah264dec.c b/sys/va/gstvah264dec.c index cbe8f7a10f..571eddf7a9 100644 --- a/sys/va/gstvah264dec.c +++ b/sys/va/gstvah264dec.c @@ -89,9 +89,6 @@ struct _GstVaH264Dec gboolean interlaced; }; -#define parent_class gst_va_base_dec_parent_class -extern gpointer gst_va_base_dec_parent_class; - /* *INDENT-OFF* */ static const gchar *src_caps_str = GST_VIDEO_CAPS_MAKE_WITH_FEATURES ("memory:VAMemory", "{ NV12, P010_10LE }") " ;" GST_VIDEO_CAPS_MAKE ("{ NV12, P010_10LE }"); @@ -825,7 +822,8 @@ gst_va_h264_dec_negotiate (GstVideoDecoder * decoder) GST_INFO_OBJECT (self, "Negotiated caps %" GST_PTR_FORMAT, base->output_state->caps); - return GST_VIDEO_DECODER_CLASS (parent_class)->negotiate (decoder); + return GST_VIDEO_DECODER_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS + (decoder))->negotiate (decoder); } static void @@ -836,7 +834,7 @@ gst_va_h264_dec_dispose (GObject * object) gst_va_base_dec_close (GST_VIDEO_DECODER (object)); g_clear_pointer (&self->ref_list, g_array_unref); - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS (object))->dispose (object); } static void diff --git a/sys/va/gstvah265dec.c b/sys/va/gstvah265dec.c index 600c7abeff..25f0d39239 100644 --- a/sys/va/gstvah265dec.c +++ b/sys/va/gstvah265dec.c @@ -92,9 +92,6 @@ struct _GstVaH265Dec gboolean need_negotiation; }; -#define parent_class gst_va_base_dec_parent_class -extern gpointer gst_va_base_dec_parent_class; - /* *INDENT-OFF* */ static const gchar *src_caps_str = GST_VIDEO_CAPS_MAKE_WITH_FEATURES ("memory:VAMemory", "{ NV12, P010_10LE }") " ;" GST_VIDEO_CAPS_MAKE ("{ NV12, P010_10LE }"); @@ -388,8 +385,8 @@ gst_va_h265_dec_decode_slice (GstH265Decoder * decoder, header->deblocking_filter_disabled_flag; slice_param.LongSliceFlags.fields.collocated_from_l0_flag = header->collocated_from_l0_flag; - slice_param.LongSliceFlags. - fields.slice_loop_filter_across_slices_enabled_flag = + slice_param.LongSliceFlags.fields. + slice_loop_filter_across_slices_enabled_flag = header->loop_filter_across_slices_enabled_flag; _fill_ref_pic_list (decoder, picture, slice_param.RefPicList[0], @@ -898,14 +895,15 @@ gst_va_h265_dec_negotiate (GstVideoDecoder * decoder) GST_INFO_OBJECT (self, "Negotiated caps %" GST_PTR_FORMAT, base->output_state->caps); - return GST_VIDEO_DECODER_CLASS (parent_class)->negotiate (decoder); + return GST_VIDEO_DECODER_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS + (decoder))->negotiate (decoder); } static void gst_va_h265_dec_dispose (GObject * object) { gst_va_base_dec_close (GST_VIDEO_DECODER (object)); - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS (object))->dispose (object); } static void diff --git a/sys/va/gstvampeg2dec.c b/sys/va/gstvampeg2dec.c index e200a63396..426eb0e743 100644 --- a/sys/va/gstvampeg2dec.c +++ b/sys/va/gstvampeg2dec.c @@ -76,9 +76,6 @@ struct _GstVaMpeg2Dec GstMpegVideoSequenceHdr seq; }; -#define parent_class gst_va_base_dec_parent_class -extern gpointer gst_va_base_dec_parent_class; - /* *INDENT-OFF* */ static const gchar *src_caps_str = GST_VIDEO_CAPS_MAKE_WITH_FEATURES ("memory:VAMemory", "{ NV12 }") " ;" GST_VIDEO_CAPS_MAKE ("{ NV12 }"); @@ -132,7 +129,8 @@ gst_va_mpeg2_dec_negotiate (GstVideoDecoder * decoder) GST_INFO_OBJECT (self, "Negotiated caps %" GST_PTR_FORMAT, base->output_state->caps); - return GST_VIDEO_DECODER_CLASS (parent_class)->negotiate (decoder); + return GST_VIDEO_DECODER_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS + (decoder))->negotiate (decoder); } static VAProfile @@ -604,7 +602,7 @@ static void gst_va_mpeg2_dec_dispose (GObject * object) { gst_va_base_dec_close (GST_VIDEO_DECODER (object)); - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS (object))->dispose (object); } static void diff --git a/sys/va/gstvavp8dec.c b/sys/va/gstvavp8dec.c index 136e798c4d..b8cf57bf85 100644 --- a/sys/va/gstvavp8dec.c +++ b/sys/va/gstvavp8dec.c @@ -75,9 +75,6 @@ struct _GstVaVp8Dec gboolean need_negotiation; }; -#define parent_class gst_va_base_dec_parent_class -extern gpointer gst_va_base_dec_parent_class; - /* *INDENT-OFF* */ static const gchar *src_caps_str = GST_VIDEO_CAPS_MAKE_WITH_FEATURES ("memory:VAMemory", "{ NV12 }") " ;" GST_VIDEO_CAPS_MAKE ("{ NV12 }"); @@ -128,7 +125,8 @@ gst_va_vp8_dec_negotiate (GstVideoDecoder * decoder) GST_INFO_OBJECT (self, "Negotiated caps %" GST_PTR_FORMAT, base->output_state->caps); - return GST_VIDEO_DECODER_CLASS (parent_class)->negotiate (decoder); + return GST_VIDEO_DECODER_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS + (decoder))->negotiate (decoder); } static VAProfile @@ -466,7 +464,7 @@ static void gst_va_vp8_dec_dispose (GObject * object) { gst_va_base_dec_close (GST_VIDEO_DECODER (object)); - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS (object))->dispose (object); } static void diff --git a/sys/va/gstvavp9dec.c b/sys/va/gstvavp9dec.c index df9bda7db6..9868c0a9a2 100644 --- a/sys/va/gstvavp9dec.c +++ b/sys/va/gstvavp9dec.c @@ -73,9 +73,6 @@ struct _GstVaVp9Dec gboolean need_negotiation; }; -#define parent_class gst_va_base_dec_parent_class -extern gpointer gst_va_base_dec_parent_class; - /* *INDENT-OFF* */ static const gchar *src_caps_str = GST_VIDEO_CAPS_MAKE_WITH_FEATURES ("memory:VAMemory", "{ NV12 }") " ;" GST_VIDEO_CAPS_MAKE ("{ NV12 }"); @@ -520,14 +517,15 @@ gst_va_vp9_dec_negotiate (GstVideoDecoder * decoder) GST_INFO_OBJECT (self, "Negotiated caps %" GST_PTR_FORMAT, base->output_state->caps); - return GST_VIDEO_DECODER_CLASS (parent_class)->negotiate (decoder); + return GST_VIDEO_DECODER_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS + (decoder))->negotiate (decoder); } static void gst_va_vp9_dec_dispose (GObject * object) { gst_va_base_dec_close (GST_VIDEO_DECODER (object)); - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (GST_VA_BASE_DEC_GET_PARENT_CLASS (object))->dispose (object); } static void