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

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

Issue 10830268: Allow audio system to handle synchronized low-latency audio I/O (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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
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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 LOG(ERROR) << "IO loop going away before the input device has been stopped"; 299 LOG(ERROR) << "IO loop going away before the input device has been stopped";
300 ShutDownOnIOThread(); 300 ShutDownOnIOThread();
301 } 301 }
302 302
303 // AudioInputDevice::AudioThreadCallback 303 // AudioInputDevice::AudioThreadCallback
304 AudioInputDevice::AudioThreadCallback::AudioThreadCallback( 304 AudioInputDevice::AudioThreadCallback::AudioThreadCallback(
305 const AudioParameters& audio_parameters, 305 const AudioParameters& audio_parameters,
306 base::SharedMemoryHandle memory, 306 base::SharedMemoryHandle memory,
307 int memory_length, 307 int memory_length,
308 CaptureCallback* capture_callback) 308 CaptureCallback* capture_callback)
309 : AudioDeviceThread::Callback(audio_parameters, memory, memory_length), 309 : AudioDeviceThread::Callback(audio_parameters, 0, memory, memory_length),
tommi (sloooow) - chröme 2012/09/07 09:58:19 It is a bit odd that the AudioInputDevice class pa
Chris Rogers 2012/09/07 20:34:01 When I first created the AudioDevice class, I had
310 capture_callback_(capture_callback) { 310 capture_callback_(capture_callback) {
311 audio_bus_ = AudioBus::Create(audio_parameters_); 311 audio_bus_ = AudioBus::Create(audio_parameters_);
312 } 312 }
313 313
314 AudioInputDevice::AudioThreadCallback::~AudioThreadCallback() { 314 AudioInputDevice::AudioThreadCallback::~AudioThreadCallback() {
315 } 315 }
316 316
317 void AudioInputDevice::AudioThreadCallback::MapSharedMemory() { 317 void AudioInputDevice::AudioThreadCallback::MapSharedMemory() {
318 shared_memory_.Map(memory_length_); 318 shared_memory_.Map(memory_length_);
319 } 319 }
(...skipping 16 matching lines...) Expand all
336 // with nominal range -1.0 -> +1.0. 336 // with nominal range -1.0 -> +1.0.
337 audio_bus_->FromInterleaved(memory, audio_bus_->frames(), bytes_per_sample); 337 audio_bus_->FromInterleaved(memory, audio_bus_->frames(), bytes_per_sample);
338 338
339 // Deliver captured data to the client in floating point format 339 // Deliver captured data to the client in floating point format
340 // and update the audio-delay measurement. 340 // and update the audio-delay measurement.
341 capture_callback_->Capture(audio_bus_.get(), 341 capture_callback_->Capture(audio_bus_.get(),
342 audio_delay_milliseconds, volume); 342 audio_delay_milliseconds, volume);
343 } 343 }
344 344
345 } // namespace media 345 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698