mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-05 02:02:26 +00:00
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
This commit is contained in:
parent
299d3f5c42
commit
b9ceafe5af
3 changed files with 12 additions and 13 deletions
|
@ -1614,6 +1614,7 @@ gst_rtp_session_chain_recv_rtp (GstPad * pad, GstObject * parent,
|
||||||
GstFlowReturn ret;
|
GstFlowReturn ret;
|
||||||
GstClockTime current_time, running_time;
|
GstClockTime current_time, running_time;
|
||||||
GstClockTime timestamp;
|
GstClockTime timestamp;
|
||||||
|
guint64 ntpnstime;
|
||||||
|
|
||||||
rtpsession = GST_RTP_SESSION (parent);
|
rtpsession = GST_RTP_SESSION (parent);
|
||||||
priv = rtpsession->priv;
|
priv = rtpsession->priv;
|
||||||
|
@ -1627,13 +1628,14 @@ gst_rtp_session_chain_recv_rtp (GstPad * pad, GstObject * parent,
|
||||||
running_time =
|
running_time =
|
||||||
gst_segment_to_running_time (&rtpsession->recv_rtp_seg, GST_FORMAT_TIME,
|
gst_segment_to_running_time (&rtpsession->recv_rtp_seg, GST_FORMAT_TIME,
|
||||||
timestamp);
|
timestamp);
|
||||||
|
ntpnstime = GST_CLOCK_TIME_NONE;
|
||||||
} else {
|
} else {
|
||||||
get_current_times (rtpsession, &running_time, NULL);
|
get_current_times (rtpsession, &running_time, &ntpnstime);
|
||||||
}
|
}
|
||||||
current_time = gst_clock_get_time (priv->sysclock);
|
current_time = gst_clock_get_time (priv->sysclock);
|
||||||
|
|
||||||
ret = rtp_session_process_rtp (priv->session, buffer, current_time,
|
ret = rtp_session_process_rtp (priv->session, buffer, current_time,
|
||||||
running_time);
|
running_time, ntpnstime);
|
||||||
if (ret != GST_FLOW_OK)
|
if (ret != GST_FLOW_OK)
|
||||||
goto push_error;
|
goto push_error;
|
||||||
|
|
||||||
|
|
|
@ -1712,7 +1712,7 @@ source_update_sender (RTPSession * sess, RTPSource * source,
|
||||||
*/
|
*/
|
||||||
GstFlowReturn
|
GstFlowReturn
|
||||||
rtp_session_process_rtp (RTPSession * sess, GstBuffer * buffer,
|
rtp_session_process_rtp (RTPSession * sess, GstBuffer * buffer,
|
||||||
GstClockTime current_time, GstClockTime running_time)
|
GstClockTime current_time, GstClockTime running_time, guint64 ntpnstime)
|
||||||
{
|
{
|
||||||
GstFlowReturn result;
|
GstFlowReturn result;
|
||||||
guint32 ssrc;
|
guint32 ssrc;
|
||||||
|
@ -1729,8 +1729,11 @@ rtp_session_process_rtp (RTPSession * sess, GstBuffer * buffer,
|
||||||
|
|
||||||
/* update pinfo stats */
|
/* update pinfo stats */
|
||||||
if (!update_packet_info (sess, &pinfo, FALSE, TRUE, FALSE, buffer,
|
if (!update_packet_info (sess, &pinfo, FALSE, TRUE, FALSE, buffer,
|
||||||
current_time, running_time, -1))
|
current_time, running_time, ntpnstime)) {
|
||||||
goto invalid_packet;
|
GST_DEBUG ("invalid RTP packet received");
|
||||||
|
RTP_SESSION_UNLOCK (sess);
|
||||||
|
return rtp_session_process_rtcp (sess, buffer, current_time, ntpnstime);
|
||||||
|
}
|
||||||
|
|
||||||
ssrc = pinfo.ssrc;
|
ssrc = pinfo.ssrc;
|
||||||
|
|
||||||
|
@ -1791,13 +1794,6 @@ rtp_session_process_rtp (RTPSession * sess, GstBuffer * buffer,
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
invalid_packet:
|
|
||||||
{
|
|
||||||
gst_buffer_unref (buffer);
|
|
||||||
RTP_SESSION_UNLOCK (sess);
|
|
||||||
GST_DEBUG ("invalid RTP packet received");
|
|
||||||
return GST_FLOW_OK;
|
|
||||||
}
|
|
||||||
collision:
|
collision:
|
||||||
{
|
{
|
||||||
RTP_SESSION_UNLOCK (sess);
|
RTP_SESSION_UNLOCK (sess);
|
||||||
|
|
|
@ -333,7 +333,8 @@ RTPSource* rtp_session_create_source (RTPSession *sess);
|
||||||
/* processing packets from receivers */
|
/* processing packets from receivers */
|
||||||
GstFlowReturn rtp_session_process_rtp (RTPSession *sess, GstBuffer *buffer,
|
GstFlowReturn rtp_session_process_rtp (RTPSession *sess, GstBuffer *buffer,
|
||||||
GstClockTime current_time,
|
GstClockTime current_time,
|
||||||
GstClockTime running_time);
|
GstClockTime running_time,
|
||||||
|
guint64 ntpnstime);
|
||||||
GstFlowReturn rtp_session_process_rtcp (RTPSession *sess, GstBuffer *buffer,
|
GstFlowReturn rtp_session_process_rtcp (RTPSession *sess, GstBuffer *buffer,
|
||||||
GstClockTime current_time,
|
GstClockTime current_time,
|
||||||
guint64 ntpnstime);
|
guint64 ntpnstime);
|
||||||
|
|
Loading…
Reference in a new issue