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

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

Issue 2935693005: Adding stats that can be used to compute output audio levels.
Patch Set: Created 3 years, 6 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/stats/rtcstats_objects.h ('k') | webrtc/call/audio_receive_stream.h » ('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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 if (codec_inst.pltype != -1) { 174 if (codec_inst.pltype != -1) {
175 stats.codec_name = codec_inst.plname; 175 stats.codec_name = codec_inst.plname;
176 stats.codec_payload_type = rtc::Optional<int>(codec_inst.pltype); 176 stats.codec_payload_type = rtc::Optional<int>(codec_inst.pltype);
177 } 177 }
178 stats.ext_seqnum = call_stats.extendedMax; 178 stats.ext_seqnum = call_stats.extendedMax;
179 if (codec_inst.plfreq / 1000 > 0) { 179 if (codec_inst.plfreq / 1000 > 0) {
180 stats.jitter_ms = call_stats.jitterSamples / (codec_inst.plfreq / 1000); 180 stats.jitter_ms = call_stats.jitterSamples / (codec_inst.plfreq / 1000);
181 } 181 }
182 stats.delay_estimate_ms = channel_proxy_->GetDelayEstimate(); 182 stats.delay_estimate_ms = channel_proxy_->GetDelayEstimate();
183 stats.audio_level = channel_proxy_->GetSpeechOutputLevelFullRange(); 183 stats.audio_level = channel_proxy_->GetSpeechOutputLevelFullRange();
184 stats.total_output_energy = channel_proxy_->GetTotalOutputEnergy();
185 stats.total_output_duration = channel_proxy_->GetTotalOutputDuration();
184 186
185 // Get jitter buffer and total delay (alg + jitter + playout) stats. 187 // Get jitter buffer and total delay (alg + jitter + playout) stats.
186 auto ns = channel_proxy_->GetNetworkStatistics(); 188 auto ns = channel_proxy_->GetNetworkStatistics();
187 stats.jitter_buffer_ms = ns.currentBufferSize; 189 stats.jitter_buffer_ms = ns.currentBufferSize;
188 stats.jitter_buffer_preferred_ms = ns.preferredBufferSize; 190 stats.jitter_buffer_preferred_ms = ns.preferredBufferSize;
189 stats.expand_rate = Q14ToFloat(ns.currentExpandRate); 191 stats.expand_rate = Q14ToFloat(ns.currentExpandRate);
190 stats.speech_expand_rate = Q14ToFloat(ns.currentSpeechExpandRate); 192 stats.speech_expand_rate = Q14ToFloat(ns.currentSpeechExpandRate);
191 stats.secondary_decoded_rate = Q14ToFloat(ns.currentSecondaryDecodedRate); 193 stats.secondary_decoded_rate = Q14ToFloat(ns.currentSecondaryDecodedRate);
192 stats.accelerate_rate = Q14ToFloat(ns.currentAccelerateRate); 194 stats.accelerate_rate = Q14ToFloat(ns.currentAccelerateRate);
193 stats.preemptive_expand_rate = Q14ToFloat(ns.currentPreemptiveRate); 195 stats.preemptive_expand_rate = Q14ToFloat(ns.currentPreemptiveRate);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 int AudioReceiveStream::SetVoiceEnginePlayout(bool playout) { 335 int AudioReceiveStream::SetVoiceEnginePlayout(bool playout) {
334 ScopedVoEInterface<VoEBase> base(voice_engine()); 336 ScopedVoEInterface<VoEBase> base(voice_engine());
335 if (playout) { 337 if (playout) {
336 return base->StartPlayout(config_.voe_channel_id); 338 return base->StartPlayout(config_.voe_channel_id);
337 } else { 339 } else {
338 return base->StopPlayout(config_.voe_channel_id); 340 return base->StopPlayout(config_.voe_channel_id);
339 } 341 }
340 } 342 }
341 } // namespace internal 343 } // namespace internal
342 } // namespace webrtc 344 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/stats/rtcstats_objects.h ('k') | webrtc/call/audio_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698