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

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

Issue 2740163002: Don't allocate any RTPSender object for a receive only RtpRtcp module (Closed)
Patch Set: Tolerate SetSendingMediaStatus(false) on receive-only streams. Created 3 years, 9 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 rtc::CritScope lock(&critical_section_rtcp_sender_); 289 rtc::CritScope lock(&critical_section_rtcp_sender_);
290 last_rtp_timestamp_ = rtp_timestamp; 290 last_rtp_timestamp_ = rtp_timestamp;
291 if (capture_time_ms < 0) { 291 if (capture_time_ms < 0) {
292 // We don't currently get a capture time from VoiceEngine. 292 // We don't currently get a capture time from VoiceEngine.
293 last_frame_capture_time_ms_ = clock_->TimeInMilliseconds(); 293 last_frame_capture_time_ms_ = clock_->TimeInMilliseconds();
294 } else { 294 } else {
295 last_frame_capture_time_ms_ = capture_time_ms; 295 last_frame_capture_time_ms_ = capture_time_ms;
296 } 296 }
297 } 297 }
298 298
299 uint32_t RTCPSender::SSRC() const {
300 rtc::CritScope lock(&critical_section_rtcp_sender_);
301 return ssrc_;
302 }
303
299 void RTCPSender::SetSSRC(uint32_t ssrc) { 304 void RTCPSender::SetSSRC(uint32_t ssrc) {
300 rtc::CritScope lock(&critical_section_rtcp_sender_); 305 rtc::CritScope lock(&critical_section_rtcp_sender_);
301 306
302 if (ssrc_ != 0) { 307 if (ssrc_ != 0) {
303 // not first SetSSRC, probably due to a collision 308 // not first SetSSRC, probably due to a collision
304 // schedule a new RTCP report 309 // schedule a new RTCP report
305 // make sure that we send a RTP packet 310 // make sure that we send a RTP packet
306 next_time_to_send_rtcp_ = clock_->TimeInMilliseconds() + 100; 311 next_time_to_send_rtcp_ = clock_->TimeInMilliseconds() + 100;
307 } 312 }
308 ssrc_ = ssrc; 313 ssrc_ = ssrc;
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 max_packet_size = max_packet_size_; 1005 max_packet_size = max_packet_size_;
1001 } 1006 }
1002 1007
1003 RTC_DCHECK_LE(max_packet_size, IP_PACKET_SIZE); 1008 RTC_DCHECK_LE(max_packet_size, IP_PACKET_SIZE);
1004 uint8_t buffer[IP_PACKET_SIZE]; 1009 uint8_t buffer[IP_PACKET_SIZE];
1005 return packet.BuildExternalBuffer(buffer, max_packet_size, &sender) && 1010 return packet.BuildExternalBuffer(buffer, max_packet_size, &sender) &&
1006 !sender.send_failure_; 1011 !sender.send_failure_;
1007 } 1012 }
1008 1013
1009 } // namespace webrtc 1014 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698