From a0c392fc196f4c44f25ebc448f8a028556e09c4d Mon Sep 17 00:00:00 2001 From: He Junyan Date: Fri, 24 Feb 2023 21:09:31 +0800 Subject: [PATCH] h264decoder: fail early if no input caps have been provided The h264decoder class does not implement the ->parse() virtual function, and we always need to add the h264parse 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. Part-of: --- subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c index d62cdca299..4e815e0127 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c @@ -340,6 +340,7 @@ gst_h264_decoder_init (GstH264Decoder * self) GstH264DecoderPrivate *priv; gst_video_decoder_set_packetized (GST_VIDEO_DECODER (self), TRUE); + gst_video_decoder_set_needs_format (GST_VIDEO_DECODER (self), TRUE); self->priv = priv = gst_h264_decoder_get_instance_private (self);