| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 } | 295 } |
| 296 | 296 |
| 297 bool AudioReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) { | 297 bool AudioReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) { |
| 298 // TODO(solenberg): Tests call this function on a network thread, libjingle | 298 // TODO(solenberg): Tests call this function on a network thread, libjingle |
| 299 // calls on the worker thread. We should move towards always using a network | 299 // calls on the worker thread. We should move towards always using a network |
| 300 // thread. Then this check can be enabled. | 300 // thread. Then this check can be enabled. |
| 301 // RTC_DCHECK(!thread_checker_.CalledOnValidThread()); | 301 // RTC_DCHECK(!thread_checker_.CalledOnValidThread()); |
| 302 return channel_proxy_->ReceivedRTCPPacket(packet, length); | 302 return channel_proxy_->ReceivedRTCPPacket(packet, length); |
| 303 } | 303 } |
| 304 | 304 |
| 305 bool AudioReceiveStream::DeliverRtp(const uint8_t* packet, | 305 void AudioReceiveStream::OnRtpPacket(const RtpPacketReceived& packet) { |
| 306 size_t length, | |
| 307 const PacketTime& packet_time) { | |
| 308 // TODO(solenberg): Tests call this function on a network thread, libjingle | 306 // TODO(solenberg): Tests call this function on a network thread, libjingle |
| 309 // calls on the worker thread. We should move towards always using a network | 307 // calls on the worker thread. We should move towards always using a network |
| 310 // thread. Then this check can be enabled. | 308 // thread. Then this check can be enabled. |
| 311 // RTC_DCHECK(!thread_checker_.CalledOnValidThread()); | 309 // RTC_DCHECK(!thread_checker_.CalledOnValidThread()); |
| 312 return channel_proxy_->ReceivedRTPPacket(packet, length, packet_time); | 310 channel_proxy_->OnRtpPacket(packet); |
| 313 } | 311 } |
| 314 | 312 |
| 315 const webrtc::AudioReceiveStream::Config& AudioReceiveStream::config() const { | 313 const webrtc::AudioReceiveStream::Config& AudioReceiveStream::config() const { |
| 316 RTC_DCHECK_RUN_ON(&worker_thread_checker_); | 314 RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 317 return config_; | 315 return config_; |
| 318 } | 316 } |
| 319 | 317 |
| 320 VoiceEngine* AudioReceiveStream::voice_engine() const { | 318 VoiceEngine* AudioReceiveStream::voice_engine() const { |
| 321 auto* voice_engine = audio_state()->voice_engine(); | 319 auto* voice_engine = audio_state()->voice_engine(); |
| 322 RTC_DCHECK(voice_engine); | 320 RTC_DCHECK(voice_engine); |
| 323 return voice_engine; | 321 return voice_engine; |
| 324 } | 322 } |
| 325 | 323 |
| 326 internal::AudioState* AudioReceiveStream::audio_state() const { | 324 internal::AudioState* AudioReceiveStream::audio_state() const { |
| 327 auto* audio_state = static_cast<internal::AudioState*>(audio_state_.get()); | 325 auto* audio_state = static_cast<internal::AudioState*>(audio_state_.get()); |
| 328 RTC_DCHECK(audio_state); | 326 RTC_DCHECK(audio_state); |
| 329 return audio_state; | 327 return audio_state; |
| 330 } | 328 } |
| 331 | 329 |
| 332 int AudioReceiveStream::SetVoiceEnginePlayout(bool playout) { | 330 int AudioReceiveStream::SetVoiceEnginePlayout(bool playout) { |
| 333 ScopedVoEInterface<VoEBase> base(voice_engine()); | 331 ScopedVoEInterface<VoEBase> base(voice_engine()); |
| 334 if (playout) { | 332 if (playout) { |
| 335 return base->StartPlayout(config_.voe_channel_id); | 333 return base->StartPlayout(config_.voe_channel_id); |
| 336 } else { | 334 } else { |
| 337 return base->StopPlayout(config_.voe_channel_id); | 335 return base->StopPlayout(config_.voe_channel_id); |
| 338 } | 336 } |
| 339 } | 337 } |
| 340 } // namespace internal | 338 } // namespace internal |
| 341 } // namespace webrtc | 339 } // namespace webrtc |
| OLD | NEW |