| 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 |
| 11 #include "webrtc/voice_engine/channel.h" | 11 #include "webrtc/voice_engine/channel.h" |
| 12 | 12 |
| 13 #include <algorithm> | 13 #include <algorithm> |
| 14 #include <utility> | 14 #include <utility> |
| 15 | 15 |
| 16 #include "webrtc/audio/utility/audio_frame_operations.h" |
| 16 #include "webrtc/base/array_view.h" | 17 #include "webrtc/base/array_view.h" |
| 17 #include "webrtc/base/checks.h" | 18 #include "webrtc/base/checks.h" |
| 18 #include "webrtc/base/criticalsection.h" | 19 #include "webrtc/base/criticalsection.h" |
| 19 #include "webrtc/base/format_macros.h" | 20 #include "webrtc/base/format_macros.h" |
| 20 #include "webrtc/base/logging.h" | 21 #include "webrtc/base/logging.h" |
| 21 #include "webrtc/base/rate_limiter.h" | 22 #include "webrtc/base/rate_limiter.h" |
| 22 #include "webrtc/base/thread_checker.h" | 23 #include "webrtc/base/thread_checker.h" |
| 23 #include "webrtc/base/timeutils.h" | 24 #include "webrtc/base/timeutils.h" |
| 24 #include "webrtc/config.h" | 25 #include "webrtc/config.h" |
| 25 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" | 26 #include "webrtc/logging/rtc_event_log/rtc_event_log.h" |
| 26 #include "webrtc/modules/audio_coding/codecs/audio_format_conversion.h" | 27 #include "webrtc/modules/audio_coding/codecs/audio_format_conversion.h" |
| 27 #include "webrtc/modules/audio_device/include/audio_device.h" | 28 #include "webrtc/modules/audio_device/include/audio_device.h" |
| 28 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 29 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
| 29 #include "webrtc/modules/include/module_common_types.h" | 30 #include "webrtc/modules/include/module_common_types.h" |
| 30 #include "webrtc/modules/pacing/packet_router.h" | 31 #include "webrtc/modules/pacing/packet_router.h" |
| 31 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" | 32 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h" |
| 32 #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h" | 33 #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h" |
| 33 #include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h" | 34 #include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h" |
| 34 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h" | 35 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_strategy.h" |
| 35 #include "webrtc/modules/utility/include/audio_frame_operations.h" | |
| 36 #include "webrtc/modules/utility/include/process_thread.h" | 36 #include "webrtc/modules/utility/include/process_thread.h" |
| 37 #include "webrtc/system_wrappers/include/trace.h" | 37 #include "webrtc/system_wrappers/include/trace.h" |
| 38 #include "webrtc/voice_engine/include/voe_external_media.h" | 38 #include "webrtc/voice_engine/include/voe_external_media.h" |
| 39 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" | 39 #include "webrtc/voice_engine/include/voe_rtp_rtcp.h" |
| 40 #include "webrtc/voice_engine/output_mixer.h" | 40 #include "webrtc/voice_engine/output_mixer.h" |
| 41 #include "webrtc/voice_engine/statistics.h" | 41 #include "webrtc/voice_engine/statistics.h" |
| 42 #include "webrtc/voice_engine/transmit_mixer.h" | 42 #include "webrtc/voice_engine/transmit_mixer.h" |
| 43 #include "webrtc/voice_engine/utility.h" | 43 #include "webrtc/voice_engine/utility.h" |
| 44 | 44 |
| 45 namespace webrtc { | 45 namespace webrtc { |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 // error so that the audio mixer module doesn't add it to the mix. As | 606 // error so that the audio mixer module doesn't add it to the mix. As |
| 607 // a result, it won't be played out and the actions skipped here are | 607 // a result, it won't be played out and the actions skipped here are |
| 608 // irrelevant. | 608 // irrelevant. |
| 609 return MixerParticipant::AudioFrameInfo::kError; | 609 return MixerParticipant::AudioFrameInfo::kError; |
| 610 } | 610 } |
| 611 | 611 |
| 612 if (muted) { | 612 if (muted) { |
| 613 // TODO(henrik.lundin): We should be able to do better than this. But we | 613 // TODO(henrik.lundin): We should be able to do better than this. But we |
| 614 // will have to go through all the cases below where the audio samples may | 614 // will have to go through all the cases below where the audio samples may |
| 615 // be used, and handle the muted case in some way. | 615 // be used, and handle the muted case in some way. |
| 616 audioFrame->Mute(); | 616 AudioFrameOperations::Mute(audioFrame); |
| 617 } | 617 } |
| 618 | 618 |
| 619 // Convert module ID to internal VoE channel ID | 619 // Convert module ID to internal VoE channel ID |
| 620 audioFrame->id_ = VoEChannelId(audioFrame->id_); | 620 audioFrame->id_ = VoEChannelId(audioFrame->id_); |
| 621 // Store speech type for dead-or-alive detection | 621 // Store speech type for dead-or-alive detection |
| 622 _outputSpeechType = audioFrame->speech_type_; | 622 _outputSpeechType = audioFrame->speech_type_; |
| 623 | 623 |
| 624 ChannelState::State state = channel_state_.Get(); | 624 ChannelState::State state = channel_state_.Get(); |
| 625 | 625 |
| 626 { | 626 { |
| (...skipping 2652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3279 int64_t min_rtt = 0; | 3279 int64_t min_rtt = 0; |
| 3280 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3280 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
| 3281 0) { | 3281 0) { |
| 3282 return 0; | 3282 return 0; |
| 3283 } | 3283 } |
| 3284 return rtt; | 3284 return rtt; |
| 3285 } | 3285 } |
| 3286 | 3286 |
| 3287 } // namespace voe | 3287 } // namespace voe |
| 3288 } // namespace webrtc | 3288 } // namespace webrtc |
| OLD | NEW |