mpeg2decoder: fail early if no input caps have been provided
authorHe Junyan <junyan.he@intel.com>
Fri, 24 Feb 2023 13:12:40 +0000 (21:12 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sat, 25 Feb 2023 10:54:49 +0000 (10:54 +0000)
commit5d4257a4c448740d9ab5844757a91000bf039c60
tree32228b534d9aca0d851b1149cb9123f7e183cee7
parenta0c392fc196f4c44f25ebc448f8a028556e09c4d
mpeg2decoder: fail early if no input caps have been provided

The mpeg2decoder class does not implement the ->parse() virtual function,
and we always need to add the mpegvideoparse 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/4066>
subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2decoder.c