| 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/media/capture/web_contents_audio_input_stream.h" | 5 #include "content/browser/media/capture/web_contents_audio_input_stream.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 StartMirroring(); | 342 StartMirroring(); |
| 343 } | 343 } |
| 344 } | 344 } |
| 345 } | 345 } |
| 346 | 346 |
| 347 // static | 347 // static |
| 348 WebContentsAudioInputStream* WebContentsAudioInputStream::Create( | 348 WebContentsAudioInputStream* WebContentsAudioInputStream::Create( |
| 349 const std::string& device_id, | 349 const std::string& device_id, |
| 350 const media::AudioParameters& params, | 350 const media::AudioParameters& params, |
| 351 const scoped_refptr<base::SingleThreadTaskRunner>& worker_task_runner, | 351 const scoped_refptr<base::SingleThreadTaskRunner>& worker_task_runner, |
| 352 AudioMirroringManager* audio_mirroring_manager) { | 352 AudioMirroringManager* audio_mirroring_manager, |
| 353 bool is_duplication) { |
| 353 int render_process_id; | 354 int render_process_id; |
| 354 int main_render_frame_id; | 355 int main_render_frame_id; |
| 355 if (!WebContentsMediaCaptureId::ExtractTabCaptureTarget( | 356 if (!WebContentsMediaCaptureId::ExtractTabCaptureTarget( |
| 356 device_id, &render_process_id, &main_render_frame_id)) { | 357 device_id, &render_process_id, &main_render_frame_id)) { |
| 357 return NULL; | 358 return NULL; |
| 358 } | 359 } |
| 359 | 360 |
| 360 // TODO(qiangchen): Plug in true for the case of Tab Typed Desktop Share. | |
| 361 return new WebContentsAudioInputStream( | 361 return new WebContentsAudioInputStream( |
| 362 render_process_id, main_render_frame_id, audio_mirroring_manager, | 362 render_process_id, main_render_frame_id, audio_mirroring_manager, |
| 363 new WebContentsTracker(false), | 363 new WebContentsTracker(false), |
| 364 new media::VirtualAudioInputStream( | 364 new media::VirtualAudioInputStream( |
| 365 params, worker_task_runner, | 365 params, worker_task_runner, |
| 366 media::VirtualAudioInputStream::AfterCloseCallback()), | 366 media::VirtualAudioInputStream::AfterCloseCallback()), |
| 367 false); | 367 is_duplication); |
| 368 } | 368 } |
| 369 | 369 |
| 370 WebContentsAudioInputStream::WebContentsAudioInputStream( | 370 WebContentsAudioInputStream::WebContentsAudioInputStream( |
| 371 int render_process_id, | 371 int render_process_id, |
| 372 int main_render_frame_id, | 372 int main_render_frame_id, |
| 373 AudioMirroringManager* mirroring_manager, | 373 AudioMirroringManager* mirroring_manager, |
| 374 const scoped_refptr<WebContentsTracker>& tracker, | 374 const scoped_refptr<WebContentsTracker>& tracker, |
| 375 media::VirtualAudioInputStream* mixer_stream, | 375 media::VirtualAudioInputStream* mixer_stream, |
| 376 bool is_duplication) | 376 bool is_duplication) |
| 377 : impl_(new Impl(render_process_id, | 377 : impl_(new Impl(render_process_id, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 | 418 |
| 419 bool WebContentsAudioInputStream::GetAutomaticGainControl() { | 419 bool WebContentsAudioInputStream::GetAutomaticGainControl() { |
| 420 return impl_->mixer_stream()->GetAutomaticGainControl(); | 420 return impl_->mixer_stream()->GetAutomaticGainControl(); |
| 421 } | 421 } |
| 422 | 422 |
| 423 bool WebContentsAudioInputStream::IsMuted() { | 423 bool WebContentsAudioInputStream::IsMuted() { |
| 424 return false; | 424 return false; |
| 425 } | 425 } |
| 426 | 426 |
| 427 } // namespace content | 427 } // namespace content |
| OLD | NEW |