OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |