| 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 WebContentsMediaCaptureId media_id; |
| 354 int render_process_id; | 354 if (!WebContentsMediaCaptureId::Parse(device_id, &media_id)) { |
| 355 int main_render_frame_id; | |
| 356 if (!WebContentsMediaCaptureId::ExtractTabCaptureTarget( | |
| 357 device_id, &render_process_id, &main_render_frame_id)) { | |
| 358 return NULL; | 355 return NULL; |
| 359 } | 356 } |
| 360 | 357 |
| 361 return new WebContentsAudioInputStream( | 358 return new WebContentsAudioInputStream( |
| 362 render_process_id, main_render_frame_id, audio_mirroring_manager, | 359 media_id.render_process_id, media_id.main_render_frame_id, |
| 363 new WebContentsTracker(false), | 360 audio_mirroring_manager, new WebContentsTracker(false), |
| 364 new media::VirtualAudioInputStream( | 361 new media::VirtualAudioInputStream( |
| 365 params, worker_task_runner, | 362 params, worker_task_runner, |
| 366 media::VirtualAudioInputStream::AfterCloseCallback()), | 363 media::VirtualAudioInputStream::AfterCloseCallback()), |
| 367 is_duplication); | 364 !media_id.disable_local_echo); |
| 368 } | 365 } |
| 369 | 366 |
| 370 WebContentsAudioInputStream::WebContentsAudioInputStream( | 367 WebContentsAudioInputStream::WebContentsAudioInputStream( |
| 371 int render_process_id, | 368 int render_process_id, |
| 372 int main_render_frame_id, | 369 int main_render_frame_id, |
| 373 AudioMirroringManager* mirroring_manager, | 370 AudioMirroringManager* mirroring_manager, |
| 374 const scoped_refptr<WebContentsTracker>& tracker, | 371 const scoped_refptr<WebContentsTracker>& tracker, |
| 375 media::VirtualAudioInputStream* mixer_stream, | 372 media::VirtualAudioInputStream* mixer_stream, |
| 376 bool is_duplication) | 373 bool is_duplication) |
| 377 : impl_(new Impl(render_process_id, | 374 : impl_(new Impl(render_process_id, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 | 415 |
| 419 bool WebContentsAudioInputStream::GetAutomaticGainControl() { | 416 bool WebContentsAudioInputStream::GetAutomaticGainControl() { |
| 420 return impl_->mixer_stream()->GetAutomaticGainControl(); | 417 return impl_->mixer_stream()->GetAutomaticGainControl(); |
| 421 } | 418 } |
| 422 | 419 |
| 423 bool WebContentsAudioInputStream::IsMuted() { | 420 bool WebContentsAudioInputStream::IsMuted() { |
| 424 return false; | 421 return false; |
| 425 } | 422 } |
| 426 | 423 |
| 427 } // namespace content | 424 } // namespace content |
| OLD | NEW |