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

Side by Side Diff: content/renderer/media/audio_input_device.cc

Issue 8171015: Rename RenderThread to RenderThreadImpl (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | « content/renderer/media/audio_device.cc ('k') | content/renderer/media/audio_renderer_impl.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "content/common/child_process.h" 9 #include "content/common/child_process.h"
10 #include "content/common/media/audio_messages.h" 10 #include "content/common/media/audio_messages.h"
11 #include "content/common/view_messages.h" 11 #include "content/common/view_messages.h"
12 #include "content/renderer/render_thread.h" 12 #include "content/renderer/render_thread_impl.h"
13 #include "media/audio/audio_util.h" 13 #include "media/audio/audio_util.h"
14 14
15 AudioInputDevice::AudioInputDevice(size_t buffer_size, 15 AudioInputDevice::AudioInputDevice(size_t buffer_size,
16 int channels, 16 int channels,
17 double sample_rate, 17 double sample_rate,
18 CaptureCallback* callback, 18 CaptureCallback* callback,
19 CaptureEventHandler* event_handler) 19 CaptureEventHandler* event_handler)
20 : callback_(callback), 20 : callback_(callback),
21 event_handler_(event_handler), 21 event_handler_(event_handler),
22 audio_delay_milliseconds_(0), 22 audio_delay_milliseconds_(0),
23 volume_(1.0), 23 volume_(1.0),
24 stream_id_(0), 24 stream_id_(0),
25 session_id_(0), 25 session_id_(0),
26 pending_device_ready_(false) { 26 pending_device_ready_(false) {
27 filter_ = RenderThread::current()->audio_input_message_filter(); 27 filter_ = RenderThreadImpl::current()->audio_input_message_filter();
28 audio_data_.reserve(channels); 28 audio_data_.reserve(channels);
29 #if defined(OS_MACOSX) 29 #if defined(OS_MACOSX)
30 VLOG(1) << "Using AUDIO_PCM_LOW_LATENCY as input mode on Mac OS X."; 30 VLOG(1) << "Using AUDIO_PCM_LOW_LATENCY as input mode on Mac OS X.";
31 audio_parameters_.format = AudioParameters::AUDIO_PCM_LOW_LATENCY; 31 audio_parameters_.format = AudioParameters::AUDIO_PCM_LOW_LATENCY;
32 #else 32 #else
33 audio_parameters_.format = AudioParameters::AUDIO_PCM_LINEAR; 33 audio_parameters_.format = AudioParameters::AUDIO_PCM_LINEAR;
34 #endif 34 #endif
35 audio_parameters_.channels = channels; 35 audio_parameters_.channels = channels;
36 audio_parameters_.sample_rate = static_cast<int>(sample_rate); 36 audio_parameters_.sample_rate = static_cast<int>(sample_rate);
37 audio_parameters_.bits_per_sample = 16; 37 audio_parameters_.bits_per_sample = 16;
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 bytes_per_sample, 314 bytes_per_sample,
315 number_of_frames); 315 number_of_frames);
316 } 316 }
317 317
318 // Deliver captured data to the client in floating point format 318 // Deliver captured data to the client in floating point format
319 // and update the audio-delay measurement. 319 // and update the audio-delay measurement.
320 callback_->Capture(audio_data_, 320 callback_->Capture(audio_data_,
321 number_of_frames, 321 number_of_frames,
322 audio_delay_milliseconds_); 322 audio_delay_milliseconds_);
323 } 323 }
OLDNEW
« no previous file with comments | « content/renderer/media/audio_device.cc ('k') | content/renderer/media/audio_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698