| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 if (!sync_group.empty()) { | 56 if (!sync_group.empty()) { |
| 57 ss << ", sync_group: " << sync_group; | 57 ss << ", sync_group: " << sync_group; |
| 58 } | 58 } |
| 59 ss << '}'; | 59 ss << '}'; |
| 60 return ss.str(); | 60 return ss.str(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 namespace internal { | 63 namespace internal { |
| 64 AudioReceiveStream::AudioReceiveStream( | 64 AudioReceiveStream::AudioReceiveStream( |
| 65 PacketRouter* packet_router, | 65 PacketRouter* packet_router, |
| 66 RemoteBitrateEstimator* remote_bitrate_estimator, | |
| 67 const webrtc::AudioReceiveStream::Config& config, | 66 const webrtc::AudioReceiveStream::Config& config, |
| 68 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, | 67 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, |
| 69 webrtc::RtcEventLog* event_log) | 68 webrtc::RtcEventLog* event_log) |
| 70 : remote_bitrate_estimator_(remote_bitrate_estimator), | 69 : config_(config), |
| 71 config_(config), | |
| 72 audio_state_(audio_state) { | 70 audio_state_(audio_state) { |
| 73 LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString(); | 71 LOG(LS_INFO) << "AudioReceiveStream: " << config_.ToString(); |
| 74 RTC_DCHECK_NE(config_.voe_channel_id, -1); | 72 RTC_DCHECK_NE(config_.voe_channel_id, -1); |
| 75 RTC_DCHECK(audio_state_.get()); | 73 RTC_DCHECK(audio_state_.get()); |
| 76 RTC_DCHECK(packet_router); | 74 RTC_DCHECK(packet_router); |
| 77 RTC_DCHECK(remote_bitrate_estimator); | |
| 78 | 75 |
| 79 module_process_thread_checker_.DetachFromThread(); | 76 module_process_thread_checker_.DetachFromThread(); |
| 80 | 77 |
| 81 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); | 78 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); |
| 82 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); | 79 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); |
| 83 channel_proxy_->SetRtcEventLog(event_log); | 80 channel_proxy_->SetRtcEventLog(event_log); |
| 84 channel_proxy_->SetLocalSSRC(config.rtp.local_ssrc); | 81 channel_proxy_->SetLocalSSRC(config.rtp.local_ssrc); |
| 85 // TODO(solenberg): Config NACK history window (which is a packet count), | 82 // TODO(solenberg): Config NACK history window (which is a packet count), |
| 86 // using the actual packet size for the configured codec. | 83 // using the actual packet size for the configured codec. |
| 87 channel_proxy_->SetNACKStatus(config_.rtp.nack.rtp_history_ms != 0, | 84 channel_proxy_->SetNACKStatus(config_.rtp.nack.rtp_history_ms != 0, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 118 AudioReceiveStream::~AudioReceiveStream() { | 115 AudioReceiveStream::~AudioReceiveStream() { |
| 119 RTC_DCHECK_RUN_ON(&worker_thread_checker_); | 116 RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 120 LOG(LS_INFO) << "~AudioReceiveStream: " << config_.ToString(); | 117 LOG(LS_INFO) << "~AudioReceiveStream: " << config_.ToString(); |
| 121 if (playing_) { | 118 if (playing_) { |
| 122 Stop(); | 119 Stop(); |
| 123 } | 120 } |
| 124 channel_proxy_->DisassociateSendChannel(); | 121 channel_proxy_->DisassociateSendChannel(); |
| 125 channel_proxy_->DeRegisterExternalTransport(); | 122 channel_proxy_->DeRegisterExternalTransport(); |
| 126 channel_proxy_->ResetCongestionControlObjects(); | 123 channel_proxy_->ResetCongestionControlObjects(); |
| 127 channel_proxy_->SetRtcEventLog(nullptr); | 124 channel_proxy_->SetRtcEventLog(nullptr); |
| 128 remote_bitrate_estimator_->RemoveStream(config_.rtp.remote_ssrc); | |
| 129 } | 125 } |
| 130 | 126 |
| 131 void AudioReceiveStream::Start() { | 127 void AudioReceiveStream::Start() { |
| 132 RTC_DCHECK_RUN_ON(&worker_thread_checker_); | 128 RTC_DCHECK_RUN_ON(&worker_thread_checker_); |
| 133 if (playing_) { | 129 if (playing_) { |
| 134 return; | 130 return; |
| 135 } | 131 } |
| 136 | 132 |
| 137 int error = SetVoiceEnginePlayout(true); | 133 int error = SetVoiceEnginePlayout(true); |
| 138 if (error != 0) { | 134 if (error != 0) { |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 int AudioReceiveStream::SetVoiceEnginePlayout(bool playout) { | 332 int AudioReceiveStream::SetVoiceEnginePlayout(bool playout) { |
| 337 ScopedVoEInterface<VoEBase> base(voice_engine()); | 333 ScopedVoEInterface<VoEBase> base(voice_engine()); |
| 338 if (playout) { | 334 if (playout) { |
| 339 return base->StartPlayout(config_.voe_channel_id); | 335 return base->StartPlayout(config_.voe_channel_id); |
| 340 } else { | 336 } else { |
| 341 return base->StopPlayout(config_.voe_channel_id); | 337 return base->StopPlayout(config_.voe_channel_id); |
| 342 } | 338 } |
| 343 } | 339 } |
| 344 } // namespace internal | 340 } // namespace internal |
| 345 } // namespace webrtc | 341 } // namespace webrtc |
| OLD | NEW |