encodebin: Fix and refactor smart encoding
authorThibault Saunier <tsaunier@igalia.com>
Sat, 4 Jul 2020 16:33:20 +0000 (12:33 -0400)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 22 Jul 2020 16:01:25 +0000 (16:01 +0000)
commit1cead20777cf7705b3926fe696df1e6d2f58c373
treec968d2a82a2637ff606811a0fca1a242f1b47d90
parentd10929da7c97074638b74424b720b9405e6d2cdb
encodebin: Fix and refactor smart encoding

It was not working properly and the implementation of the smartencoder
element was weird. This introduce a number of changes (which are all
in one single commit because they basically all work together and lead
to basically reimplementing the element):

* Make smartencoder a bin so that the reencoding chain of elements are
  inside of it instead of not having any parent. Those elements were not
  be visible when dumping the pipeline which was very confusing.
* Make encodebin create the right encoder with a capsfilter (and parser)
  to properly enforce the format specified by the user, and so that the
  encoder properties specified in the encoding profile are respected.
* Use `decodebin` to do the decoding instead of selecting a decoder
  ourself and not plug any parser etc...
* Ensure that negotiated format in the sinkpad of smart encoder is fixed
  through time when the user requested a non dynamic output
* Add a parser at the beginning of the smart encoder
* Handle errors when reencoding

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/751>
gst-libs/gst/pbutils/encoding-profile.c
gst/encoding/gstencodebin.c
gst/encoding/gstsmartencoder.c
gst/encoding/gstsmartencoder.h