rtpptdemux: Add ssrc to output caps

It may be useful downstream

https://bugzilla.gnome.org/show_bug.cgi?id=792696
This commit is contained in:
Mathieu Duponchelle 2017-11-20 18:08:38 +01:00
parent b348ddfded
commit 36b991f0b3

View file

@ -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;