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

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

Issue 2226823003: Set the event log in Channel from AudioSendStream (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 4 years, 4 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
« no previous file with comments | « webrtc/audio/audio_send_stream.h ('k') | webrtc/audio/audio_send_stream_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 ss << ", cng_payload_type: " << cng_payload_type; 53 ss << ", cng_payload_type: " << cng_payload_type;
54 ss << '}'; 54 ss << '}';
55 return ss.str(); 55 return ss.str();
56 } 56 }
57 57
58 namespace internal { 58 namespace internal {
59 AudioSendStream::AudioSendStream( 59 AudioSendStream::AudioSendStream(
60 const webrtc::AudioSendStream::Config& config, 60 const webrtc::AudioSendStream::Config& config,
61 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, 61 const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
62 CongestionController* congestion_controller, 62 CongestionController* congestion_controller,
63 BitrateAllocator* bitrate_allocator) 63 BitrateAllocator* bitrate_allocator,
64 RtcEventLog* event_log)
64 : config_(config), 65 : config_(config),
65 audio_state_(audio_state), 66 audio_state_(audio_state),
66 bitrate_allocator_(bitrate_allocator) { 67 bitrate_allocator_(bitrate_allocator) {
67 LOG(LS_INFO) << "AudioSendStream: " << config_.ToString(); 68 LOG(LS_INFO) << "AudioSendStream: " << config_.ToString();
68 RTC_DCHECK_NE(config_.voe_channel_id, -1); 69 RTC_DCHECK_NE(config_.voe_channel_id, -1);
69 RTC_DCHECK(audio_state_.get()); 70 RTC_DCHECK(audio_state_.get());
70 RTC_DCHECK(congestion_controller); 71 RTC_DCHECK(congestion_controller);
71 72
72 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); 73 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine());
73 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); 74 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id);
75 channel_proxy_->SetRtcEventLog(event_log);
74 channel_proxy_->RegisterSenderCongestionControlObjects( 76 channel_proxy_->RegisterSenderCongestionControlObjects(
75 congestion_controller->pacer(), 77 congestion_controller->pacer(),
76 congestion_controller->GetTransportFeedbackObserver(), 78 congestion_controller->GetTransportFeedbackObserver(),
77 congestion_controller->packet_router()); 79 congestion_controller->packet_router());
78 channel_proxy_->SetRTCPStatus(true); 80 channel_proxy_->SetRTCPStatus(true);
79 channel_proxy_->SetLocalSSRC(config.rtp.ssrc); 81 channel_proxy_->SetLocalSSRC(config.rtp.ssrc);
80 channel_proxy_->SetRTCP_CNAME(config.rtp.c_name); 82 channel_proxy_->SetRTCP_CNAME(config.rtp.c_name);
81 // TODO(solenberg): Config NACK history window (which is a packet count), 83 // TODO(solenberg): Config NACK history window (which is a packet count),
82 // using the actual packet size for the configured codec. 84 // using the actual packet size for the configured codec.
83 channel_proxy_->SetNACKStatus(config_.rtp.nack.rtp_history_ms != 0, 85 channel_proxy_->SetNACKStatus(config_.rtp.nack.rtp_history_ms != 0,
(...skipping 10 matching lines...) Expand all
94 channel_proxy_->EnableSendTransportSequenceNumber(extension.id); 96 channel_proxy_->EnableSendTransportSequenceNumber(extension.id);
95 } else { 97 } else {
96 RTC_NOTREACHED() << "Registering unsupported RTP extension."; 98 RTC_NOTREACHED() << "Registering unsupported RTP extension.";
97 } 99 }
98 } 100 }
99 } 101 }
100 102
101 AudioSendStream::~AudioSendStream() { 103 AudioSendStream::~AudioSendStream() {
102 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 104 RTC_DCHECK(thread_checker_.CalledOnValidThread());
103 LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString(); 105 LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString();
106 channel_proxy_->SetRtcEventLog(nullptr);
the sun 2016/08/23 10:15:29 super nit: registering methods are called in oppos
104 channel_proxy_->DeRegisterExternalTransport(); 107 channel_proxy_->DeRegisterExternalTransport();
105 channel_proxy_->ResetCongestionControlObjects(); 108 channel_proxy_->ResetCongestionControlObjects();
106 } 109 }
107 110
108 void AudioSendStream::Start() { 111 void AudioSendStream::Start() {
109 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 112 RTC_DCHECK(thread_checker_.CalledOnValidThread());
110 if (config_.min_bitrate_kbps != -1 && config_.max_bitrate_kbps != -1) { 113 if (config_.min_bitrate_kbps != -1 && config_.max_bitrate_kbps != -1) {
111 RTC_DCHECK_GE(config_.max_bitrate_kbps, config_.min_bitrate_kbps); 114 RTC_DCHECK_GE(config_.max_bitrate_kbps, config_.min_bitrate_kbps);
112 bitrate_allocator_->AddObserver(this, config_.min_bitrate_kbps * 1000, 115 bitrate_allocator_->AddObserver(this, config_.min_bitrate_kbps * 1000,
113 config_.max_bitrate_kbps * 1000, 0, true); 116 config_.max_bitrate_kbps * 1000, 0, true);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 265
263 VoiceEngine* AudioSendStream::voice_engine() const { 266 VoiceEngine* AudioSendStream::voice_engine() const {
264 internal::AudioState* audio_state = 267 internal::AudioState* audio_state =
265 static_cast<internal::AudioState*>(audio_state_.get()); 268 static_cast<internal::AudioState*>(audio_state_.get());
266 VoiceEngine* voice_engine = audio_state->voice_engine(); 269 VoiceEngine* voice_engine = audio_state->voice_engine();
267 RTC_DCHECK(voice_engine); 270 RTC_DCHECK(voice_engine);
268 return voice_engine; 271 return voice_engine;
269 } 272 }
270 } // namespace internal 273 } // namespace internal
271 } // namespace webrtc 274 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/audio/audio_send_stream.h ('k') | webrtc/audio/audio_send_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698