Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_sender.cc

Issue 1373903003: Unify newapi::RtcpMode and RTCPMethod. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 195
196 RTCPSender::~RTCPSender() { 196 RTCPSender::~RTCPSender() {
197 } 197 }
198 198
199 int32_t RTCPSender::RegisterSendTransport(Transport* outgoingTransport) { 199 int32_t RTCPSender::RegisterSendTransport(Transport* outgoingTransport) {
200 CriticalSectionScoped lock(critical_section_transport_.get()); 200 CriticalSectionScoped lock(critical_section_transport_.get());
201 cbTransport_ = outgoingTransport; 201 cbTransport_ = outgoingTransport;
202 return 0; 202 return 0;
203 } 203 }
204 204
205 RTCPMethod RTCPSender::Status() const { 205 RtcpMode RTCPSender::Status() const {
206 CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); 206 CriticalSectionScoped lock(critical_section_rtcp_sender_.get());
207 return method_; 207 return method_;
208 } 208 }
209 209
210 void RTCPSender::SetRTCPStatus(RTCPMethod method) { 210 void RTCPSender::SetRTCPStatus(RtcpMode method) {
211 CriticalSectionScoped lock(critical_section_rtcp_sender_.get()); 211 CriticalSectionScoped lock(critical_section_rtcp_sender_.get());
212 method_ = method; 212 method_ = method;
213 213
214 if (method == kRtcpOff) 214 if (method == kRtcpOff)
215 return; 215 return;
216 next_time_to_send_rtcp_ = 216 next_time_to_send_rtcp_ =
217 clock_->TimeInMilliseconds() + 217 clock_->TimeInMilliseconds() +
218 (audio_ ? RTCP_INTERVAL_AUDIO_MS / 2 : RTCP_INTERVAL_VIDEO_MS / 2); 218 (audio_ ? RTCP_INTERVAL_AUDIO_MS / 2 : RTCP_INTERVAL_VIDEO_MS / 2);
219 } 219 }
220 220
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 if (packet_type_counter_.first_packet_time_ms == -1) 976 if (packet_type_counter_.first_packet_time_ms == -1)
977 packet_type_counter_.first_packet_time_ms = clock_->TimeInMilliseconds(); 977 packet_type_counter_.first_packet_time_ms = clock_->TimeInMilliseconds();
978 978
979 bool generate_report; 979 bool generate_report;
980 if (IsFlagPresent(kRtcpSr) || IsFlagPresent(kRtcpRr)) { 980 if (IsFlagPresent(kRtcpSr) || IsFlagPresent(kRtcpRr)) {
981 // Report type already explicitly set, don't automatically populate. 981 // Report type already explicitly set, don't automatically populate.
982 generate_report = true; 982 generate_report = true;
983 RTC_DCHECK(ConsumeFlag(kRtcpReport) == false); 983 RTC_DCHECK(ConsumeFlag(kRtcpReport) == false);
984 } else { 984 } else {
985 generate_report = 985 generate_report =
986 (ConsumeFlag(kRtcpReport) && method_ == kRtcpNonCompound) || 986 (ConsumeFlag(kRtcpReport) && method_ == kRtcpReducedSize) ||
987 method_ == kRtcpCompound; 987 method_ == kRtcpCompound;
988 if (generate_report) 988 if (generate_report)
989 SetFlag(sending_ ? kRtcpSr : kRtcpRr, true); 989 SetFlag(sending_ ? kRtcpSr : kRtcpRr, true);
990 } 990 }
991 991
992 if (IsFlagPresent(kRtcpSr) || (IsFlagPresent(kRtcpRr) && !cname_.empty())) 992 if (IsFlagPresent(kRtcpSr) || (IsFlagPresent(kRtcpRr) && !cname_.empty()))
993 SetFlag(kRtcpSdes, true); 993 SetFlag(kRtcpSdes, true);
994 994
995 // We need to send our NTP even if we haven't received any reports. 995 // We need to send our NTP even if we haven't received any reports.
996 clock_->CurrentNtp(context.ntp_sec, context.ntp_frac); 996 clock_->CurrentNtp(context.ntp_sec, context.ntp_frac);
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 Transport* const transport_; 1227 Transport* const transport_;
1228 bool send_failure_; 1228 bool send_failure_;
1229 } sender(cbTransport_); 1229 } sender(cbTransport_);
1230 1230
1231 uint8_t buffer[IP_PACKET_SIZE]; 1231 uint8_t buffer[IP_PACKET_SIZE];
1232 return packet.BuildExternalBuffer(buffer, IP_PACKET_SIZE, &sender) && 1232 return packet.BuildExternalBuffer(buffer, IP_PACKET_SIZE, &sender) &&
1233 !sender.send_failure_; 1233 !sender.send_failure_;
1234 } 1234 }
1235 1235
1236 } // namespace webrtc 1236 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698