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

Side by Side Diff: webrtc/audio/audio_send_stream.cc

Issue 2530383002: Reland "Update rtt on audio only calls". (Closed)
Patch Set: Fix for memory access error in ModuleRtpRtcpImpl::Process. Created 4 years 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 29 matching lines...) Expand all
40 } 40 }
41 } // namespace 41 } // namespace
42 42
43 namespace internal { 43 namespace internal {
44 AudioSendStream::AudioSendStream( 44 AudioSendStream::AudioSendStream(
45 const webrtc::AudioSendStream::Config& config, 45 const webrtc::AudioSendStream::Config& config,
46 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, 46 const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
47 rtc::TaskQueue* worker_queue, 47 rtc::TaskQueue* worker_queue,
48 CongestionController* congestion_controller, 48 CongestionController* congestion_controller,
49 BitrateAllocator* bitrate_allocator, 49 BitrateAllocator* bitrate_allocator,
50 RtcEventLog* event_log) 50 RtcEventLog* event_log,
51 RtcpRttStats* rtcp_rtt_stats)
51 : worker_queue_(worker_queue), 52 : worker_queue_(worker_queue),
52 config_(config), 53 config_(config),
53 audio_state_(audio_state), 54 audio_state_(audio_state),
54 bitrate_allocator_(bitrate_allocator) { 55 bitrate_allocator_(bitrate_allocator) {
55 LOG(LS_INFO) << "AudioSendStream: " << config_.ToString(); 56 LOG(LS_INFO) << "AudioSendStream: " << config_.ToString();
56 RTC_DCHECK_NE(config_.voe_channel_id, -1); 57 RTC_DCHECK_NE(config_.voe_channel_id, -1);
57 RTC_DCHECK(audio_state_.get()); 58 RTC_DCHECK(audio_state_.get());
58 RTC_DCHECK(congestion_controller); 59 RTC_DCHECK(congestion_controller);
59 60
60 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); 61 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine());
61 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); 62 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id);
62 channel_proxy_->SetRtcEventLog(event_log); 63 channel_proxy_->SetRtcEventLog(event_log);
64 channel_proxy_->SetRtcpRttStats(rtcp_rtt_stats);
63 channel_proxy_->RegisterSenderCongestionControlObjects( 65 channel_proxy_->RegisterSenderCongestionControlObjects(
64 congestion_controller->pacer(), 66 congestion_controller->pacer(),
65 congestion_controller->GetTransportFeedbackObserver(), 67 congestion_controller->GetTransportFeedbackObserver(),
66 congestion_controller->packet_router()); 68 congestion_controller->packet_router());
67 channel_proxy_->SetRTCPStatus(true); 69 channel_proxy_->SetRTCPStatus(true);
68 channel_proxy_->SetLocalSSRC(config.rtp.ssrc); 70 channel_proxy_->SetLocalSSRC(config.rtp.ssrc);
69 channel_proxy_->SetRTCP_CNAME(config.rtp.c_name); 71 channel_proxy_->SetRTCP_CNAME(config.rtp.c_name);
70 // TODO(solenberg): Config NACK history window (which is a packet count), 72 // TODO(solenberg): Config NACK history window (which is a packet count),
71 // using the actual packet size for the configured codec. 73 // using the actual packet size for the configured codec.
72 channel_proxy_->SetNACKStatus(config_.rtp.nack.rtp_history_ms != 0, 74 channel_proxy_->SetNACKStatus(config_.rtp.nack.rtp_history_ms != 0,
(...skipping 14 matching lines...) Expand all
87 LOG(LS_ERROR) << "Failed to set up send codec state."; 89 LOG(LS_ERROR) << "Failed to set up send codec state.";
88 } 90 }
89 } 91 }
90 92
91 AudioSendStream::~AudioSendStream() { 93 AudioSendStream::~AudioSendStream() {
92 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 94 RTC_DCHECK(thread_checker_.CalledOnValidThread());
93 LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString(); 95 LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString();
94 channel_proxy_->DeRegisterExternalTransport(); 96 channel_proxy_->DeRegisterExternalTransport();
95 channel_proxy_->ResetCongestionControlObjects(); 97 channel_proxy_->ResetCongestionControlObjects();
96 channel_proxy_->SetRtcEventLog(nullptr); 98 channel_proxy_->SetRtcEventLog(nullptr);
99 channel_proxy_->SetRtcpRttStats(nullptr);
97 } 100 }
98 101
99 void AudioSendStream::Start() { 102 void AudioSendStream::Start() {
100 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 103 RTC_DCHECK(thread_checker_.CalledOnValidThread());
101 if (config_.min_bitrate_bps != -1 && config_.max_bitrate_bps != -1) { 104 if (config_.min_bitrate_bps != -1 && config_.max_bitrate_bps != -1) {
102 RTC_DCHECK_GE(config_.max_bitrate_bps, config_.min_bitrate_bps); 105 RTC_DCHECK_GE(config_.max_bitrate_bps, config_.min_bitrate_bps);
103 rtc::Event thread_sync_event(false /* manual_reset */, false); 106 rtc::Event thread_sync_event(false /* manual_reset */, false);
104 worker_queue_->PostTask([this, &thread_sync_event] { 107 worker_queue_->PostTask([this, &thread_sync_event] {
105 bitrate_allocator_->AddObserver(this, config_.min_bitrate_bps, 108 bitrate_allocator_->AddObserver(this, config_.min_bitrate_bps,
106 config_.max_bitrate_bps, 0, true); 109 config_.max_bitrate_bps, 0, true);
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 LOG(LS_WARNING) << "SetVADStatus() failed: " << base->LastError(); 380 LOG(LS_WARNING) << "SetVADStatus() failed: " << base->LastError();
378 return false; 381 return false;
379 } 382 }
380 } 383 }
381 } 384 }
382 return true; 385 return true;
383 } 386 }
384 387
385 } // namespace internal 388 } // namespace internal
386 } // namespace webrtc 389 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698