diff options
author | Mathieu Duponchelle <mathieu@centricular.com> | 2017-11-20 18:08:38 +0100 |
---|---|---|
committer | Mathieu Duponchelle <mathieu@centricular.com> | 2018-02-21 14:15:22 +0100 |
commit | 36b991f0b36266ecfc932674263790f0d8f32788 (patch) | |
tree | 1b1fab173e0c7263ea5e0b4180a22c3075a89c8d | |
parent | b348ddfdedf121b44d7cbf74c8dc0efd3e20b42c (diff) |
rtpptdemux: Add ssrc to output caps
It may be useful downstream
https://bugzilla.gnome.org/show_bug.cgi?id=792696
-rw-r--r-- | gst/rtpmanager/gstrtpptdemux.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gst/rtpmanager/gstrtpptdemux.c b/gst/rtpmanager/gstrtpptdemux.c index 9020a4412..f7d1e687b 100644 --- a/gst/rtpmanager/gstrtpptdemux.c +++ b/gst/rtpmanager/gstrtpptdemux.c @@ -250,6 +250,7 @@ gst_rtp_pt_demux_get_caps (GstRtpPtDemux * rtpdemux, guint pt) GstCaps *caps; GValue ret = { 0 }; GValue args[2] = { {0}, {0} }; + GstCaps *sink_caps; /* figure out the caps */ g_value_init (&args[0], GST_TYPE_ELEMENT); @@ -267,10 +268,25 @@ gst_rtp_pt_demux_get_caps (GstRtpPtDemux * rtpdemux, guint pt) g_value_unset (&args[1]); caps = g_value_dup_boxed (&ret); g_value_unset (&ret); + + sink_caps = gst_pad_get_current_caps (rtpdemux->sink); if (caps == NULL) { - caps = gst_pad_get_current_caps (rtpdemux->sink); + caps = gst_caps_ref (sink_caps); + } else { + GstStructure *s1; + GstStructure *s2; + guint ssrc; + + caps = gst_caps_make_writable (caps); + s1 = gst_caps_get_structure (sink_caps, 0); + s2 = gst_caps_get_structure (caps, 0); + + gst_structure_get_uint (s1, "ssrc", &ssrc); + gst_structure_set (s2, "ssrc", G_TYPE_UINT, ssrc, NULL); } + gst_caps_unref (sink_caps); + GST_DEBUG ("pt %d, got caps %" GST_PTR_FORMAT, pt, caps); return caps; |