mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 07:38:16 +00:00
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:
parent
b348ddfded
commit
36b991f0b3
1 changed files with 17 additions and 1 deletions
|
@ -250,6 +250,7 @@ gst_rtp_pt_demux_get_caps (GstRtpPtDemux * rtpdemux, guint pt)
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
GValue ret = { 0 };
|
GValue ret = { 0 };
|
||||||
GValue args[2] = { {0}, {0} };
|
GValue args[2] = { {0}, {0} };
|
||||||
|
GstCaps *sink_caps;
|
||||||
|
|
||||||
/* figure out the caps */
|
/* figure out the caps */
|
||||||
g_value_init (&args[0], GST_TYPE_ELEMENT);
|
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]);
|
g_value_unset (&args[1]);
|
||||||
caps = g_value_dup_boxed (&ret);
|
caps = g_value_dup_boxed (&ret);
|
||||||
g_value_unset (&ret);
|
g_value_unset (&ret);
|
||||||
|
|
||||||
|
sink_caps = gst_pad_get_current_caps (rtpdemux->sink);
|
||||||
if (caps == NULL) {
|
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);
|
GST_DEBUG ("pt %d, got caps %" GST_PTR_FORMAT, pt, caps);
|
||||||
|
|
||||||
return caps;
|
return caps;
|
||||||
|
|
Loading…
Reference in a new issue