summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorSeungha Yang <seungha@centricular.com>2021-06-30 23:52:26 +0900
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-07-02 06:22:41 +0000
commitadae01e4c3bf6c091e9ddd5f44f03a0d7d4fe6eb (patch)
tree7b01f9da6a1ef10df948d837d0b9740019317e53 /gst
parent6e2924ff9caad772da89cf54ca0e40db2b2276de (diff)
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>
Diffstat (limited to 'gst')
-rw-r--r--gst/isomp4/gstqtmux.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c
index a4d949c0c..dc30d711a 100644
--- a/gst/isomp4/gstqtmux.c
+++ b/gst/isomp4/gstqtmux.c
@@ -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);