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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 | 200 |
| 201 RTCPSender::~RTCPSender() {} | 201 RTCPSender::~RTCPSender() {} |
| 202 | 202 |
| 203 RtcpMode RTCPSender::Status() const { | 203 RtcpMode RTCPSender::Status() const { |
| 204 rtc::CritScope lock(&critical_section_rtcp_sender_); | 204 rtc::CritScope lock(&critical_section_rtcp_sender_); |
| 205 return method_; | 205 return method_; |
| 206 } | 206 } |
| 207 | 207 |
| 208 void RTCPSender::SetRTCPStatus(RtcpMode method) { | 208 void RTCPSender::SetRTCPStatus(RtcpMode method) { |
| 209 rtc::CritScope lock(&critical_section_rtcp_sender_); | 209 rtc::CritScope lock(&critical_section_rtcp_sender_); |
| 210 bool was_off = (method_ == RtcpMode::kOff); | |
|
pbos-webrtc
2016/03/29 17:48:46
remove ()s
skvlad
2016/03/29 18:09:25
Done.
| |
| 210 method_ = method; | 211 method_ = method; |
| 211 | 212 |
| 212 if (method == RtcpMode::kOff) | 213 if (method == RtcpMode::kOff) |
| 213 return; | 214 return; |
| 214 next_time_to_send_rtcp_ = | 215 |
| 215 clock_->TimeInMilliseconds() + | 216 if (was_off) { |
| 216 (audio_ ? RTCP_INTERVAL_AUDIO_MS / 2 : RTCP_INTERVAL_VIDEO_MS / 2); | 217 next_time_to_send_rtcp_ = |
| 218 clock_->TimeInMilliseconds() + | |
| 219 (audio_ ? RTCP_INTERVAL_AUDIO_MS / 2 : RTCP_INTERVAL_VIDEO_MS / 2); | |
| 220 } | |
|
pthatcher1
2016/03/25 23:03:40
Might be more clear as:
if (method == method_)
skvlad
2016/03/29 18:09:25
There are three possible values for RtcpMode: kOff
pthatcher
2016/03/29 18:53:09
Ah, true.
Well, how about this?
if (method == m
skvlad
2016/03/29 19:51:31
Good idea; i've replaced it with a slightly modifi
| |
| 217 } | 221 } |
| 218 | 222 |
| 219 bool RTCPSender::Sending() const { | 223 bool RTCPSender::Sending() const { |
| 220 rtc::CritScope lock(&critical_section_rtcp_sender_); | 224 rtc::CritScope lock(&critical_section_rtcp_sender_); |
| 221 return sending_; | 225 return sending_; |
| 222 } | 226 } |
| 223 | 227 |
| 224 int32_t RTCPSender::SetSendingStatus(const FeedbackState& feedback_state, | 228 int32_t RTCPSender::SetSendingStatus(const FeedbackState& feedback_state, |
| 225 bool sending) { | 229 bool sending) { |
| 226 bool sendRTCPBye = false; | 230 bool sendRTCPBye = false; |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1029 // RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Sender); | 1033 // RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Sender); |
| 1030 // but we can't because of an incorrect warning (C4822) in MVS 2013. | 1034 // but we can't because of an incorrect warning (C4822) in MVS 2013. |
| 1031 } sender(transport_, event_log_); | 1035 } sender(transport_, event_log_); |
| 1032 | 1036 |
| 1033 uint8_t buffer[IP_PACKET_SIZE]; | 1037 uint8_t buffer[IP_PACKET_SIZE]; |
| 1034 return packet.BuildExternalBuffer(buffer, IP_PACKET_SIZE, &sender) && | 1038 return packet.BuildExternalBuffer(buffer, IP_PACKET_SIZE, &sender) && |
| 1035 !sender.send_failure_; | 1039 !sender.send_failure_; |
| 1036 } | 1040 } |
| 1037 | 1041 |
| 1038 } // namespace webrtc | 1042 } // namespace webrtc |
| OLD | NEW |