OLD | NEW |
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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 } | 666 } |
667 | 667 |
668 return (highestNeeded); | 668 return (highestNeeded); |
669 } | 669 } |
670 | 670 |
671 int32_t Channel::CreateChannel(Channel*& channel, | 671 int32_t Channel::CreateChannel(Channel*& channel, |
672 int32_t channelId, | 672 int32_t channelId, |
673 uint32_t instanceId, | 673 uint32_t instanceId, |
674 RtcEventLog* const event_log, | 674 RtcEventLog* const event_log, |
675 const Config& config) { | 675 const Config& config) { |
| 676 return CreateChannel(channel, channelId, instanceId, event_log, config, |
| 677 CreateBuiltinAudioDecoderFactory()); |
| 678 } |
| 679 |
| 680 int32_t Channel::CreateChannel( |
| 681 Channel*& channel, |
| 682 int32_t channelId, |
| 683 uint32_t instanceId, |
| 684 RtcEventLog* const event_log, |
| 685 const Config& config, |
| 686 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) { |
676 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, channelId), | 687 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, channelId), |
677 "Channel::CreateChannel(channelId=%d, instanceId=%d)", channelId, | 688 "Channel::CreateChannel(channelId=%d, instanceId=%d)", channelId, |
678 instanceId); | 689 instanceId); |
679 | 690 |
680 channel = new Channel(channelId, instanceId, event_log, config); | 691 channel = |
| 692 new Channel(channelId, instanceId, event_log, config, decoder_factory); |
681 if (channel == NULL) { | 693 if (channel == NULL) { |
682 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, channelId), | 694 WEBRTC_TRACE(kTraceMemory, kTraceVoice, VoEId(instanceId, channelId), |
683 "Channel::CreateChannel() unable to allocate memory for" | 695 "Channel::CreateChannel() unable to allocate memory for" |
684 " channel"); | 696 " channel"); |
685 return -1; | 697 return -1; |
686 } | 698 } |
687 return 0; | 699 return 0; |
688 } | 700 } |
689 | 701 |
690 void Channel::PlayNotification(int32_t id, uint32_t durationMs) { | 702 void Channel::PlayNotification(int32_t id, uint32_t durationMs) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 | 742 |
731 _outputFileRecording = false; | 743 _outputFileRecording = false; |
732 WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 744 WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
733 "Channel::RecordFileEnded() => output file recorder module is" | 745 "Channel::RecordFileEnded() => output file recorder module is" |
734 " shutdown"); | 746 " shutdown"); |
735 } | 747 } |
736 | 748 |
737 Channel::Channel(int32_t channelId, | 749 Channel::Channel(int32_t channelId, |
738 uint32_t instanceId, | 750 uint32_t instanceId, |
739 RtcEventLog* const event_log, | 751 RtcEventLog* const event_log, |
740 const Config& config) | 752 const Config& config, |
| 753 const rtc::scoped_refptr<AudioDecoderFactory>& decoder_factory) |
741 : _instanceId(instanceId), | 754 : _instanceId(instanceId), |
742 _channelId(channelId), | 755 _channelId(channelId), |
743 event_log_(event_log), | 756 event_log_(event_log), |
744 rtp_header_parser_(RtpHeaderParser::Create()), | 757 rtp_header_parser_(RtpHeaderParser::Create()), |
745 rtp_payload_registry_( | 758 rtp_payload_registry_( |
746 new RTPPayloadRegistry(RTPPayloadStrategy::CreateStrategy(true))), | 759 new RTPPayloadRegistry(RTPPayloadStrategy::CreateStrategy(true))), |
747 rtp_receive_statistics_( | 760 rtp_receive_statistics_( |
748 ReceiveStatistics::Create(Clock::GetRealTimeClock())), | 761 ReceiveStatistics::Create(Clock::GetRealTimeClock())), |
749 rtp_receiver_( | 762 rtp_receiver_( |
750 RtpReceiver::CreateAudioReceiver(Clock::GetRealTimeClock(), | 763 RtpReceiver::CreateAudioReceiver(Clock::GetRealTimeClock(), |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 acm_config.id = VoEModuleId(instanceId, channelId); | 832 acm_config.id = VoEModuleId(instanceId, channelId); |
820 if (config.Get<NetEqCapacityConfig>().enabled) { | 833 if (config.Get<NetEqCapacityConfig>().enabled) { |
821 // Clamping the buffer capacity at 20 packets. While going lower will | 834 // Clamping the buffer capacity at 20 packets. While going lower will |
822 // probably work, it makes little sense. | 835 // probably work, it makes little sense. |
823 acm_config.neteq_config.max_packets_in_buffer = | 836 acm_config.neteq_config.max_packets_in_buffer = |
824 std::max(20, config.Get<NetEqCapacityConfig>().capacity); | 837 std::max(20, config.Get<NetEqCapacityConfig>().capacity); |
825 } | 838 } |
826 acm_config.neteq_config.enable_fast_accelerate = | 839 acm_config.neteq_config.enable_fast_accelerate = |
827 config.Get<NetEqFastAccelerate>().enabled; | 840 config.Get<NetEqFastAccelerate>().enabled; |
828 acm_config.neteq_config.enable_muted_state = true; | 841 acm_config.neteq_config.enable_muted_state = true; |
829 acm_config.decoder_factory = CreateBuiltinAudioDecoderFactory(); | 842 acm_config.decoder_factory = decoder_factory; |
830 audio_coding_.reset(AudioCodingModule::Create(acm_config)); | 843 audio_coding_.reset(AudioCodingModule::Create(acm_config)); |
831 | 844 |
832 _outputAudioLevel.Clear(); | 845 _outputAudioLevel.Clear(); |
833 | 846 |
834 RtpRtcp::Configuration configuration; | 847 RtpRtcp::Configuration configuration; |
835 configuration.audio = true; | 848 configuration.audio = true; |
836 configuration.outgoing_transport = this; | 849 configuration.outgoing_transport = this; |
837 configuration.receive_statistics = rtp_receive_statistics_.get(); | 850 configuration.receive_statistics = rtp_receive_statistics_.get(); |
838 configuration.bandwidth_callback = rtcp_observer_.get(); | 851 configuration.bandwidth_callback = rtcp_observer_.get(); |
839 if (pacing_enabled_) { | 852 if (pacing_enabled_) { |
(...skipping 2721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3561 int64_t min_rtt = 0; | 3574 int64_t min_rtt = 0; |
3562 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3575 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
3563 0) { | 3576 0) { |
3564 return 0; | 3577 return 0; |
3565 } | 3578 } |
3566 return rtt; | 3579 return rtt; |
3567 } | 3580 } |
3568 | 3581 |
3569 } // namespace voe | 3582 } // namespace voe |
3570 } // namespace webrtc | 3583 } // namespace webrtc |
OLD | NEW |