smartencoder: clean up and extend accepted formats
authorMathieu Duponchelle <mathieu@centricular.com>
Tue, 10 Aug 2021 00:09:09 +0000 (02:09 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 20 Aug 2021 14:20:25 +0000 (14:20 +0000)
commit4aa72cea4f99c9c47f5d88f294942b8db4a60aa0
tree9e707a5dadedf794db5945757fa7aacbee1bed46
parent1ae8b61ec09c48a9f82b3173472903c13d513c74
smartencoder: clean up and extend accepted formats

* Add support for H265

* Don't overwrite original codec_data / streamheader in the output
  caps, but instead allow them to change and send them to the
  combiner at the right moment: encoder caps, reencoded GOP,
  original caps, original GOP(s), and potentially encoder caps
  and rencoded last GOP.

* For H264 / H265, force usage of a format with inband SPS / PPS
  (avc3 / hev1), this is cleaner than misadvertising avc1, hvc1 and
  some muxers like mp4mux will actually advertise both differently.

  Unfortunately, while mp4 supports updating the codec_data and using
  avc1 with no in-band SPS / PPS updates, it turns out some decoders
  (eg chrome / firefox) don't handle this particularly well and stop
  decoding after the reencoded GOP. We could expose a switch to
  force usage of avc1 / hvc1 nevertheless, but for now stick to
  requiring that the parser output SPS / PPS in-band with
  config-interval=-1 (that has not changed)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1249>
gst/encoding/gstencodebasebin.c
gst/encoding/gstsmartencoder.c
gst/encoding/gstsmartencoder.h