| 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.h" | 5 #include "content/renderer/pepper/pepper_platform_audio_input.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/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 if (!GetMediaDeviceManager()) | 165 if (!GetMediaDeviceManager()) |
| 166 return false; | 166 return false; |
| 167 | 167 |
| 168 ipc_ = RenderThreadImpl::current() | 168 ipc_ = RenderThreadImpl::current() |
| 169 ->audio_input_message_filter() | 169 ->audio_input_message_filter() |
| 170 ->CreateAudioInputIPC(render_frame->render_view()->GetRoutingID()); | 170 ->CreateAudioInputIPC(render_frame->render_view()->GetRoutingID()); |
| 171 | 171 |
| 172 params_.Reset(media::AudioParameters::AUDIO_PCM_LINEAR, | 172 params_.Reset(media::AudioParameters::AUDIO_PCM_LINEAR, |
| 173 media::CHANNEL_LAYOUT_MONO, | 173 media::CHANNEL_LAYOUT_MONO, |
| 174 ppapi::kAudioInputChannels, | 174 ppapi::kAudioInputChannels, |
| 175 0, | |
| 176 sample_rate, | 175 sample_rate, |
| 177 ppapi::kBitsPerAudioInputSample, | 176 ppapi::kBitsPerAudioInputSample, |
| 178 frames_per_buffer); | 177 frames_per_buffer); |
| 179 | 178 |
| 180 // We need to open the device and obtain the label and session ID before | 179 // We need to open the device and obtain the label and session ID before |
| 181 // initializing. | 180 // initializing. |
| 182 pending_open_device_id_ = GetMediaDeviceManager()->OpenDevice( | 181 pending_open_device_id_ = GetMediaDeviceManager()->OpenDevice( |
| 183 PP_DEVICETYPE_DEV_AUDIOCAPTURE, | 182 PP_DEVICETYPE_DEV_AUDIOCAPTURE, |
| 184 device_id.empty() ? media::AudioManagerBase::kDefaultDeviceId : device_id, | 183 device_id.empty() ? media::AudioManagerBase::kDefaultDeviceId : device_id, |
| 185 document_url, | 184 document_url, |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 PepperMediaDeviceManager* PepperPlatformAudioInput::GetMediaDeviceManager() { | 286 PepperMediaDeviceManager* PepperPlatformAudioInput::GetMediaDeviceManager() { |
| 288 DCHECK(main_message_loop_proxy_->BelongsToCurrentThread()); | 287 DCHECK(main_message_loop_proxy_->BelongsToCurrentThread()); |
| 289 | 288 |
| 290 RenderFrameImpl* const render_frame = | 289 RenderFrameImpl* const render_frame = |
| 291 RenderFrameImpl::FromRoutingID(render_frame_id_); | 290 RenderFrameImpl::FromRoutingID(render_frame_id_); |
| 292 return render_frame ? | 291 return render_frame ? |
| 293 PepperMediaDeviceManager::GetForRenderFrame(render_frame) : NULL; | 292 PepperMediaDeviceManager::GetForRenderFrame(render_frame) : NULL; |
| 294 } | 293 } |
| 295 | 294 |
| 296 } // namespace content | 295 } // namespace content |
| OLD | NEW |