diff options
| author | Justin Kim <justin.kim@collabora.com> | 2017-11-29 21:30:11 +0900 |
|---|---|---|
| committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2018-02-01 10:09:20 +0000 |
| commit | dabeed52a995d27e16eba9e4617e61eb0bcd44c4 (patch) | |
| tree | 88bd12ada6eac06c947f2a226b7f2b037c10c312 | |
| parent | 0c56a80333c6698dfe6f79c987a22b5919a42131 (diff) | |
rtph264depay: update output caps regardless format
`codec_data` should be transfered if any information of
SPS/PPS is changed.
https://bugzilla.gnome.org/show_bug.cgi?id=790000
| -rw-r--r-- | gst/rtp/gstrtph264depay.c | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/gst/rtp/gstrtph264depay.c b/gst/rtp/gstrtph264depay.c index 6a9a97be2..6ce38205c 100644 --- a/gst/rtp/gstrtph264depay.c +++ b/gst/rtp/gstrtph264depay.c @@ -311,7 +311,7 @@ gst_rtp_h264_depay_set_output_caps (GstRtpH264Depay * rtph264depay, static gboolean gst_rtp_h264_set_src_caps (GstRtpH264Depay * rtph264depay) { - gboolean res, update_caps; + gboolean res = TRUE; GstCaps *srccaps; GstCaps *old_caps; GstPad *srcpad; @@ -447,36 +447,8 @@ gst_rtp_h264_set_src_caps (GstRtpH264Depay * rtph264depay) 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 - */ - if (rtph264depay->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_h264_depay_set_output_caps (rtph264depay, srccaps); - } else { - res = TRUE; } gst_caps_unref (srccaps); |
