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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 return ReceivePacket(rtp_packet, rtp_packet_length, header, false); | 476 return ReceivePacket(rtp_packet, rtp_packet_length, header, false); |
477 } | 477 } |
478 | 478 |
479 int32_t Channel::GetAudioFrame(int32_t id, AudioFrame* audioFrame) { | 479 int32_t Channel::GetAudioFrame(int32_t id, AudioFrame* audioFrame) { |
480 if (event_log_) { | 480 if (event_log_) { |
481 unsigned int ssrc; | 481 unsigned int ssrc; |
482 RTC_CHECK_EQ(GetLocalSSRC(ssrc), 0); | 482 RTC_CHECK_EQ(GetLocalSSRC(ssrc), 0); |
483 event_log_->LogAudioPlayout(ssrc); | 483 event_log_->LogAudioPlayout(ssrc); |
484 } | 484 } |
485 // Get 10ms raw PCM data from the ACM (mixer limits output frequency) | 485 // Get 10ms raw PCM data from the ACM (mixer limits output frequency) |
486 if (audio_coding_->PlayoutData10Ms(audioFrame->sample_rate_hz_, audioFrame) == | 486 bool muted; |
487 -1) { | 487 if (audio_coding_->PlayoutData10Ms(audioFrame->sample_rate_hz_, audioFrame, |
| 488 &muted) == -1) { |
488 WEBRTC_TRACE(kTraceError, kTraceVoice, VoEId(_instanceId, _channelId), | 489 WEBRTC_TRACE(kTraceError, kTraceVoice, VoEId(_instanceId, _channelId), |
489 "Channel::GetAudioFrame() PlayoutData10Ms() failed!"); | 490 "Channel::GetAudioFrame() PlayoutData10Ms() failed!"); |
490 // In all likelihood, the audio in this frame is garbage. We return an | 491 // In all likelihood, the audio in this frame is garbage. We return an |
491 // error so that the audio mixer module doesn't add it to the mix. As | 492 // error so that the audio mixer module doesn't add it to the mix. As |
492 // a result, it won't be played out and the actions skipped here are | 493 // a result, it won't be played out and the actions skipped here are |
493 // irrelevant. | 494 // irrelevant. |
494 return -1; | 495 return -1; |
495 } | 496 } |
| 497 RTC_DCHECK(!muted); |
496 | 498 |
497 if (_RxVadDetection) { | 499 if (_RxVadDetection) { |
498 UpdateRxVadDetection(*audioFrame); | 500 UpdateRxVadDetection(*audioFrame); |
499 } | 501 } |
500 | 502 |
501 // Convert module ID to internal VoE channel ID | 503 // Convert module ID to internal VoE channel ID |
502 audioFrame->id_ = VoEChannelId(audioFrame->id_); | 504 audioFrame->id_ = VoEChannelId(audioFrame->id_); |
503 // Store speech type for dead-or-alive detection | 505 // Store speech type for dead-or-alive detection |
504 _outputSpeechType = audioFrame->speech_type_; | 506 _outputSpeechType = audioFrame->speech_type_; |
505 | 507 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 AudioCodingModule::Config acm_config; | 806 AudioCodingModule::Config acm_config; |
805 acm_config.id = VoEModuleId(instanceId, channelId); | 807 acm_config.id = VoEModuleId(instanceId, channelId); |
806 if (config.Get<NetEqCapacityConfig>().enabled) { | 808 if (config.Get<NetEqCapacityConfig>().enabled) { |
807 // Clamping the buffer capacity at 20 packets. While going lower will | 809 // Clamping the buffer capacity at 20 packets. While going lower will |
808 // probably work, it makes little sense. | 810 // probably work, it makes little sense. |
809 acm_config.neteq_config.max_packets_in_buffer = | 811 acm_config.neteq_config.max_packets_in_buffer = |
810 std::max(20, config.Get<NetEqCapacityConfig>().capacity); | 812 std::max(20, config.Get<NetEqCapacityConfig>().capacity); |
811 } | 813 } |
812 acm_config.neteq_config.enable_fast_accelerate = | 814 acm_config.neteq_config.enable_fast_accelerate = |
813 config.Get<NetEqFastAccelerate>().enabled; | 815 config.Get<NetEqFastAccelerate>().enabled; |
| 816 acm_config.neteq_config.enable_muted_state = false; |
814 audio_coding_.reset(AudioCodingModule::Create(acm_config)); | 817 audio_coding_.reset(AudioCodingModule::Create(acm_config)); |
815 | 818 |
816 _outputAudioLevel.Clear(); | 819 _outputAudioLevel.Clear(); |
817 | 820 |
818 RtpRtcp::Configuration configuration; | 821 RtpRtcp::Configuration configuration; |
819 configuration.audio = true; | 822 configuration.audio = true; |
820 configuration.outgoing_transport = this; | 823 configuration.outgoing_transport = this; |
821 configuration.receive_statistics = rtp_receive_statistics_.get(); | 824 configuration.receive_statistics = rtp_receive_statistics_.get(); |
822 configuration.bandwidth_callback = rtcp_observer_.get(); | 825 configuration.bandwidth_callback = rtcp_observer_.get(); |
823 if (pacing_enabled_) { | 826 if (pacing_enabled_) { |
(...skipping 2721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3545 int64_t min_rtt = 0; | 3548 int64_t min_rtt = 0; |
3546 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3549 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
3547 0) { | 3550 0) { |
3548 return 0; | 3551 return 0; |
3549 } | 3552 } |
3550 return rtt; | 3553 return rtt; |
3551 } | 3554 } |
3552 | 3555 |
3553 } // namespace voe | 3556 } // namespace voe |
3554 } // namespace webrtc | 3557 } // namespace webrtc |
OLD | NEW |