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

Side by Side Diff: content/renderer/pepper/pepper_platform_audio_input_impl.cc

Issue 9691001: Audio software mixer. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 9 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 "content/renderer/pepper/pepper_platform_audio_input_impl.h" 5 #include "content/renderer/pepper/pepper_platform_audio_input_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 int frames_per_buffer, 86 int frames_per_buffer,
87 webkit::ppapi::PluginDelegate::PlatformAudioInputClient* client) { 87 webkit::ppapi::PluginDelegate::PlatformAudioInputClient* client) {
88 DCHECK(main_message_loop_proxy_->BelongsToCurrentThread()); 88 DCHECK(main_message_loop_proxy_->BelongsToCurrentThread());
89 89
90 if (!plugin_delegate || !client) 90 if (!plugin_delegate || !client)
91 return false; 91 return false;
92 92
93 plugin_delegate_ = plugin_delegate; 93 plugin_delegate_ = plugin_delegate;
94 client_ = client; 94 client_ = client;
95 95
96 params_.Reset(AudioParameters::AUDIO_PCM_LINEAR, CHANNEL_LAYOUT_MONO, 96 params_.Reset(AudioParameters::AUDIO_PCM_LINEAR, false,
97 CHANNEL_LAYOUT_MONO,
97 sample_rate, 16, frames_per_buffer); 98 sample_rate, 16, frames_per_buffer);
98 99
99 if (device_id.empty()) { 100 if (device_id.empty()) {
100 // Use the default device. 101 // Use the default device.
101 ChildProcess::current()->io_message_loop()->PostTask( 102 ChildProcess::current()->io_message_loop()->PostTask(
102 FROM_HERE, 103 FROM_HERE,
103 base::Bind(&PepperPlatformAudioInputImpl::InitializeOnIOThread, 104 base::Bind(&PepperPlatformAudioInputImpl::InitializeOnIOThread,
104 this, 0)); 105 this, 0));
105 } else { 106 } else {
106 // We need to open the device and obtain the label and session ID before 107 // We need to open the device and obtain the label and session ID before
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 label_.clear(); 267 label_.clear();
267 } 268 }
268 } 269 }
269 270
270 void PepperPlatformAudioInputImpl::NotifyStreamCreationFailed() { 271 void PepperPlatformAudioInputImpl::NotifyStreamCreationFailed() {
271 DCHECK(main_message_loop_proxy_->BelongsToCurrentThread()); 272 DCHECK(main_message_loop_proxy_->BelongsToCurrentThread());
272 273
273 if (client_) 274 if (client_)
274 client_->StreamCreationFailed(); 275 client_->StreamCreationFailed();
275 } 276 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698