| 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/browser/renderer_host/media/audio_input_renderer_host.h" | 5 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 // For MEDIA_DESKTOP_AUDIO_CAPTURE, the source is selected from picker | 428 // For MEDIA_DESKTOP_AUDIO_CAPTURE, the source is selected from picker |
| 429 // window, we do not mute the source audio. | 429 // window, we do not mute the source audio. |
| 430 // For MEDIA_TAB_AUDIO_CAPTURE, the probable use case is Cast, we mute | 430 // For MEDIA_TAB_AUDIO_CAPTURE, the probable use case is Cast, we mute |
| 431 // the source audio. | 431 // the source audio. |
| 432 // TODO(qiangchen): Analyze audio constraints to make a duplicating or | 432 // TODO(qiangchen): Analyze audio constraints to make a duplicating or |
| 433 // diverting decision. It would give web developer more flexibility. | 433 // diverting decision. It would give web developer more flexibility. |
| 434 entry->controller = media::AudioInputController::CreateForStream( | 434 entry->controller = media::AudioInputController::CreateForStream( |
| 435 audio_manager_->GetTaskRunner(), this, | 435 audio_manager_->GetTaskRunner(), this, |
| 436 WebContentsAudioInputStream::Create( | 436 WebContentsAudioInputStream::Create( |
| 437 device_id, audio_params, audio_manager_->GetWorkerTaskRunner(), | 437 device_id, audio_params, audio_manager_->GetWorkerTaskRunner(), |
| 438 audio_mirroring_manager_, type == MEDIA_DESKTOP_AUDIO_CAPTURE), | 438 audio_mirroring_manager_), |
| 439 entry->writer.get(), user_input_monitor_); | 439 entry->writer.get(), user_input_monitor_); |
| 440 // Only count for captures from desktop media picker dialog. | 440 // Only count for captures from desktop media picker dialog. |
| 441 if (entry->controller.get() && type == MEDIA_DESKTOP_AUDIO_CAPTURE) | 441 if (entry->controller.get() && type == MEDIA_DESKTOP_AUDIO_CAPTURE) |
| 442 IncrementDesktopCaptureCounter(TAB_AUDIO_CAPTURER_CREATED); | 442 IncrementDesktopCaptureCounter(TAB_AUDIO_CAPTURER_CREATED); |
| 443 } else { | 443 } else { |
| 444 // We call CreateLowLatency regardless of the value of | 444 // We call CreateLowLatency regardless of the value of |
| 445 // |audio_params.format|. Low latency can currently mean different things in | 445 // |audio_params.format|. Low latency can currently mean different things in |
| 446 // different parts of the stack. | 446 // different parts of the stack. |
| 447 // TODO(grunell): Clean up the low latency terminology so that it's less | 447 // TODO(grunell): Clean up the low latency terminology so that it's less |
| 448 // confusing. | 448 // confusing. |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 if (entry->input_debug_writer.get()) { | 722 if (entry->input_debug_writer.get()) { |
| 723 BrowserThread::PostTask( | 723 BrowserThread::PostTask( |
| 724 BrowserThread::FILE, FROM_HERE, | 724 BrowserThread::FILE, FROM_HERE, |
| 725 base::Bind(&DeleteInputDebugWriterOnFileThread, | 725 base::Bind(&DeleteInputDebugWriterOnFileThread, |
| 726 base::Passed(std::move(entry->input_debug_writer)))); | 726 base::Passed(std::move(entry->input_debug_writer)))); |
| 727 } | 727 } |
| 728 } | 728 } |
| 729 #endif // defined(ENABLE_WEBRTC) | 729 #endif // defined(ENABLE_WEBRTC) |
| 730 | 730 |
| 731 } // namespace content | 731 } // namespace content |
| OLD | NEW |