mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
session: reorganize the report block code
This commit is contained in:
parent
7335b81c47
commit
5b0298c63e
1 changed files with 34 additions and 24 deletions
|
@ -2800,15 +2800,27 @@ static void
|
|||
session_report_blocks (const gchar * key, RTPSource * source, ReportData * data)
|
||||
{
|
||||
GstRTCPPacket *packet = &data->packet;
|
||||
|
||||
if (gst_rtcp_packet_get_rb_count (packet) < GST_RTCP_MAX_RB_COUNT) {
|
||||
/* only report about other sender sources */
|
||||
if (source != data->source && RTP_SOURCE_IS_SENDER (source)) {
|
||||
guint8 fractionlost;
|
||||
gint32 packetslost;
|
||||
guint32 exthighestseq, jitter;
|
||||
guint32 lsr, dlsr;
|
||||
|
||||
/* only report about other sender */
|
||||
if (source == data->source)
|
||||
return;
|
||||
|
||||
if (gst_rtcp_packet_get_rb_count (packet) == GST_RTCP_MAX_RB_COUNT) {
|
||||
GST_DEBUG ("max RB count reached");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!RTP_SOURCE_IS_SENDER (source)) {
|
||||
GST_DEBUG ("source %08x not sender", source->ssrc);
|
||||
return;
|
||||
}
|
||||
|
||||
GST_DEBUG ("create RB for SSRC %08x", source->ssrc);
|
||||
|
||||
/* get new stats */
|
||||
rtp_source_get_new_rb (source, data->current_time, &fractionlost,
|
||||
&packetslost, &exthighestseq, &jitter, &lsr, &dlsr);
|
||||
|
@ -2825,8 +2837,6 @@ session_report_blocks (const gchar * key, RTPSource * source, ReportData * data)
|
|||
/* packet is not yet filled, add report block for this source. */
|
||||
gst_rtcp_packet_add_rb (packet, source->ssrc, fractionlost, packetslost,
|
||||
exthighestseq, jitter, lsr, dlsr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* perform cleanup of sources that timed out */
|
||||
|
|
Loading…
Reference in a new issue