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

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

Issue 1741933002: Prevent a voice channel from sending data before a renderer is set. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Modifying copyright header to satisfy presubmit bot. Created 4 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
« no previous file with comments | « webrtc/api/webrtcsession_unittest.cc ('k') | webrtc/media/base/audiorenderer.h » ('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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 AudioSendStream::~AudioSendStream() { 92 AudioSendStream::~AudioSendStream() {
93 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 93 RTC_DCHECK(thread_checker_.CalledOnValidThread());
94 LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString(); 94 LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString();
95 channel_proxy_->ResetCongestionControlObjects(); 95 channel_proxy_->ResetCongestionControlObjects();
96 } 96 }
97 97
98 void AudioSendStream::Start() { 98 void AudioSendStream::Start() {
99 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 99 RTC_DCHECK(thread_checker_.CalledOnValidThread());
100 ScopedVoEInterface<VoEBase> base(voice_engine());
101 int error = base->StartSend(config_.voe_channel_id);
102 if (error != 0) {
103 LOG(LS_ERROR) << "AudioSendStream::Start failed with error: " << error;
104 }
100 } 105 }
101 106
102 void AudioSendStream::Stop() { 107 void AudioSendStream::Stop() {
103 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 108 RTC_DCHECK(thread_checker_.CalledOnValidThread());
109 ScopedVoEInterface<VoEBase> base(voice_engine());
110 int error = base->StopSend(config_.voe_channel_id);
111 if (error != 0) {
112 LOG(LS_ERROR) << "AudioSendStream::Stop failed with error: " << error;
113 }
104 } 114 }
105 115
106 void AudioSendStream::SignalNetworkState(NetworkState state) { 116 void AudioSendStream::SignalNetworkState(NetworkState state) {
107 RTC_DCHECK(thread_checker_.CalledOnValidThread()); 117 RTC_DCHECK(thread_checker_.CalledOnValidThread());
108 } 118 }
109 119
110 bool AudioSendStream::DeliverRtcp(const uint8_t* packet, size_t length) { 120 bool AudioSendStream::DeliverRtcp(const uint8_t* packet, size_t length) {
111 // TODO(solenberg): Tests call this function on a network thread, libjingle 121 // TODO(solenberg): Tests call this function on a network thread, libjingle
112 // calls on the worker thread. We should move towards always using a network 122 // calls on the worker thread. We should move towards always using a network
113 // thread. Then this check can be enabled. 123 // thread. Then this check can be enabled.
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 222
213 VoiceEngine* AudioSendStream::voice_engine() const { 223 VoiceEngine* AudioSendStream::voice_engine() const {
214 internal::AudioState* audio_state = 224 internal::AudioState* audio_state =
215 static_cast<internal::AudioState*>(audio_state_.get()); 225 static_cast<internal::AudioState*>(audio_state_.get());
216 VoiceEngine* voice_engine = audio_state->voice_engine(); 226 VoiceEngine* voice_engine = audio_state->voice_engine();
217 RTC_DCHECK(voice_engine); 227 RTC_DCHECK(voice_engine);
218 return voice_engine; 228 return voice_engine;
219 } 229 }
220 } // namespace internal 230 } // namespace internal
221 } // namespace webrtc 231 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/webrtcsession_unittest.cc ('k') | webrtc/media/base/audiorenderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698