Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 | 178 |
| 179 // Get processed rtt. | 179 // Get processed rtt. |
| 180 if (process_rtt) { | 180 if (process_rtt) { |
| 181 last_rtt_process_time_ = now; | 181 last_rtt_process_time_ = now; |
| 182 if (rtt_stats_) | 182 if (rtt_stats_) |
| 183 set_rtt_ms(rtt_stats_->LastProcessedRtt()); | 183 set_rtt_ms(rtt_stats_->LastProcessedRtt()); |
| 184 } | 184 } |
| 185 | 185 |
| 186 if (rtcp_sender_.TimeToSendRTCPReport()) | 186 // For sending streams, make sure to not send a SR before media has been sent. |
| 187 rtcp_sender_.SendRTCP(GetFeedbackState(), kRtcpReport); | 187 if (rtcp_sender_.TimeToSendRTCPReport()) { |
| 188 RTCPSender::FeedbackState state = GetFeedbackState(); | |
| 189 // Prevent send streams to send SR before any media has been sent. | |
| 190 if (!rtcp_sender_.Sending() || state.packets_sent > 0) | |
| 191 rtcp_sender_.SendRTCP(state, kRtcpReport); | |
| 192 } | |
| 188 | 193 |
| 189 if (UpdateRTCPReceiveInformationTimers()) { | 194 if (UpdateRTCPReceiveInformationTimers()) { |
| 190 // A receiver has timed out | 195 // A receiver has timed out |
| 191 rtcp_receiver_.UpdateTMMBR(); | 196 rtcp_receiver_.UpdateTMMBR(); |
| 192 } | 197 } |
| 193 return 0; | 198 return 0; |
| 194 } | 199 } |
| 195 | 200 |
| 196 void ModuleRtpRtcpImpl::SetRtxSendStatus(int mode) { | 201 void ModuleRtpRtcpImpl::SetRtxSendStatus(int mode) { |
| 197 rtp_sender_.SetRtxStatus(mode); | 202 rtp_sender_.SetRtxStatus(mode); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 395 int32_t ModuleRtpRtcpImpl::SendOutgoingData( | 400 int32_t ModuleRtpRtcpImpl::SendOutgoingData( |
| 396 FrameType frame_type, | 401 FrameType frame_type, |
| 397 int8_t payload_type, | 402 int8_t payload_type, |
| 398 uint32_t time_stamp, | 403 uint32_t time_stamp, |
| 399 int64_t capture_time_ms, | 404 int64_t capture_time_ms, |
| 400 const uint8_t* payload_data, | 405 const uint8_t* payload_data, |
| 401 size_t payload_size, | 406 size_t payload_size, |
| 402 const RTPFragmentationHeader* fragmentation, | 407 const RTPFragmentationHeader* fragmentation, |
| 403 const RTPVideoHeader* rtp_video_hdr) { | 408 const RTPVideoHeader* rtp_video_hdr) { |
| 404 rtcp_sender_.SetLastRtpTime(time_stamp, capture_time_ms); | 409 rtcp_sender_.SetLastRtpTime(time_stamp, capture_time_ms); |
| 405 if (rtcp_sender_.TimeToSendRTCPReport(kVideoFrameKey == frame_type)) { | 410 if (rtcp_sender_.TimeToSendRTCPReport(kVideoFrameKey == frame_type)) { |
|
mflodman
2015/12/10 06:08:20
This will trigger the first SR, but with a correct
stefan-webrtc
2015/12/10 08:05:40
I think this should be fine. Could you add a comme
mflodman
2015/12/10 08:59:53
I added a general comment why this is done for the
| |
| 406 rtcp_sender_.SendRTCP(GetFeedbackState(), kRtcpReport); | 411 rtcp_sender_.SendRTCP(GetFeedbackState(), kRtcpReport); |
| 407 } | 412 } |
| 408 return rtp_sender_.SendOutgoingData( | 413 return rtp_sender_.SendOutgoingData( |
| 409 frame_type, payload_type, time_stamp, capture_time_ms, payload_data, | 414 frame_type, payload_type, time_stamp, capture_time_ms, payload_data, |
| 410 payload_size, fragmentation, rtp_video_hdr); | 415 payload_size, fragmentation, rtp_video_hdr); |
| 411 } | 416 } |
| 412 | 417 |
| 413 bool ModuleRtpRtcpImpl::TimeToSendPacket(uint32_t ssrc, | 418 bool ModuleRtpRtcpImpl::TimeToSendPacket(uint32_t ssrc, |
| 414 uint16_t sequence_number, | 419 uint16_t sequence_number, |
| 415 int64_t capture_time_ms, | 420 int64_t capture_time_ms, |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 985 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( | 990 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( |
| 986 StreamDataCountersCallback* callback) { | 991 StreamDataCountersCallback* callback) { |
| 987 rtp_sender_.RegisterRtpStatisticsCallback(callback); | 992 rtp_sender_.RegisterRtpStatisticsCallback(callback); |
| 988 } | 993 } |
| 989 | 994 |
| 990 StreamDataCountersCallback* | 995 StreamDataCountersCallback* |
| 991 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { | 996 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { |
| 992 return rtp_sender_.GetRtpStatisticsCallback(); | 997 return rtp_sender_.GetRtpStatisticsCallback(); |
| 993 } | 998 } |
| 994 } // namespace webrtc | 999 } // namespace webrtc |
| OLD | NEW |