| 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 30 matching lines...) Expand all Loading... |
| 41 } // namespace | 41 } // namespace |
| 42 | 42 |
| 43 namespace internal { | 43 namespace internal { |
| 44 AudioSendStream::AudioSendStream( | 44 AudioSendStream::AudioSendStream( |
| 45 const webrtc::AudioSendStream::Config& config, | 45 const webrtc::AudioSendStream::Config& config, |
| 46 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, | 46 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, |
| 47 rtc::TaskQueue* worker_queue, | 47 rtc::TaskQueue* worker_queue, |
| 48 PacketRouter* packet_router, | 48 PacketRouter* packet_router, |
| 49 CongestionController* congestion_controller, | 49 CongestionController* congestion_controller, |
| 50 BitrateAllocator* bitrate_allocator, | 50 BitrateAllocator* bitrate_allocator, |
| 51 RtcEventLog* event_log) | 51 RtcEventLog* event_log, |
| 52 RtcpRttStats* rtcp_rtt_stats) |
| 52 : worker_queue_(worker_queue), | 53 : worker_queue_(worker_queue), |
| 53 config_(config), | 54 config_(config), |
| 54 audio_state_(audio_state), | 55 audio_state_(audio_state), |
| 55 bitrate_allocator_(bitrate_allocator) { | 56 bitrate_allocator_(bitrate_allocator) { |
| 56 LOG(LS_INFO) << "AudioSendStream: " << config_.ToString(); | 57 LOG(LS_INFO) << "AudioSendStream: " << config_.ToString(); |
| 57 RTC_DCHECK_NE(config_.voe_channel_id, -1); | 58 RTC_DCHECK_NE(config_.voe_channel_id, -1); |
| 58 RTC_DCHECK(audio_state_.get()); | 59 RTC_DCHECK(audio_state_.get()); |
| 59 RTC_DCHECK(congestion_controller); | 60 RTC_DCHECK(congestion_controller); |
| 60 | 61 |
| 61 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); | 62 VoiceEngineImpl* voe_impl = static_cast<VoiceEngineImpl*>(voice_engine()); |
| 62 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); | 63 channel_proxy_ = voe_impl->GetChannelProxy(config_.voe_channel_id); |
| 63 channel_proxy_->SetRtcEventLog(event_log); | 64 channel_proxy_->SetRtcEventLog(event_log); |
| 65 channel_proxy_->SetRtcpRttStats(rtcp_rtt_stats); |
| 64 channel_proxy_->RegisterSenderCongestionControlObjects( | 66 channel_proxy_->RegisterSenderCongestionControlObjects( |
| 65 congestion_controller->pacer(), | 67 congestion_controller->pacer(), |
| 66 congestion_controller->GetTransportFeedbackObserver(), packet_router); | 68 congestion_controller->GetTransportFeedbackObserver(), packet_router); |
| 67 channel_proxy_->SetRTCPStatus(true); | 69 channel_proxy_->SetRTCPStatus(true); |
| 68 channel_proxy_->SetLocalSSRC(config.rtp.ssrc); | 70 channel_proxy_->SetLocalSSRC(config.rtp.ssrc); |
| 69 channel_proxy_->SetRTCP_CNAME(config.rtp.c_name); | 71 channel_proxy_->SetRTCP_CNAME(config.rtp.c_name); |
| 70 // TODO(solenberg): Config NACK history window (which is a packet count), | 72 // TODO(solenberg): Config NACK history window (which is a packet count), |
| 71 // using the actual packet size for the configured codec. | 73 // using the actual packet size for the configured codec. |
| 72 channel_proxy_->SetNACKStatus(config_.rtp.nack.rtp_history_ms != 0, | 74 channel_proxy_->SetNACKStatus(config_.rtp.nack.rtp_history_ms != 0, |
| 73 config_.rtp.nack.rtp_history_ms / 20); | 75 config_.rtp.nack.rtp_history_ms / 20); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 87 LOG(LS_ERROR) << "Failed to set up send codec state."; | 89 LOG(LS_ERROR) << "Failed to set up send codec state."; |
| 88 } | 90 } |
| 89 } | 91 } |
| 90 | 92 |
| 91 AudioSendStream::~AudioSendStream() { | 93 AudioSendStream::~AudioSendStream() { |
| 92 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 94 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 93 LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString(); | 95 LOG(LS_INFO) << "~AudioSendStream: " << config_.ToString(); |
| 94 channel_proxy_->DeRegisterExternalTransport(); | 96 channel_proxy_->DeRegisterExternalTransport(); |
| 95 channel_proxy_->ResetCongestionControlObjects(); | 97 channel_proxy_->ResetCongestionControlObjects(); |
| 96 channel_proxy_->SetRtcEventLog(nullptr); | 98 channel_proxy_->SetRtcEventLog(nullptr); |
| 99 channel_proxy_->SetRtcpRttStats(nullptr); |
| 97 } | 100 } |
| 98 | 101 |
| 99 void AudioSendStream::Start() { | 102 void AudioSendStream::Start() { |
| 100 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 103 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| 101 if (config_.min_bitrate_bps != -1 && config_.max_bitrate_bps != -1) { | 104 if (config_.min_bitrate_bps != -1 && config_.max_bitrate_bps != -1) { |
| 102 RTC_DCHECK_GE(config_.max_bitrate_bps, config_.min_bitrate_bps); | 105 RTC_DCHECK_GE(config_.max_bitrate_bps, config_.min_bitrate_bps); |
| 103 rtc::Event thread_sync_event(false /* manual_reset */, false); | 106 rtc::Event thread_sync_event(false /* manual_reset */, false); |
| 104 worker_queue_->PostTask([this, &thread_sync_event] { | 107 worker_queue_->PostTask([this, &thread_sync_event] { |
| 105 bitrate_allocator_->AddObserver(this, config_.min_bitrate_bps, | 108 bitrate_allocator_->AddObserver(this, config_.min_bitrate_bps, |
| 106 config_.max_bitrate_bps, 0, true); | 109 config_.max_bitrate_bps, 0, true); |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 LOG(LS_WARNING) << "SetVADStatus() failed: " << base->LastError(); | 381 LOG(LS_WARNING) << "SetVADStatus() failed: " << base->LastError(); |
| 379 return false; | 382 return false; |
| 380 } | 383 } |
| 381 } | 384 } |
| 382 } | 385 } |
| 383 return true; | 386 return true; |
| 384 } | 387 } |
| 385 | 388 |
| 386 } // namespace internal | 389 } // namespace internal |
| 387 } // namespace webrtc | 390 } // namespace webrtc |
| OLD | NEW |