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/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // TODO(miu): See TODO in OnStreamCreated method for AudioOutputDevice. | 135 // TODO(miu): See TODO in OnStreamCreated method for AudioOutputDevice. |
136 // Interface changes need to be made; likely, after AudioInputDevice is merged | 136 // Interface changes need to be made; likely, after AudioInputDevice is merged |
137 // into AudioOutputDevice (http://crbug.com/179597). | 137 // into AudioOutputDevice (http://crbug.com/179597). |
138 if (stopping_hack_) | 138 if (stopping_hack_) |
139 return; | 139 return; |
140 | 140 |
141 DCHECK(audio_thread_.IsStopped()); | 141 DCHECK(audio_thread_.IsStopped()); |
142 audio_callback_.reset(new AudioInputDevice::AudioThreadCallback( | 142 audio_callback_.reset(new AudioInputDevice::AudioThreadCallback( |
143 audio_parameters_, handle, length, total_segments, callback_)); | 143 audio_parameters_, handle, length, total_segments, callback_)); |
144 audio_thread_.Start( | 144 audio_thread_.Start( |
145 audio_callback_.get(), socket_handle, "AudioInputDevice", false); | 145 audio_callback_.get(), socket_handle, "AudioInputDevice", true); |
146 | 146 |
147 state_ = RECORDING; | 147 state_ = RECORDING; |
148 ipc_->RecordStream(); | 148 ipc_->RecordStream(); |
149 } | 149 } |
150 | 150 |
151 void AudioInputDevice::OnVolume(double volume) { | 151 void AudioInputDevice::OnVolume(double volume) { |
152 NOTIMPLEMENTED(); | 152 NOTIMPLEMENTED(); |
153 } | 153 } |
154 | 154 |
155 void AudioInputDevice::OnStateChanged( | 155 void AudioInputDevice::OnStateChanged( |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 audio_bus, | 336 audio_bus, |
337 buffer->params.hardware_delay_bytes / bytes_per_ms_, // Delay in ms | 337 buffer->params.hardware_delay_bytes / bytes_per_ms_, // Delay in ms |
338 buffer->params.volume, | 338 buffer->params.volume, |
339 buffer->params.key_pressed); | 339 buffer->params.key_pressed); |
340 | 340 |
341 if (++current_segment_id_ >= total_segments_) | 341 if (++current_segment_id_ >= total_segments_) |
342 current_segment_id_ = 0; | 342 current_segment_id_ = 0; |
343 } | 343 } |
344 | 344 |
345 } // namespace media | 345 } // namespace media |
OLD | NEW |