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