| 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 "content/renderer/media/audio_input_device.h" | 5 #include "content/renderer/media/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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 bool AudioInputDevice::SetVolume(double volume) { | 79 bool AudioInputDevice::SetVolume(double volume) { |
| 80 if (volume < 0 || volume > 1.0) | 80 if (volume < 0 || volume > 1.0) |
| 81 return false; | 81 return false; |
| 82 | 82 |
| 83 message_loop()->PostTask(FROM_HERE, | 83 message_loop()->PostTask(FROM_HERE, |
| 84 base::Bind(&AudioInputDevice::SetVolumeOnIOThread, this, volume)); | 84 base::Bind(&AudioInputDevice::SetVolumeOnIOThread, this, volume)); |
| 85 | 85 |
| 86 return true; | 86 return true; |
| 87 } | 87 } |
| 88 | 88 |
| 89 bool AudioInputDevice::GetVolume(double* volume) { | |
| 90 NOTREACHED(); | |
| 91 return false; | |
| 92 } | |
| 93 | |
| 94 void AudioInputDevice::SetAutomaticGainControl(bool enabled) { | 89 void AudioInputDevice::SetAutomaticGainControl(bool enabled) { |
| 95 DVLOG(1) << "SetAutomaticGainControl(enabled=" << enabled << ")"; | 90 DVLOG(1) << "SetAutomaticGainControl(enabled=" << enabled << ")"; |
| 96 message_loop()->PostTask(FROM_HERE, | 91 message_loop()->PostTask(FROM_HERE, |
| 97 base::Bind(&AudioInputDevice::SetAutomaticGainControlOnIOThread, | 92 base::Bind(&AudioInputDevice::SetAutomaticGainControlOnIOThread, |
| 98 this, enabled)); | 93 this, enabled)); |
| 99 } | 94 } |
| 100 | 95 |
| 101 void AudioInputDevice::OnStreamCreated( | 96 void AudioInputDevice::OnStreamCreated( |
| 102 base::SharedMemoryHandle handle, | 97 base::SharedMemoryHandle handle, |
| 103 base::SyncSocket::Handle socket_handle, | 98 base::SyncSocket::Handle socket_handle, |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 channel_index, | 333 channel_index, |
| 339 bytes_per_sample, | 334 bytes_per_sample, |
| 340 number_of_frames); | 335 number_of_frames); |
| 341 } | 336 } |
| 342 | 337 |
| 343 // Deliver captured data to the client in floating point format | 338 // Deliver captured data to the client in floating point format |
| 344 // and update the audio-delay measurement. | 339 // and update the audio-delay measurement. |
| 345 capture_callback_->Capture(audio_data_, number_of_frames, | 340 capture_callback_->Capture(audio_data_, number_of_frames, |
| 346 audio_delay_milliseconds, volume); | 341 audio_delay_milliseconds, volume); |
| 347 } | 342 } |
| OLD | NEW |