From: He Junyan Date: Fri, 24 Feb 2023 13:58:00 +0000 (+0800) Subject: jpegdecoder: fail early if no input caps have been provided X-Git-Tag: 1.22.7~448 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c762b7717dffa40117104ea795e13ca6498dff8;p=platform%2Fupstream%2Fgstreamer.git jpegdecoder: fail early if no input caps have been provided The jpegdecoder class does not implement the ->parse() virtual function, and we always need to add the jpegparse element before it. So we should set_needs_format of the decoder to TRUE, then if no parse before it, it can fail with a "not-negotiated" error early, rather than go on and generate unexpected error. Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1829 Part-of: --- diff --git a/subprojects/gst-plugins-bad/sys/va/gstjpegdecoder.c b/subprojects/gst-plugins-bad/sys/va/gstjpegdecoder.c index 9771f5c..ce2c67d 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstjpegdecoder.c +++ b/subprojects/gst-plugins-bad/sys/va/gstjpegdecoder.c @@ -90,6 +90,8 @@ static void gst_jpeg_decoder_init (GstJpegDecoder * self) { gst_video_decoder_set_packetized (GST_VIDEO_DECODER (self), TRUE); + gst_video_decoder_set_needs_format (GST_VIDEO_DECODER (self), TRUE); + self->priv = gst_jpeg_decoder_get_instance_private (self); }