vp8decoder: fail early if no input caps have been provided

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/4064>
This commit is contained in:
He Junyan 2023-02-24 21:27:27 +08:00
parent a965be8d96
commit c8af9adcdc

View 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);
}