From f563176349aa2b2076d33f531b1a8e7511e98a49 Mon Sep 17 00:00:00 2001 From: Jose Antonio Santos Cadenas Date: Wed, 3 Jun 2015 12:22:42 +0200 Subject: [PATCH] rtpssrcdemux: Add support for reduce size rtcp According to RFC 5506, reduce size packages can be sent, this packages may not be compound, so we need to add support for getting ssrc from other types of packages. https://bugzilla.gnome.org/show_bug.cgi?id=750327 --- gst/rtpmanager/gstrtpssrcdemux.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gst/rtpmanager/gstrtpssrcdemux.c b/gst/rtpmanager/gstrtpssrcdemux.c index 0f4b23cae1..762e959fbf 100644 --- a/gst/rtpmanager/gstrtpssrcdemux.c +++ b/gst/rtpmanager/gstrtpssrcdemux.c @@ -678,7 +678,7 @@ gst_rtp_ssrc_demux_rtcp_chain (GstPad * pad, GstObject * parent, demux = GST_RTP_SSRC_DEMUX (parent); - if (!gst_rtcp_buffer_validate (buf)) + if (!gst_rtcp_buffer_validate_reduced (buf)) goto invalid_rtcp; gst_rtcp_buffer_map (buf, GST_MAP_READ, &rtcp); @@ -687,7 +687,9 @@ gst_rtp_ssrc_demux_rtcp_chain (GstPad * pad, GstObject * parent, goto invalid_rtcp; } - /* first packet must be SR or RR or else the validate would have failed */ + /* first packet must be SR or RR, or in case of a reduced size RTCP packet + * it must be APP, RTPFB or PSFB feeadback, or else the validate would + * have failed */ switch (gst_rtcp_packet_get_type (&packet)) { case GST_RTCP_TYPE_SR: /* get the ssrc so that we can route it to the right source pad */ @@ -697,6 +699,11 @@ gst_rtp_ssrc_demux_rtcp_chain (GstPad * pad, GstObject * parent, case GST_RTCP_TYPE_RR: ssrc = gst_rtcp_packet_rr_get_ssrc (&packet); break; + case GST_RTCP_TYPE_APP: + case GST_RTCP_TYPE_RTPFB: + case GST_RTCP_TYPE_PSFB: + ssrc = gst_rtcp_packet_fb_get_sender_ssrc (&packet); + break; default: goto unexpected_rtcp; }