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

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

Issue 2424173003: Move functionality out from AudioFrame and into AudioFrameOperations. (Closed)
Patch Set: Removed unneeded checks for #channels <= 2. Created 4 years 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
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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 // error so that the audio mixer module doesn't add it to the mix. As 578 // error so that the audio mixer module doesn't add it to the mix. As
579 // a result, it won't be played out and the actions skipped here are 579 // a result, it won't be played out and the actions skipped here are
580 // irrelevant. 580 // irrelevant.
581 return MixerParticipant::AudioFrameInfo::kError; 581 return MixerParticipant::AudioFrameInfo::kError;
582 } 582 }
583 583
584 if (muted) { 584 if (muted) {
585 // TODO(henrik.lundin): We should be able to do better than this. But we 585 // TODO(henrik.lundin): We should be able to do better than this. But we
586 // will have to go through all the cases below where the audio samples may 586 // will have to go through all the cases below where the audio samples may
587 // be used, and handle the muted case in some way. 587 // be used, and handle the muted case in some way.
588 audioFrame->Mute(); 588 AudioFrameOperations::Mute(audioFrame);
589 } 589 }
590 590
591 // Convert module ID to internal VoE channel ID 591 // Convert module ID to internal VoE channel ID
592 audioFrame->id_ = VoEChannelId(audioFrame->id_); 592 audioFrame->id_ = VoEChannelId(audioFrame->id_);
593 // Store speech type for dead-or-alive detection 593 // Store speech type for dead-or-alive detection
594 _outputSpeechType = audioFrame->speech_type_; 594 _outputSpeechType = audioFrame->speech_type_;
595 595
596 ChannelState::State state = channel_state_.Get(); 596 ChannelState::State state = channel_state_.Get();
597 597
598 { 598 {
(...skipping 2647 matching lines...) Expand 10 before | Expand all | Expand 10 after
3246 int64_t min_rtt = 0; 3246 int64_t min_rtt = 0;
3247 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 3247 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) !=
3248 0) { 3248 0) {
3249 return 0; 3249 return 0;
3250 } 3250 }
3251 return rtt; 3251 return rtt;
3252 } 3252 }
3253 3253
3254 } // namespace voe 3254 } // namespace voe
3255 } // namespace webrtc 3255 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698