OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser/renderer_host/media/web_contents_audio_input_stream.h" | 5 #include "content/browser/renderer_host/media/web_contents_audio_input_stream.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 } else { | 274 } else { |
275 StartMirroring(); | 275 StartMirroring(); |
276 } | 276 } |
277 } | 277 } |
278 } | 278 } |
279 | 279 |
280 // static | 280 // static |
281 WebContentsAudioInputStream* WebContentsAudioInputStream::Create( | 281 WebContentsAudioInputStream* WebContentsAudioInputStream::Create( |
282 const std::string& device_id, | 282 const std::string& device_id, |
283 const media::AudioParameters& params, | 283 const media::AudioParameters& params, |
284 const scoped_refptr<base::MessageLoopProxy>& worker_loop, | 284 const scoped_refptr<base::SingleThreadTaskRunner>& worker_task_runner, |
285 AudioMirroringManager* audio_mirroring_manager) { | 285 AudioMirroringManager* audio_mirroring_manager) { |
286 int render_process_id; | 286 int render_process_id; |
287 int render_view_id; | 287 int render_view_id; |
288 if (!WebContentsCaptureUtil::ExtractTabCaptureTarget( | 288 if (!WebContentsCaptureUtil::ExtractTabCaptureTarget( |
289 device_id, &render_process_id, &render_view_id)) { | 289 device_id, &render_process_id, &render_view_id)) { |
290 return NULL; | 290 return NULL; |
291 } | 291 } |
292 | 292 |
293 return new WebContentsAudioInputStream( | 293 return new WebContentsAudioInputStream( |
294 render_process_id, render_view_id, | 294 render_process_id, render_view_id, |
295 audio_mirroring_manager, | 295 audio_mirroring_manager, |
296 new WebContentsTracker(), | 296 new WebContentsTracker(), |
297 new media::VirtualAudioInputStream( | 297 new media::VirtualAudioInputStream( |
298 params, worker_loop, | 298 params, worker_task_runner, |
299 media::VirtualAudioInputStream::AfterCloseCallback())); | 299 media::VirtualAudioInputStream::AfterCloseCallback())); |
300 } | 300 } |
301 | 301 |
302 WebContentsAudioInputStream::WebContentsAudioInputStream( | 302 WebContentsAudioInputStream::WebContentsAudioInputStream( |
303 int render_process_id, int render_view_id, | 303 int render_process_id, int render_view_id, |
304 AudioMirroringManager* mirroring_manager, | 304 AudioMirroringManager* mirroring_manager, |
305 const scoped_refptr<WebContentsTracker>& tracker, | 305 const scoped_refptr<WebContentsTracker>& tracker, |
306 media::VirtualAudioInputStream* mixer_stream) | 306 media::VirtualAudioInputStream* mixer_stream) |
307 : impl_(new Impl(render_process_id, render_view_id, | 307 : impl_(new Impl(render_process_id, render_view_id, |
308 mirroring_manager, tracker, mixer_stream)) {} | 308 mirroring_manager, tracker, mixer_stream)) {} |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 340 |
341 void WebContentsAudioInputStream::SetAutomaticGainControl(bool enabled) { | 341 void WebContentsAudioInputStream::SetAutomaticGainControl(bool enabled) { |
342 impl_->mixer_stream()->SetAutomaticGainControl(enabled); | 342 impl_->mixer_stream()->SetAutomaticGainControl(enabled); |
343 } | 343 } |
344 | 344 |
345 bool WebContentsAudioInputStream::GetAutomaticGainControl() { | 345 bool WebContentsAudioInputStream::GetAutomaticGainControl() { |
346 return impl_->mixer_stream()->GetAutomaticGainControl(); | 346 return impl_->mixer_stream()->GetAutomaticGainControl(); |
347 } | 347 } |
348 | 348 |
349 } // namespace content | 349 } // namespace content |
OLD | NEW |