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

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

Issue 2535523002: Refactor RMSLevel and give it new functionality (Closed)
Patch Set: Fixing win64 compile 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
(...skipping 2748 matching lines...) Expand 10 before | Expand all | Expand 10 after
2759 } 2759 }
2760 } 2760 }
2761 2761
2762 if (_includeAudioLevelIndication) { 2762 if (_includeAudioLevelIndication) {
2763 size_t length = 2763 size_t length =
2764 _audioFrame.samples_per_channel_ * _audioFrame.num_channels_; 2764 _audioFrame.samples_per_channel_ * _audioFrame.num_channels_;
2765 RTC_CHECK_LE(length, sizeof(_audioFrame.data_)); 2765 RTC_CHECK_LE(length, sizeof(_audioFrame.data_));
2766 if (is_muted && previous_frame_muted_) { 2766 if (is_muted && previous_frame_muted_) {
2767 rms_level_.ProcessMuted(length); 2767 rms_level_.ProcessMuted(length);
2768 } else { 2768 } else {
2769 rms_level_.Process(_audioFrame.data_, length); 2769 rms_level_.Process(
2770 rtc::ArrayView<const int16_t>(_audioFrame.data_, length));
peah-webrtc 2016/11/29 08:57:13 You should probably add the include array_view.h.
hlundin-webrtc 2016/11/29 10:24:55 Done.
2770 } 2771 }
2771 } 2772 }
2772 previous_frame_muted_ = is_muted; 2773 previous_frame_muted_ = is_muted;
2773 2774
2774 return 0; 2775 return 0;
2775 } 2776 }
2776 2777
2777 uint32_t Channel::EncodeAndSend() { 2778 uint32_t Channel::EncodeAndSend() {
2778 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId), 2779 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId),
2779 "Channel::EncodeAndSend()"); 2780 "Channel::EncodeAndSend()");
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
3228 int64_t min_rtt = 0; 3229 int64_t min_rtt = 0;
3229 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 3230 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) !=
3230 0) { 3231 0) {
3231 return 0; 3232 return 0;
3232 } 3233 }
3233 return rtt; 3234 return rtt;
3234 } 3235 }
3235 3236
3236 } // namespace voe 3237 } // namespace voe
3237 } // namespace webrtc 3238 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698