diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2021-06-16 16:30:59 +0530 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-08-23 12:03:40 +0000 |
commit | e854146e65497c42a986d1f8b125e7e404dc6e8e (patch) | |
tree | edc82342c3a9dd2af1952c9d1d30dfc880a75a37 | |
parent | f484e87c65de9ed5a6a47029835a4e9e04c7739a (diff) | |
download | gstreamer-plugins-good-e854146e65497c42a986d1f8b125e7e404dc6e8e.tar.gz |
rtph265depay: update codec_data in caps regardless of format
Updating of codec_data in the caps is important to propagate changes
in sps/pps/vps via NALs. Without this, downstream does not renegotiate
when upstream changes resolution.
The comment referring to rtph264pay is from 2015 and is out of date.
rtph264pay stopped doing that in 2017 with commit
dabeed52a995d27e16eba9e4617e61eb0bcd44c4
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1025>
-rw-r--r-- | gst/rtp/gstrtph265depay.c | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/gst/rtp/gstrtph265depay.c b/gst/rtp/gstrtph265depay.c index 38f53e4de..46553f0e1 100644 --- a/gst/rtp/gstrtph265depay.c +++ b/gst/rtp/gstrtph265depay.c @@ -384,7 +384,7 @@ gst_rtp_h265_depay_set_output_caps (GstRtpH265Depay * rtph265depay, static gboolean gst_rtp_h265_set_src_caps (GstRtpH265Depay * rtph265depay) { - gboolean res, update_caps; + gboolean res; GstCaps *old_caps; GstCaps *srccaps; GstPad *srcpad; @@ -594,36 +594,9 @@ gst_rtp_h265_set_src_caps (GstRtpH265Depay * rtph265depay) } srcpad = GST_RTP_BASE_DEPAYLOAD_SRCPAD (rtph265depay); - old_caps = gst_pad_get_current_caps (srcpad); - if (old_caps != NULL) { - - /* Only update the caps if they are not equal. For - * AVC we don't update caps if only the codec_data - * changes. This is the same behaviour as in h264parse - * and gstrtph264depay - */ - if (rtph265depay->byte_stream) { - update_caps = !gst_caps_is_equal (srccaps, old_caps); - } else { - GstCaps *tmp_caps = gst_caps_copy (srccaps); - GstStructure *old_s, *tmp_s; - - old_s = gst_caps_get_structure (old_caps, 0); - tmp_s = gst_caps_get_structure (tmp_caps, 0); - if (gst_structure_has_field (old_s, "codec_data")) - gst_structure_set_value (tmp_s, "codec_data", - gst_structure_get_value (old_s, "codec_data")); - - update_caps = !gst_caps_is_equal (old_caps, tmp_caps); - gst_caps_unref (tmp_caps); - } - gst_caps_unref (old_caps); - } else { - update_caps = TRUE; - } - if (update_caps) { + if (old_caps == NULL || !gst_caps_is_equal (srccaps, old_caps)) { res = gst_rtp_h265_depay_set_output_caps (rtph265depay, srccaps); } else { res = TRUE; |