Commit b9ceafe5 authored by Olivier Crête's avatar Olivier Crête 👻 Committed by Wim Taymans

rtpsession: Demux RTCP buffers from the RTP stream

If there are RTCP buffers in the RTP stream, process them as
RTCP. This way, we want receive streams following RFC 5761

https://bugzilla.gnome.org/show_bug.cgi?id=687657
parent 299d3f5c
......@@ -1614,6 +1614,7 @@ gst_rtp_session_chain_recv_rtp (GstPad * pad, GstObject * parent,
GstFlowReturn ret;
GstClockTime current_time, running_time;
GstClockTime timestamp;
guint64 ntpnstime;
rtpsession = GST_RTP_SESSION (parent);
priv = rtpsession->priv;
......@@ -1627,13 +1628,14 @@ gst_rtp_session_chain_recv_rtp (GstPad * pad, GstObject * parent,
running_time =
gst_segment_to_running_time (&rtpsession->recv_rtp_seg, GST_FORMAT_TIME,
timestamp);
ntpnstime = GST_CLOCK_TIME_NONE;
} else {
get_current_times (rtpsession, &running_time, NULL);
get_current_times (rtpsession, &running_time, &ntpnstime);
}
current_time = gst_clock_get_time (priv->sysclock);
ret = rtp_session_process_rtp (priv->session, buffer, current_time,
running_time);
running_time, ntpnstime);
if (ret != GST_FLOW_OK)
goto push_error;
......
......@@ -1712,7 +1712,7 @@ source_update_sender (RTPSession * sess, RTPSource * source,
*/
GstFlowReturn
rtp_session_process_rtp (RTPSession * sess, GstBuffer * buffer,
GstClockTime current_time, GstClockTime running_time)
GstClockTime current_time, GstClockTime running_time, guint64 ntpnstime)
{
GstFlowReturn result;
guint32 ssrc;
......@@ -1729,8 +1729,11 @@ rtp_session_process_rtp (RTPSession * sess, GstBuffer * buffer,
/* update pinfo stats */
if (!update_packet_info (sess, &pinfo, FALSE, TRUE, FALSE, buffer,
current_time, running_time, -1))
goto invalid_packet;
current_time, running_time, ntpnstime)) {
GST_DEBUG ("invalid RTP packet received");
RTP_SESSION_UNLOCK (sess);
return rtp_session_process_rtcp (sess, buffer, current_time, ntpnstime);
}
ssrc = pinfo.ssrc;
......@@ -1791,13 +1794,6 @@ rtp_session_process_rtp (RTPSession * sess, GstBuffer * buffer,
return result;
/* ERRORS */
invalid_packet:
{
gst_buffer_unref (buffer);
RTP_SESSION_UNLOCK (sess);
GST_DEBUG ("invalid RTP packet received");
return GST_FLOW_OK;
}
collision:
{
RTP_SESSION_UNLOCK (sess);
......
......@@ -333,7 +333,8 @@ RTPSource* rtp_session_create_source (RTPSession *sess);
/* processing packets from receivers */
GstFlowReturn rtp_session_process_rtp (RTPSession *sess, GstBuffer *buffer,
GstClockTime current_time,
GstClockTime running_time);
GstClockTime running_time,
guint64 ntpnstime);
GstFlowReturn rtp_session_process_rtcp (RTPSession *sess, GstBuffer *buffer,
GstClockTime current_time,
guint64 ntpnstime);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment