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_device.h" | 5 #include "media/audio/audio_input_device.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 agc_is_enabled_); | 202 agc_is_enabled_); |
203 } | 203 } |
204 | 204 |
205 pending_device_ready_ = false; | 205 pending_device_ready_ = false; |
206 // Notify the client that the device has been started. | 206 // Notify the client that the device has been started. |
207 if (event_handler_) | 207 if (event_handler_) |
208 event_handler_->OnDeviceStarted(device_id); | 208 event_handler_->OnDeviceStarted(device_id); |
209 } | 209 } |
210 | 210 |
211 void AudioInputDevice::OnIPCClosed() { | 211 void AudioInputDevice::OnIPCClosed() { |
212 ipc_ = NULL; | 212 ipc_.reset(); |
213 } | 213 } |
214 | 214 |
215 AudioInputDevice::~AudioInputDevice() { | 215 AudioInputDevice::~AudioInputDevice() { |
216 // TODO(henrika): The current design requires that the user calls | 216 // TODO(henrika): The current design requires that the user calls |
217 // Stop before deleting this class. | 217 // Stop before deleting this class. |
218 CHECK_EQ(0, stream_id_); | 218 CHECK_EQ(0, stream_id_); |
219 } | 219 } |
220 | 220 |
221 void AudioInputDevice::InitializeOnIOThread() { | 221 void AudioInputDevice::InitializeOnIOThread() { |
222 DCHECK(message_loop()->BelongsToCurrentThread()); | 222 DCHECK(message_loop()->BelongsToCurrentThread()); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 // with nominal range -1.0 -> +1.0. | 336 // with nominal range -1.0 -> +1.0. |
337 audio_bus_->FromInterleaved(memory, audio_bus_->frames(), bytes_per_sample); | 337 audio_bus_->FromInterleaved(memory, audio_bus_->frames(), bytes_per_sample); |
338 | 338 |
339 // Deliver captured data to the client in floating point format | 339 // Deliver captured data to the client in floating point format |
340 // and update the audio-delay measurement. | 340 // and update the audio-delay measurement. |
341 capture_callback_->Capture(audio_bus_.get(), | 341 capture_callback_->Capture(audio_bus_.get(), |
342 audio_delay_milliseconds, volume); | 342 audio_delay_milliseconds, volume); |
343 } | 343 } |
344 | 344 |
345 } // namespace media | 345 } // namespace media |
OLD | NEW |