vp8decoder: fail early if no input caps have been provided
authorHe Junyan <junyan.he@intel.com>
Fri, 24 Feb 2023 13:27:27 +0000 (21:27 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sat, 25 Feb 2023 10:54:49 +0000 (10:54 +0000)
The vp8decoder class does not implement the ->parse() virtual function,
it can only accepts frame aligned data. If some element such as filesrc
feed it with unaligned data, the behaviour is undecided. So we should
set_needs_format of the decoder to TRUE, then it can fail with a
"not-negotiated" error early, rather than go on and generate unexpected
error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4066>

subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8decoder.c

index 97d72fa..411f272 100644 (file)
@@ -102,6 +102,7 @@ static void
 gst_vp8_decoder_init (GstVp8Decoder * 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_vp8_decoder_get_instance_private (self);
 }