OLD | NEW |
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/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/single_thread_task_runner.h" | |
10 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
11 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
12 #include "base/thread_task_runner_handle.h" | |
13 #include "base/threading/thread_restrictions.h" | 11 #include "base/threading/thread_restrictions.h" |
14 #include "base/time/time.h" | 12 #include "base/time/time.h" |
15 #include "media/audio/audio_parameters.h" | 13 #include "media/audio/audio_parameters.h" |
16 #include "media/base/user_input_monitor.h" | 14 #include "media/base/user_input_monitor.h" |
17 | 15 |
18 using base::TimeDelta; | 16 using base::TimeDelta; |
19 | 17 |
20 namespace { | 18 namespace { |
21 | 19 |
22 const int kMaxInputChannels = 3; | 20 const int kMaxInputChannels = 3; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 112 |
115 namespace media { | 113 namespace media { |
116 | 114 |
117 // static | 115 // static |
118 AudioInputController::Factory* AudioInputController::factory_ = NULL; | 116 AudioInputController::Factory* AudioInputController::factory_ = NULL; |
119 | 117 |
120 AudioInputController::AudioInputController(EventHandler* handler, | 118 AudioInputController::AudioInputController(EventHandler* handler, |
121 SyncWriter* sync_writer, | 119 SyncWriter* sync_writer, |
122 UserInputMonitor* user_input_monitor, | 120 UserInputMonitor* user_input_monitor, |
123 const bool agc_is_enabled) | 121 const bool agc_is_enabled) |
124 : creator_task_runner_(base::ThreadTaskRunnerHandle::Get()), | 122 : creator_task_runner_(base::MessageLoopProxy::current()), |
125 handler_(handler), | 123 handler_(handler), |
126 stream_(NULL), | 124 stream_(NULL), |
127 data_is_active_(false), | 125 data_is_active_(false), |
128 state_(CLOSED), | 126 state_(CLOSED), |
129 sync_writer_(sync_writer), | 127 sync_writer_(sync_writer), |
130 max_volume_(0.0), | 128 max_volume_(0.0), |
131 user_input_monitor_(user_input_monitor), | 129 user_input_monitor_(user_input_monitor), |
132 agc_is_enabled_(agc_is_enabled), | 130 agc_is_enabled_(agc_is_enabled), |
133 #if defined(AUDIO_POWER_MONITORING) | 131 #if defined(AUDIO_POWER_MONITORING) |
134 power_measurement_is_enabled_(false), | 132 power_measurement_is_enabled_(false), |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 } | 669 } |
672 | 670 |
673 void AudioInputController::LogSilenceState(SilenceState value) { | 671 void AudioInputController::LogSilenceState(SilenceState value) { |
674 UMA_HISTOGRAM_ENUMERATION("Media.AudioInputControllerSessionSilenceReport", | 672 UMA_HISTOGRAM_ENUMERATION("Media.AudioInputControllerSessionSilenceReport", |
675 value, | 673 value, |
676 SILENCE_STATE_MAX + 1); | 674 SILENCE_STATE_MAX + 1); |
677 } | 675 } |
678 #endif | 676 #endif |
679 | 677 |
680 } // namespace media | 678 } // namespace media |
OLD | NEW |