| 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 "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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 DCHECK(main_message_loop_proxy_->BelongsToCurrentThread()); | 155 DCHECK(main_message_loop_proxy_->BelongsToCurrentThread()); |
| 156 | 156 |
| 157 if (!plugin_delegate || !client) | 157 if (!plugin_delegate || !client) |
| 158 return false; | 158 return false; |
| 159 | 159 |
| 160 plugin_delegate_ = plugin_delegate; | 160 plugin_delegate_ = plugin_delegate; |
| 161 render_view_id_ = plugin_delegate_->GetRoutingID(); | 161 render_view_id_ = plugin_delegate_->GetRoutingID(); |
| 162 client_ = client; | 162 client_ = client; |
| 163 | 163 |
| 164 params_.Reset(media::AudioParameters::AUDIO_PCM_LINEAR, | 164 params_.Reset(media::AudioParameters::AUDIO_PCM_LINEAR, |
| 165 media::CHANNEL_LAYOUT_MONO, sample_rate, 16, frames_per_buffer); | 165 media::CHANNEL_LAYOUT_MONO, 0, |
| 166 sample_rate, 16, frames_per_buffer); |
| 166 | 167 |
| 167 if (device_id.empty()) { | 168 if (device_id.empty()) { |
| 168 // Use the default device. | 169 // Use the default device. |
| 169 ChildProcess::current()->io_message_loop()->PostTask( | 170 ChildProcess::current()->io_message_loop()->PostTask( |
| 170 FROM_HERE, | 171 FROM_HERE, |
| 171 base::Bind(&PepperPlatformAudioInputImpl::InitializeOnIOThread, | 172 base::Bind(&PepperPlatformAudioInputImpl::InitializeOnIOThread, |
| 172 this, 0)); | 173 this, 0)); |
| 173 } else { | 174 } else { |
| 174 // We need to open the device and obtain the label and session ID before | 175 // We need to open the device and obtain the label and session ID before |
| 175 // initializing. | 176 // initializing. |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 280 } |
| 280 | 281 |
| 281 void PepperPlatformAudioInputImpl::NotifyStreamCreationFailed() { | 282 void PepperPlatformAudioInputImpl::NotifyStreamCreationFailed() { |
| 282 DCHECK(main_message_loop_proxy_->BelongsToCurrentThread()); | 283 DCHECK(main_message_loop_proxy_->BelongsToCurrentThread()); |
| 283 | 284 |
| 284 if (client_) | 285 if (client_) |
| 285 client_->StreamCreationFailed(); | 286 client_->StreamCreationFailed(); |
| 286 } | 287 } |
| 287 | 288 |
| 288 } // namespace content | 289 } // namespace content |
| OLD | NEW |