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

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

Issue 1993783002: Moved CreateBuiltinDecoderFactory out to VoEBaseImpl. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@audio-decoder-factory-injections-2
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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 } 655 }
656 656
657 return (highestNeeded); 657 return (highestNeeded);
658 } 658 }
659 659
660 int32_t Channel::CreateChannel(Channel*& channel, 660 int32_t Channel::CreateChannel(Channel*& channel,
661 int32_t channelId, 661 int32_t channelId,
662 uint32_t instanceId, 662 uint32_t instanceId,
663 RtcEventLog* const event_log, 663 RtcEventLog* const event_log,
664 const Config& config) { 664 const Config& config) {
665 return CreateChannel(channel, channelId, instanceId, event_log, config,
666 CreateBuiltinAudioDecoderFactory());
667 }
668
669 int32_t Channel::CreateChannel(
670 Channel*& channel,
671 int32_t channelId,
672 uint32_t instanceId,
673 RtcEventLog* const event_log,
674 const Config& config,
675 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) {
665 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, channelId), 676 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, channelId),
666 "Channel::CreateChannel(channelId=%d, instanceId=%d)", channelId, 677 "Channel::CreateChannel(channelId=%d, instanceId=%d)", channelId,
667 instanceId); 678 instanceId);
668 679
669 channel = new Channel(channelId, instanceId, event_log, config); 680 channel =
681 new Channel(channelId, instanceId, event_log, config, decoder_factory);
670 if (channel == NULL) { 682 if (channel == NULL) {
671 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, channelId), 683 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, channelId),
672 "Channel::CreateChannel() unable to allocate memory for" 684 "Channel::CreateChannel() unable to allocate memory for"
673 " channel"); 685 " channel");
674 return -1; 686 return -1;
675 } 687 }
676 return 0; 688 return 0;
677 } 689 }
678 690
679 void Channel::PlayNotification(int32_t id, uint32_t durationMs) { 691 void Channel::PlayNotification(int32_t id, uint32_t durationMs) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 731
720 _outputFileRecording = false; 732 _outputFileRecording = false;
721 WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId, _channelId), 733 WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId, _channelId),
722 "Channel::RecordFileEnded() => output file recorder module is" 734 "Channel::RecordFileEnded() => output file recorder module is"
723 " shutdown"); 735 " shutdown");
724 } 736 }
725 737
726 Channel::Channel(int32_t channelId, 738 Channel::Channel(int32_t channelId,
727 uint32_t instanceId, 739 uint32_t instanceId,
728 RtcEventLog* const event_log, 740 RtcEventLog* const event_log,
729 const Config& config) 741 const Config& config,
742 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory)
730 : _instanceId(instanceId), 743 : _instanceId(instanceId),
731 _channelId(channelId), 744 _channelId(channelId),
732 event_log_(event_log), 745 event_log_(event_log),
733 rtp_header_parser_(RtpHeaderParser::Create()), 746 rtp_header_parser_(RtpHeaderParser::Create()),
734 rtp_payload_registry_( 747 rtp_payload_registry_(
735 new RTPPayloadRegistry(RTPPayloadStrategy::CreateStrategy(true))), 748 new RTPPayloadRegistry(RTPPayloadStrategy::CreateStrategy(true))),
736 rtp_receive_statistics_( 749 rtp_receive_statistics_(
737 ReceiveStatistics::Create(Clock::GetRealTimeClock())), 750 ReceiveStatistics::Create(Clock::GetRealTimeClock())),
738 rtp_receiver_( 751 rtp_receiver_(
739 RtpReceiver::CreateAudioReceiver(Clock::GetRealTimeClock(), 752 RtpReceiver::CreateAudioReceiver(Clock::GetRealTimeClock(),
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 acm_config.id = VoEModuleId(instanceId, channelId); 821 acm_config.id = VoEModuleId(instanceId, channelId);
809 if (config.Get<NetEqCapacityConfig>().enabled) { 822 if (config.Get<NetEqCapacityConfig>().enabled) {
810 // Clamping the buffer capacity at 20 packets. While going lower will 823 // Clamping the buffer capacity at 20 packets. While going lower will
811 // probably work, it makes little sense. 824 // probably work, it makes little sense.
812 acm_config.neteq_config.max_packets_in_buffer = 825 acm_config.neteq_config.max_packets_in_buffer =
813 std::max(20, config.Get<NetEqCapacityConfig>().capacity); 826 std::max(20, config.Get<NetEqCapacityConfig>().capacity);
814 } 827 }
815 acm_config.neteq_config.enable_fast_accelerate = 828 acm_config.neteq_config.enable_fast_accelerate =
816 config.Get<NetEqFastAccelerate>().enabled; 829 config.Get<NetEqFastAccelerate>().enabled;
817 acm_config.neteq_config.enable_muted_state = false; 830 acm_config.neteq_config.enable_muted_state = false;
818 acm_config.decoder_factory = CreateBuiltinAudioDecoderFactory(); 831 acm_config.decoder_factory = decoder_factory;
819 audio_coding_.reset(AudioCodingModule::Create(acm_config)); 832 audio_coding_.reset(AudioCodingModule::Create(acm_config));
820 833
821 _outputAudioLevel.Clear(); 834 _outputAudioLevel.Clear();
822 835
823 RtpRtcp::Configuration configuration; 836 RtpRtcp::Configuration configuration;
824 configuration.audio = true; 837 configuration.audio = true;
825 configuration.outgoing_transport = this; 838 configuration.outgoing_transport = this;
826 configuration.receive_statistics = rtp_receive_statistics_.get(); 839 configuration.receive_statistics = rtp_receive_statistics_.get();
827 configuration.bandwidth_callback = rtcp_observer_.get(); 840 configuration.bandwidth_callback = rtcp_observer_.get();
828 if (pacing_enabled_) { 841 if (pacing_enabled_) {
(...skipping 2721 matching lines...) Expand 10 before | Expand all | Expand 10 after
3550 int64_t min_rtt = 0; 3563 int64_t min_rtt = 0;
3551 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 3564 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) !=
3552 0) { 3565 0) {
3553 return 0; 3566 return 0;
3554 } 3567 }
3555 return rtt; 3568 return rtt;
3556 } 3569 }
3557 3570
3558 } // namespace voe 3571 } // namespace voe
3559 } // namespace webrtc 3572 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698