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

Side by Side Diff: webrtc/voice_engine/channel.cc

Issue 1991233004: Moved creation of AudioDecoderFactory to inside PeerConnectionFactory. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@audio-decoder-factory-injections-3
Patch Set: Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 _RxVadDetection(false), 807 _RxVadDetection(false),
808 _rxAgcIsEnabled(false), 808 _rxAgcIsEnabled(false),
809 _rxNsIsEnabled(false), 809 _rxNsIsEnabled(false),
810 restored_packet_in_use_(false), 810 restored_packet_in_use_(false),
811 rtcp_observer_(new VoERtcpObserver(this)), 811 rtcp_observer_(new VoERtcpObserver(this)),
812 network_predictor_(new NetworkPredictor(Clock::GetRealTimeClock())), 812 network_predictor_(new NetworkPredictor(Clock::GetRealTimeClock())),
813 associate_send_channel_(ChannelOwner(nullptr)), 813 associate_send_channel_(ChannelOwner(nullptr)),
814 pacing_enabled_(config.Get<VoicePacing>().enabled), 814 pacing_enabled_(config.Get<VoicePacing>().enabled),
815 feedback_observer_proxy_(new TransportFeedbackProxy()), 815 feedback_observer_proxy_(new TransportFeedbackProxy()),
816 seq_num_allocator_proxy_(new TransportSequenceNumberProxy()), 816 seq_num_allocator_proxy_(new TransportSequenceNumberProxy()),
817 rtp_packet_sender_proxy_(new RtpPacketSenderProxy()) { 817 rtp_packet_sender_proxy_(new RtpPacketSenderProxy()),
818 decoder_factory_(decoder_factory) {
818 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_instanceId, _channelId), 819 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(_instanceId, _channelId),
819 "Channel::Channel() - ctor"); 820 "Channel::Channel() - ctor");
820 AudioCodingModule::Config acm_config; 821 AudioCodingModule::Config acm_config;
821 acm_config.id = VoEModuleId(instanceId, channelId); 822 acm_config.id = VoEModuleId(instanceId, channelId);
822 if (config.Get<NetEqCapacityConfig>().enabled) { 823 if (config.Get<NetEqCapacityConfig>().enabled) {
823 // Clamping the buffer capacity at 20 packets. While going lower will 824 // Clamping the buffer capacity at 20 packets. While going lower will
824 // probably work, it makes little sense. 825 // probably work, it makes little sense.
825 acm_config.neteq_config.max_packets_in_buffer = 826 acm_config.neteq_config.max_packets_in_buffer =
826 std::max(20, config.Get<NetEqCapacityConfig>().capacity); 827 std::max(20, config.Get<NetEqCapacityConfig>().capacity);
827 } 828 }
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 int32_t Channel::UpdateLocalTimeStamp() { 1064 int32_t Channel::UpdateLocalTimeStamp() {
1064 _timeStamp += static_cast<uint32_t>(_audioFrame.samples_per_channel_); 1065 _timeStamp += static_cast<uint32_t>(_audioFrame.samples_per_channel_);
1065 return 0; 1066 return 0;
1066 } 1067 }
1067 1068
1068 void Channel::SetSink(std::unique_ptr<AudioSinkInterface> sink) { 1069 void Channel::SetSink(std::unique_ptr<AudioSinkInterface> sink) {
1069 rtc::CritScope cs(&_callbackCritSect); 1070 rtc::CritScope cs(&_callbackCritSect);
1070 audio_sink_ = std::move(sink); 1071 audio_sink_ = std::move(sink);
1071 } 1072 }
1072 1073
1074 const rtc::scoped_refptr<AudioDecoderFactory>&
1075 Channel::GetAudioDecoderFactory() const {
1076 return decoder_factory_;
1077 }
1073 int32_t Channel::StartPlayout() { 1078 int32_t Channel::StartPlayout() {
1074 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), 1079 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
1075 "Channel::StartPlayout()"); 1080 "Channel::StartPlayout()");
1076 if (channel_state_.Get().playing) { 1081 if (channel_state_.Get().playing) {
1077 return 0; 1082 return 0;
1078 } 1083 }
1079 1084
1080 if (!_externalMixing) { 1085 if (!_externalMixing) {
1081 // Add participant as candidates for mixing. 1086 // Add participant as candidates for mixing.
1082 if (_outputMixerPtr->SetMixabilityStatus(*this, true) != 0) { 1087 if (_outputMixerPtr->SetMixabilityStatus(*this, true) != 0) {
(...skipping 2480 matching lines...) Expand 10 before | Expand all | Expand 10 after
3563 int64_t min_rtt = 0; 3568 int64_t min_rtt = 0;
3564 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 3569 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) !=
3565 0) { 3570 0) {
3566 return 0; 3571 return 0;
3567 } 3572 }
3568 return rtt; 3573 return rtt;
3569 } 3574 }
3570 3575
3571 } // namespace voe 3576 } // namespace voe
3572 } // namespace webrtc 3577 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698