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/threading/thread_restrictions.h" | 8 #include "base/threading/thread_restrictions.h" |
9 #include "media/base/limits.h" | 9 #include "media/base/limits.h" |
10 #include "media/base/scoped_histogram_timer.h" | 10 #include "media/base/scoped_histogram_timer.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 AudioInputController::AudioInputController(EventHandler* handler, | 38 AudioInputController::AudioInputController(EventHandler* handler, |
39 SyncWriter* sync_writer) | 39 SyncWriter* sync_writer) |
40 : creator_loop_(base::MessageLoopProxy::current()), | 40 : creator_loop_(base::MessageLoopProxy::current()), |
41 handler_(handler), | 41 handler_(handler), |
42 stream_(NULL), | 42 stream_(NULL), |
43 data_is_active_(false), | 43 data_is_active_(false), |
44 state_(kEmpty), | 44 state_(kEmpty), |
45 sync_writer_(sync_writer), | 45 sync_writer_(sync_writer), |
46 max_volume_(0.0) { | 46 max_volume_(0.0) { |
47 DCHECK(creator_loop_); | 47 DCHECK(creator_loop_.get()); |
48 } | 48 } |
49 | 49 |
50 AudioInputController::~AudioInputController() { | 50 AudioInputController::~AudioInputController() { |
51 DCHECK(kClosed == state_ || kCreated == state_ || kEmpty == state_); | 51 DCHECK(kClosed == state_ || kCreated == state_ || kEmpty == state_); |
52 } | 52 } |
53 | 53 |
54 // static | 54 // static |
55 scoped_refptr<AudioInputController> AudioInputController::Create( | 55 scoped_refptr<AudioInputController> AudioInputController::Create( |
56 AudioManager* audio_manager, | 56 AudioManager* audio_manager, |
57 EventHandler* event_handler, | 57 EventHandler* event_handler, |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 372 |
373 void AudioInputController::SetDataIsActive(bool enabled) { | 373 void AudioInputController::SetDataIsActive(bool enabled) { |
374 base::subtle::Release_Store(&data_is_active_, enabled); | 374 base::subtle::Release_Store(&data_is_active_, enabled); |
375 } | 375 } |
376 | 376 |
377 bool AudioInputController::GetDataIsActive() { | 377 bool AudioInputController::GetDataIsActive() { |
378 return (base::subtle::Acquire_Load(&data_is_active_) != false); | 378 return (base::subtle::Acquire_Load(&data_is_active_) != false); |
379 } | 379 } |
380 | 380 |
381 } // namespace media | 381 } // namespace media |
OLD | NEW |