summaryrefslogtreecommitdiff
path: root/sys/va/gstvavp9dec.c
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@intel.com>2021-05-09 23:42:46 +0800
committerHe Junyan <junyan.he@intel.com>2021-05-10 22:47:11 +0800
commit64b596103a5412144a599755da45c3268c9ab980 (patch)
treef14a5a6dcc632f314f9f23cf2747c4909233d64b /sys/va/gstvavp9dec.c
parentda2772235199924e61cc588ceb81e6bc420f0adf (diff)
downloadgstreamer-plugins-bad-64b596103a5412144a599755da45c3268c9ab980.tar.gz
va: Do not use a common parent_class in vabasedec.
We have only one copy of gst_va_base_dec_parent_class inside the vabasedec, so it can not handle the case when there are multi va decoders inside one pipeline. The pipeline: gst-launch-1.0 filesrc location=xxx.h264 ! h264parse \ ! vah264dec ! msdkh265enc ! vah265dec ! fakesink generates a assertion of "invalid cast from 'GstVaH264Dec' to 'GstH265Decoder" and gets a crash. We should keep the parent_class for each decoder type. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2231>
Diffstat (limited to 'sys/va/gstvavp9dec.c')
-rw-r--r--sys/va/gstvavp9dec.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/va/gstvavp9dec.c b/sys/va/gstvavp9dec.c
index df9bda7db..9868c0a9a 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