Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Side by Side Diff: media/audio/audio_input_device.cc

Issue 11878032: Plumb |input_channels| all the way to AudioManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/audio/audio_device_thread.cc ('k') | media/audio/audio_manager_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 LOG(ERROR) << "IO loop going away before the input device has been stopped"; 296 LOG(ERROR) << "IO loop going away before the input device has been stopped";
297 ShutDownOnIOThread(); 297 ShutDownOnIOThread();
298 } 298 }
299 299
300 // AudioInputDevice::AudioThreadCallback 300 // AudioInputDevice::AudioThreadCallback
301 AudioInputDevice::AudioThreadCallback::AudioThreadCallback( 301 AudioInputDevice::AudioThreadCallback::AudioThreadCallback(
302 const AudioParameters& audio_parameters, 302 const AudioParameters& audio_parameters,
303 base::SharedMemoryHandle memory, 303 base::SharedMemoryHandle memory,
304 int memory_length, 304 int memory_length,
305 CaptureCallback* capture_callback) 305 CaptureCallback* capture_callback)
306 : AudioDeviceThread::Callback(audio_parameters, 0, memory, memory_length), 306 : AudioDeviceThread::Callback(audio_parameters, memory, memory_length),
307 capture_callback_(capture_callback) { 307 capture_callback_(capture_callback) {
308 audio_bus_ = AudioBus::Create(audio_parameters_); 308 audio_bus_ = AudioBus::Create(audio_parameters_);
309 } 309 }
310 310
311 AudioInputDevice::AudioThreadCallback::~AudioThreadCallback() { 311 AudioInputDevice::AudioThreadCallback::~AudioThreadCallback() {
312 } 312 }
313 313
314 void AudioInputDevice::AudioThreadCallback::MapSharedMemory() { 314 void AudioInputDevice::AudioThreadCallback::MapSharedMemory() {
315 shared_memory_.Map(memory_length_); 315 shared_memory_.Map(memory_length_);
316 } 316 }
(...skipping 16 matching lines...) Expand all
333 // with nominal range -1.0 -> +1.0. 333 // with nominal range -1.0 -> +1.0.
334 audio_bus_->FromInterleaved(memory, audio_bus_->frames(), bytes_per_sample); 334 audio_bus_->FromInterleaved(memory, audio_bus_->frames(), bytes_per_sample);
335 335
336 // Deliver captured data to the client in floating point format 336 // Deliver captured data to the client in floating point format
337 // and update the audio-delay measurement. 337 // and update the audio-delay measurement.
338 capture_callback_->Capture(audio_bus_.get(), 338 capture_callback_->Capture(audio_bus_.get(),
339 audio_delay_milliseconds, volume); 339 audio_delay_milliseconds, volume);
340 } 340 }
341 341
342 } // namespace media 342 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/audio_device_thread.cc ('k') | media/audio/audio_manager_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698