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

Side by Side Diff: media/audio/audio_input_controller.cc

Issue 551763003: Reduce amount of power measurements for input audio (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/audio/audio_input_controller.h" 5 #include "media/audio/audio_input_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 27 matching lines...) Expand all
38 // by 1-exp(-1/(fs*ts)), where fs is the sample rate in Hz and ts is the time 38 // by 1-exp(-1/(fs*ts)), where fs is the sample rate in Hz and ts is the time
39 // constant given by |kPowerMeasurementTimeConstantMilliseconds|. 39 // constant given by |kPowerMeasurementTimeConstantMilliseconds|.
40 // Example: fs=44100, ts=10e-3 => alpha~0.022420 40 // Example: fs=44100, ts=10e-3 => alpha~0.022420
41 // fs=44100, ts=20e-3 => alpha~0.165903 41 // fs=44100, ts=20e-3 => alpha~0.165903
42 // A large smoothing factor corresponds to a faster filter response to input 42 // A large smoothing factor corresponds to a faster filter response to input
43 // changes since y(n)=alpha*x(n)+(1-alpha)*y(n-1), where x(n) is the input 43 // changes since y(n)=alpha*x(n)+(1-alpha)*y(n-1), where x(n) is the input
44 // and y(n) is the output. 44 // and y(n) is the output.
45 const int kPowerMeasurementTimeConstantMilliseconds = 10; 45 const int kPowerMeasurementTimeConstantMilliseconds = 10;
46 46
47 // Time in seconds between two successive measurements of audio power levels. 47 // Time in seconds between two successive measurements of audio power levels.
48 const int kPowerMonitorLogIntervalSeconds = 5; 48 const int kPowerMonitorLogIntervalSeconds = 15;
Henrik Grunell 2014/09/08 10:57:24 Would it make sense to have 15 seconds to the firs
49 #endif 49 #endif
50 } 50 }
51 51
52 // Used to log the result of capture startup. 52 // Used to log the result of capture startup.
53 // This was previously logged as a boolean with only the no callback and OK 53 // This was previously logged as a boolean with only the no callback and OK
54 // options. The enum order is kept to ensure backwards compatibility. 54 // options. The enum order is kept to ensure backwards compatibility.
55 // Elements in this enum should not be deleted or rearranged; the only 55 // Elements in this enum should not be deleted or rearranged; the only
56 // permitted operation is to add new elements before CAPTURE_STARTUP_RESULT_MAX 56 // permitted operation is to add new elements before CAPTURE_STARTUP_RESULT_MAX
57 // and update CAPTURE_STARTUP_RESULT_MAX. 57 // and update CAPTURE_STARTUP_RESULT_MAX.
58 enum CaptureStartupResult { 58 enum CaptureStartupResult {
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 } 616 }
617 617
618 void AudioInputController::LogSilenceState(SilenceState value) { 618 void AudioInputController::LogSilenceState(SilenceState value) {
619 UMA_HISTOGRAM_ENUMERATION("Media.AudioInputControllerSessionSilenceReport", 619 UMA_HISTOGRAM_ENUMERATION("Media.AudioInputControllerSessionSilenceReport",
620 value, 620 value,
621 SILENCE_STATE_MAX + 1); 621 SILENCE_STATE_MAX + 1);
622 } 622 }
623 #endif 623 #endif
624 624
625 } // namespace media 625 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698