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

Side by Side Diff: webrtc/audio/audio_receive_stream.cc

Issue 2964593002: Adding stats that can be used to compute output audio levels. (Closed)
Patch Set: Add test coverage in AudioSendStreamTest. Created 3 years, 5 months 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
« no previous file with comments | « webrtc/api/statstypes.cc ('k') | webrtc/audio/audio_receive_stream_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 if (codec_inst.pltype != -1) { 180 if (codec_inst.pltype != -1) {
181 stats.codec_name = codec_inst.plname; 181 stats.codec_name = codec_inst.plname;
182 stats.codec_payload_type = rtc::Optional<int>(codec_inst.pltype); 182 stats.codec_payload_type = rtc::Optional<int>(codec_inst.pltype);
183 } 183 }
184 stats.ext_seqnum = call_stats.extendedMax; 184 stats.ext_seqnum = call_stats.extendedMax;
185 if (codec_inst.plfreq / 1000 > 0) { 185 if (codec_inst.plfreq / 1000 > 0) {
186 stats.jitter_ms = call_stats.jitterSamples / (codec_inst.plfreq / 1000); 186 stats.jitter_ms = call_stats.jitterSamples / (codec_inst.plfreq / 1000);
187 } 187 }
188 stats.delay_estimate_ms = channel_proxy_->GetDelayEstimate(); 188 stats.delay_estimate_ms = channel_proxy_->GetDelayEstimate();
189 stats.audio_level = channel_proxy_->GetSpeechOutputLevelFullRange(); 189 stats.audio_level = channel_proxy_->GetSpeechOutputLevelFullRange();
190 stats.total_output_energy = channel_proxy_->GetTotalOutputEnergy();
191 stats.total_output_duration = channel_proxy_->GetTotalOutputDuration();
190 192
191 // Get jitter buffer and total delay (alg + jitter + playout) stats. 193 // Get jitter buffer and total delay (alg + jitter + playout) stats.
192 auto ns = channel_proxy_->GetNetworkStatistics(); 194 auto ns = channel_proxy_->GetNetworkStatistics();
193 stats.jitter_buffer_ms = ns.currentBufferSize; 195 stats.jitter_buffer_ms = ns.currentBufferSize;
194 stats.jitter_buffer_preferred_ms = ns.preferredBufferSize; 196 stats.jitter_buffer_preferred_ms = ns.preferredBufferSize;
195 stats.expand_rate = Q14ToFloat(ns.currentExpandRate); 197 stats.expand_rate = Q14ToFloat(ns.currentExpandRate);
196 stats.speech_expand_rate = Q14ToFloat(ns.currentSpeechExpandRate); 198 stats.speech_expand_rate = Q14ToFloat(ns.currentSpeechExpandRate);
197 stats.secondary_decoded_rate = Q14ToFloat(ns.currentSecondaryDecodedRate); 199 stats.secondary_decoded_rate = Q14ToFloat(ns.currentSecondaryDecodedRate);
198 stats.accelerate_rate = Q14ToFloat(ns.currentAccelerateRate); 200 stats.accelerate_rate = Q14ToFloat(ns.currentAccelerateRate);
199 stats.preemptive_expand_rate = Q14ToFloat(ns.currentPreemptiveRate); 201 stats.preemptive_expand_rate = Q14ToFloat(ns.currentPreemptiveRate);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 int AudioReceiveStream::SetVoiceEnginePlayout(bool playout) { 341 int AudioReceiveStream::SetVoiceEnginePlayout(bool playout) {
340 ScopedVoEInterface<VoEBase> base(voice_engine()); 342 ScopedVoEInterface<VoEBase> base(voice_engine());
341 if (playout) { 343 if (playout) {
342 return base->StartPlayout(config_.voe_channel_id); 344 return base->StartPlayout(config_.voe_channel_id);
343 } else { 345 } else {
344 return base->StopPlayout(config_.voe_channel_id); 346 return base->StopPlayout(config_.voe_channel_id);
345 } 347 }
346 } 348 }
347 } // namespace internal 349 } // namespace internal
348 } // namespace webrtc 350 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/statstypes.cc ('k') | webrtc/audio/audio_receive_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698