qtmux: Don't need to update track per GstCaps if it's not changed

Skip GstQTMuxPad::set_caps() call for duplicated caps.
All the processing done in set_caps() method for duplicated caps
are redundant.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1019>
This commit is contained in:
Seungha Yang 2021-06-30 23:52:26 +09:00 committed by GStreamer Marge Bot
parent 6e2924ff9c
commit adae01e4c3

View file

@ -6860,7 +6860,19 @@ gst_qt_mux_sink_event (GstAggregator * agg, GstAggregatorPad * agg_pad,
/* find stream data */
g_assert (qtmux_pad->set_caps);
ret = qtmux_pad->set_caps (qtmux_pad, caps);
/* depending on codec (h264/h265 for example), muxer will append a new
* stsd entry per set_caps(), but it's not ideal if referenced fields
* in caps is not updated from previous one.
* Each set_caps() implementation can be more enhanced
* so that we can avoid duplicated atoms though, this identical caps
* case is one we can skip obviously */
if (qtmux_pad->configured_caps &&
gst_caps_is_equal (qtmux_pad->configured_caps, caps)) {
GST_DEBUG_OBJECT (qtmux_pad, "Ignore duplicated caps %" GST_PTR_FORMAT,
caps);
} else {
ret = qtmux_pad->set_caps (qtmux_pad, caps);
}
if (ret)
gst_caps_replace (&qtmux_pad->configured_caps, caps);