| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 base::AutoLock auto_lock(audio_thread_lock_); | 139 base::AutoLock auto_lock(audio_thread_lock_); |
| 140 // TODO(miu): See TODO in OnStreamCreated method for AudioOutputDevice. | 140 // TODO(miu): See TODO in OnStreamCreated method for AudioOutputDevice. |
| 141 // Interface changes need to be made; likely, after AudioInputDevice is merged | 141 // Interface changes need to be made; likely, after AudioInputDevice is merged |
| 142 // into AudioOutputDevice (http://crbug.com/179597). | 142 // into AudioOutputDevice (http://crbug.com/179597). |
| 143 if (stopping_hack_) | 143 if (stopping_hack_) |
| 144 return; | 144 return; |
| 145 | 145 |
| 146 DCHECK(audio_thread_.IsStopped()); | 146 DCHECK(audio_thread_.IsStopped()); |
| 147 audio_callback_.reset(new AudioInputDevice::AudioThreadCallback( | 147 audio_callback_.reset(new AudioInputDevice::AudioThreadCallback( |
| 148 audio_parameters_, handle, length, total_segments, callback_)); | 148 audio_parameters_, handle, length, total_segments, callback_)); |
| 149 audio_thread_.Start( | 149 audio_thread_.Start("AudioInputDevice", true); |
| 150 audio_callback_.get(), socket_handle, "AudioInputDevice", true); | 150 audio_thread_.Play(audio_callback_.get(), socket_handle); |
| 151 | 151 |
| 152 state_ = RECORDING; | 152 state_ = RECORDING; |
| 153 ipc_->RecordStream(); | 153 ipc_->RecordStream(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void AudioInputDevice::OnVolume(double volume) { | 156 void AudioInputDevice::OnVolume(double volume) { |
| 157 NOTIMPLEMENTED(); | 157 NOTIMPLEMENTED(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 void AudioInputDevice::OnStateChanged( | 160 void AudioInputDevice::OnStateChanged( |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 capture_callback_->Capture( | 340 capture_callback_->Capture( |
| 341 audio_bus, | 341 audio_bus, |
| 342 buffer->params.hardware_delay_bytes / bytes_per_ms_, // Delay in ms | 342 buffer->params.hardware_delay_bytes / bytes_per_ms_, // Delay in ms |
| 343 buffer->params.volume, buffer->params.key_pressed); | 343 buffer->params.volume, buffer->params.key_pressed); |
| 344 | 344 |
| 345 if (++current_segment_id_ >= total_segments_) | 345 if (++current_segment_id_ >= total_segments_) |
| 346 current_segment_id_ = 0; | 346 current_segment_id_ = 0; |
| 347 } | 347 } |
| 348 | 348 |
| 349 } // namespace media | 349 } // namespace media |
| OLD | NEW |