va: Do not use a common parent_class in vabasedec.
authorHe Junyan <junyan.he@intel.com>
Sun, 9 May 2021 15:42:46 +0000 (23:42 +0800)
committerHe Junyan <junyan.he@intel.com>
Mon, 10 May 2021 14:47:11 +0000 (22:47 +0800)
commit64b596103a5412144a599755da45c3268c9ab980
treef14a5a6dcc632f314f9f23cf2747c4909233d64b
parentda2772235199924e61cc588ceb81e6bc420f0adf
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>
sys/va/gstvaav1dec.c
sys/va/gstvabasedec.c
sys/va/gstvabasedec.h
sys/va/gstvah264dec.c
sys/va/gstvah265dec.c
sys/va/gstvampeg2dec.c
sys/va/gstvavp8dec.c
sys/va/gstvavp9dec.c