mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
session: get SSRC from RTCP packet itself
Get the SSRC from the RTCP packet instead.
This commit is contained in:
parent
a3f75a17ef
commit
391943ba82
1 changed files with 21 additions and 8 deletions
|
@ -3315,12 +3315,26 @@ rtp_session_on_sending_rtcp (RTPSession * sess, GstBuffer * buffer,
|
||||||
gpointer key, value;
|
gpointer key, value;
|
||||||
gboolean started_fir = FALSE;
|
gboolean started_fir = FALSE;
|
||||||
GstRTCPPacket fir_rtcppacket;
|
GstRTCPPacket fir_rtcppacket;
|
||||||
|
GstRTCPPacket packet;
|
||||||
GstRTCPBuffer rtcp = { NULL, };
|
GstRTCPBuffer rtcp = { NULL, };
|
||||||
|
guint32 ssrc;
|
||||||
RTP_SESSION_LOCK (sess);
|
|
||||||
|
|
||||||
gst_rtcp_buffer_map (buffer, GST_MAP_READWRITE, &rtcp);
|
gst_rtcp_buffer_map (buffer, GST_MAP_READWRITE, &rtcp);
|
||||||
|
|
||||||
|
gst_rtcp_buffer_get_first_packet (&rtcp, &packet);
|
||||||
|
switch (gst_rtcp_packet_get_type (&packet)) {
|
||||||
|
case GST_RTCP_TYPE_SR:
|
||||||
|
gst_rtcp_packet_sr_get_sender_info (&packet, &ssrc,
|
||||||
|
NULL, NULL, NULL, NULL);
|
||||||
|
break;
|
||||||
|
case GST_RTCP_TYPE_RR:
|
||||||
|
ssrc = gst_rtcp_packet_rr_get_ssrc (&packet);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
RTP_SESSION_LOCK (sess);
|
||||||
g_hash_table_iter_init (&iter, sess->ssrcs[sess->mask_idx]);
|
g_hash_table_iter_init (&iter, sess->ssrcs[sess->mask_idx]);
|
||||||
while (g_hash_table_iter_next (&iter, &key, &value)) {
|
while (g_hash_table_iter_next (&iter, &key, &value)) {
|
||||||
guint media_ssrc = GPOINTER_TO_UINT (key);
|
guint media_ssrc = GPOINTER_TO_UINT (key);
|
||||||
|
@ -3333,8 +3347,7 @@ rtp_session_on_sending_rtcp (RTPSession * sess, GstBuffer * buffer,
|
||||||
&fir_rtcppacket))
|
&fir_rtcppacket))
|
||||||
break;
|
break;
|
||||||
gst_rtcp_packet_fb_set_type (&fir_rtcppacket, GST_RTCP_PSFB_TYPE_FIR);
|
gst_rtcp_packet_fb_set_type (&fir_rtcppacket, GST_RTCP_PSFB_TYPE_FIR);
|
||||||
gst_rtcp_packet_fb_set_sender_ssrc (&fir_rtcppacket,
|
gst_rtcp_packet_fb_set_sender_ssrc (&fir_rtcppacket, ssrc);
|
||||||
rtp_source_get_ssrc (sess->source));
|
|
||||||
gst_rtcp_packet_fb_set_media_ssrc (&fir_rtcppacket, 0);
|
gst_rtcp_packet_fb_set_media_ssrc (&fir_rtcppacket, 0);
|
||||||
|
|
||||||
if (!gst_rtcp_packet_fb_set_fci_length (&fir_rtcppacket, 2)) {
|
if (!gst_rtcp_packet_fb_set_fci_length (&fir_rtcppacket, 2)) {
|
||||||
|
@ -3374,17 +3387,17 @@ rtp_session_on_sending_rtcp (RTPSession * sess, GstBuffer * buffer,
|
||||||
* further packet */
|
* further packet */
|
||||||
break;
|
break;
|
||||||
gst_rtcp_packet_fb_set_type (&pli_rtcppacket, GST_RTCP_PSFB_TYPE_PLI);
|
gst_rtcp_packet_fb_set_type (&pli_rtcppacket, GST_RTCP_PSFB_TYPE_PLI);
|
||||||
gst_rtcp_packet_fb_set_sender_ssrc (&pli_rtcppacket,
|
gst_rtcp_packet_fb_set_sender_ssrc (&pli_rtcppacket, ssrc);
|
||||||
rtp_source_get_ssrc (sess->source));
|
|
||||||
gst_rtcp_packet_fb_set_media_ssrc (&pli_rtcppacket, media_ssrc);
|
gst_rtcp_packet_fb_set_media_ssrc (&pli_rtcppacket, media_ssrc);
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
media_src->send_pli = FALSE;
|
media_src->send_pli = FALSE;
|
||||||
}
|
}
|
||||||
gst_rtcp_buffer_unmap (&rtcp);
|
|
||||||
|
|
||||||
RTP_SESSION_UNLOCK (sess);
|
RTP_SESSION_UNLOCK (sess);
|
||||||
|
|
||||||
|
done:
|
||||||
|
gst_rtcp_buffer_unmap (&rtcp);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue