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

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

Issue 1892433002: Moving device description utils from AudioManager[Base] into AudioDeviceDescription; to be shared b… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 4 years, 7 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
« no previous file with comments | « content/renderer/media/audio_renderer_mixer_manager_unittest.cc ('k') | media/audio/BUILD.gn » ('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) 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/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
11 #include "base/thread_task_runner_handle.h" 11 #include "base/thread_task_runner_handle.h"
12 #include "build/build_config.h" 12 #include "build/build_config.h"
13 #include "content/child/child_process.h" 13 #include "content/child/child_process.h"
14 #include "content/renderer/media/audio_input_message_filter.h" 14 #include "content/renderer/media/audio_input_message_filter.h"
15 #include "content/renderer/pepper/pepper_audio_input_host.h" 15 #include "content/renderer/pepper/pepper_audio_input_host.h"
16 #include "content/renderer/pepper/pepper_media_device_manager.h" 16 #include "content/renderer/pepper/pepper_media_device_manager.h"
17 #include "content/renderer/render_frame_impl.h" 17 #include "content/renderer/render_frame_impl.h"
18 #include "content/renderer/render_thread_impl.h" 18 #include "content/renderer/render_thread_impl.h"
19 #include "content/renderer/render_view_impl.h" 19 #include "content/renderer/render_view_impl.h"
20 #include "media/audio/audio_manager_base.h" 20 #include "media/audio/audio_device_description.h"
21 #include "ppapi/shared_impl/ppb_audio_config_shared.h" 21 #include "ppapi/shared_impl/ppb_audio_config_shared.h"
22 #include "url/gurl.h" 22 #include "url/gurl.h"
23 23
24 namespace content { 24 namespace content {
25 25
26 // static 26 // static
27 PepperPlatformAudioInput* PepperPlatformAudioInput::Create( 27 PepperPlatformAudioInput* PepperPlatformAudioInput::Create(
28 int render_frame_id, 28 int render_frame_id,
29 const std::string& device_id, 29 const std::string& device_id,
30 const GURL& document_url, 30 const GURL& document_url,
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 params_.Reset(media::AudioParameters::AUDIO_PCM_LINEAR, 169 params_.Reset(media::AudioParameters::AUDIO_PCM_LINEAR,
170 media::CHANNEL_LAYOUT_MONO, 170 media::CHANNEL_LAYOUT_MONO,
171 sample_rate, 171 sample_rate,
172 ppapi::kBitsPerAudioInputSample, 172 ppapi::kBitsPerAudioInputSample,
173 frames_per_buffer); 173 frames_per_buffer);
174 174
175 // 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
176 // initializing. 176 // initializing.
177 pending_open_device_id_ = GetMediaDeviceManager()->OpenDevice( 177 pending_open_device_id_ = GetMediaDeviceManager()->OpenDevice(
178 PP_DEVICETYPE_DEV_AUDIOCAPTURE, 178 PP_DEVICETYPE_DEV_AUDIOCAPTURE,
179 device_id.empty() ? media::AudioManagerBase::kDefaultDeviceId : device_id, 179 device_id.empty() ? media::AudioDeviceDescription::kDefaultDeviceId
180 : device_id,
180 document_url, 181 document_url,
181 base::Bind(&PepperPlatformAudioInput::OnDeviceOpened, this)); 182 base::Bind(&PepperPlatformAudioInput::OnDeviceOpened, this));
182 pending_open_device_ = true; 183 pending_open_device_ = true;
183 184
184 return true; 185 return true;
185 } 186 }
186 187
187 void PepperPlatformAudioInput::InitializeOnIOThread(int session_id) { 188 void PepperPlatformAudioInput::InitializeOnIOThread(int session_id) {
188 DCHECK(io_task_runner_->BelongsToCurrentThread()); 189 DCHECK(io_task_runner_->BelongsToCurrentThread());
189 190
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 PepperMediaDeviceManager* PepperPlatformAudioInput::GetMediaDeviceManager() { 281 PepperMediaDeviceManager* PepperPlatformAudioInput::GetMediaDeviceManager() {
281 DCHECK(main_task_runner_->BelongsToCurrentThread()); 282 DCHECK(main_task_runner_->BelongsToCurrentThread());
282 283
283 RenderFrameImpl* const render_frame = 284 RenderFrameImpl* const render_frame =
284 RenderFrameImpl::FromRoutingID(render_frame_id_); 285 RenderFrameImpl::FromRoutingID(render_frame_id_);
285 return render_frame ? 286 return render_frame ?
286 PepperMediaDeviceManager::GetForRenderFrame(render_frame).get() : NULL; 287 PepperMediaDeviceManager::GetForRenderFrame(render_frame).get() : NULL;
287 } 288 }
288 289
289 } // namespace content 290 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/audio_renderer_mixer_manager_unittest.cc ('k') | media/audio/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698