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/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
11 #include "base/time.h" | 11 #include "base/time/time.h" |
12 #include "media/audio/audio_manager_base.h" | 12 #include "media/audio/audio_manager_base.h" |
13 #include "media/base/audio_bus.h" | 13 #include "media/base/audio_bus.h" |
14 | 14 |
15 namespace media { | 15 namespace media { |
16 | 16 |
17 // The number of shared memory buffer segments indicated to browser process | 17 // The number of shared memory buffer segments indicated to browser process |
18 // in order to avoid data overwriting. This number can be any positive number, | 18 // in order to avoid data overwriting. This number can be any positive number, |
19 // dependent how fast the renderer process can pick up captured data from | 19 // dependent how fast the renderer process can pick up captured data from |
20 // shared memory. | 20 // shared memory. |
21 static const int kRequestedSharedMemoryCount = 10; | 21 static const int kRequestedSharedMemoryCount = 10; |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 // with nominal range -1.0 -> +1.0. | 306 // with nominal range -1.0 -> +1.0. |
307 audio_bus_->FromInterleaved(memory, audio_bus_->frames(), bytes_per_sample); | 307 audio_bus_->FromInterleaved(memory, audio_bus_->frames(), bytes_per_sample); |
308 | 308 |
309 // Deliver captured data to the client in floating point format | 309 // Deliver captured data to the client in floating point format |
310 // and update the audio-delay measurement. | 310 // and update the audio-delay measurement. |
311 capture_callback_->Capture(audio_bus_.get(), | 311 capture_callback_->Capture(audio_bus_.get(), |
312 audio_delay_milliseconds, volume); | 312 audio_delay_milliseconds, volume); |
313 } | 313 } |
314 | 314 |
315 } // namespace media | 315 } // namespace media |
OLD | NEW |