av1decoder: fail early if no input caps have been provided

The av1decoder class does not implement the ->parse() virtual function,
and we always need to add the av1parse 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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4064>
This commit is contained in:
He Junyan 2023-02-24 21:49:27 +08:00
parent 30a05a3999
commit 76585b3a05

View file

@ -119,6 +119,7 @@ gst_av1_decoder_init (GstAV1Decoder * self)
GstAV1DecoderPrivate *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_av1_decoder_get_instance_private (self);