summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2013-09-13 16:25:49 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2013-09-13 16:25:49 +0200
commitb9ceafe5af016df012fab524418ae6b506a1f8a4 (patch)
tree777baa4c87939355124eafd74d6459913d0a579b
parent299d3f5c42ef1def98417da3fb92883a0d95bb4e (diff)
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
-rw-r--r--gst/rtpmanager/gstrtpsession.c6
-rw-r--r--gst/rtpmanager/rtpsession.c16
-rw-r--r--gst/rtpmanager/rtpsession.h3
3 files changed, 12 insertions, 13 deletions
diff --git a/gst/rtpmanager/gstrtpsession.c b/gst/rtpmanager/gstrtpsession.c
index c9beff727..a445be97e 100644
--- a/gst/rtpmanager/gstrtpsession.c
+++ b/gst/rtpmanager/gstrtpsession.c
@@ -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;
diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c
index b68c8b182..d06ad26ce 100644
--- a/gst/rtpmanager/rtpsession.c
+++ b/gst/rtpmanager/rtpsession.c
@@ -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);
diff --git a/gst/rtpmanager/rtpsession.h b/gst/rtpmanager/rtpsession.h
index c8dee2045..3ca6c161e 100644
--- a/gst/rtpmanager/rtpsession.h
+++ b/gst/rtpmanager/rtpsession.h
@@ -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);