mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
rtpsession: handle NONE RTCP intervals
Prepare for handling RTCP reporting intervals of GST_CLOCK_TIME_NONE, which means don't send RTCP at all.
This commit is contained in:
parent
db3c4e7f46
commit
6eee730c4a
1 changed files with 11 additions and 5 deletions
|
@ -2135,7 +2135,7 @@ rtp_session_schedule_bye (RTPSession * sess, const gchar * reason,
|
|||
GstClockTime
|
||||
rtp_session_next_timeout (RTPSession * sess, GstClockTime current_time)
|
||||
{
|
||||
GstClockTime result;
|
||||
GstClockTime result, interval = 0;
|
||||
|
||||
g_return_val_if_fail (RTP_IS_SESSION (sess), GST_FLOW_ERROR);
|
||||
|
||||
|
@ -2156,23 +2156,29 @@ rtp_session_next_timeout (RTPSession * sess, GstClockTime current_time)
|
|||
if (sess->source->received_bye) {
|
||||
if (sess->sent_bye) {
|
||||
GST_DEBUG ("we sent BYE already");
|
||||
result = GST_CLOCK_TIME_NONE;
|
||||
interval = GST_CLOCK_TIME_NONE;
|
||||
} else if (sess->stats.active_sources >= 50) {
|
||||
GST_DEBUG ("reconsider BYE, more than 50 sources");
|
||||
/* reconsider BYE if members >= 50 */
|
||||
result += calculate_rtcp_interval (sess, FALSE, TRUE);
|
||||
interval = calculate_rtcp_interval (sess, FALSE, TRUE);
|
||||
}
|
||||
} else {
|
||||
if (sess->first_rtcp) {
|
||||
GST_DEBUG ("first RTCP packet");
|
||||
/* we are called for the first time */
|
||||
result += calculate_rtcp_interval (sess, FALSE, TRUE);
|
||||
interval = calculate_rtcp_interval (sess, FALSE, TRUE);
|
||||
} else if (sess->next_rtcp_check_time < current_time) {
|
||||
GST_DEBUG ("old check time expired, getting new timeout");
|
||||
/* get a new timeout when we need to */
|
||||
result += calculate_rtcp_interval (sess, FALSE, FALSE);
|
||||
interval = calculate_rtcp_interval (sess, FALSE, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
if (interval != GST_CLOCK_TIME_NONE)
|
||||
result += interval;
|
||||
else
|
||||
result = GST_CLOCK_TIME_NONE;
|
||||
|
||||
sess->next_rtcp_check_time = result;
|
||||
|
||||
GST_DEBUG ("next timeout: %" GST_TIME_FORMAT, GST_TIME_ARGS (result));
|
||||
|
|
Loading…
Reference in a new issue