| 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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 entry->controller = media::AudioInputController::CreateForStream( | 361 entry->controller = media::AudioInputController::CreateForStream( |
| 362 audio_manager_->GetTaskRunner(), this, | 362 audio_manager_->GetTaskRunner(), this, |
| 363 WebContentsAudioInputStream::Create( | 363 WebContentsAudioInputStream::Create( |
| 364 device_id, audio_params, audio_manager_->GetWorkerTaskRunner(), | 364 device_id, audio_params, audio_manager_->GetWorkerTaskRunner(), |
| 365 audio_mirroring_manager_), | 365 audio_mirroring_manager_), |
| 366 entry->writer.get(), std::move(debug_writer), user_input_monitor_); | 366 entry->writer.get(), std::move(debug_writer), user_input_monitor_); |
| 367 // Only count for captures from desktop media picker dialog. | 367 // Only count for captures from desktop media picker dialog. |
| 368 if (entry->controller.get() && type == MEDIA_DESKTOP_AUDIO_CAPTURE) | 368 if (entry->controller.get() && type == MEDIA_DESKTOP_AUDIO_CAPTURE) |
| 369 IncrementDesktopCaptureCounter(TAB_AUDIO_CAPTURER_CREATED); | 369 IncrementDesktopCaptureCounter(TAB_AUDIO_CAPTURER_CREATED); |
| 370 } else { | 370 } else { |
| 371 // We call CreateLowLatency regardless of the value of | 371 entry->controller = media::AudioInputController::Create( |
| 372 // |audio_params.format|. Low latency can currently mean different things in | 372 audio_manager_, this, entry->writer.get(), user_input_monitor_, |
| 373 // different parts of the stack. | 373 std::move(debug_writer), audio_params, device_id, |
| 374 // TODO(grunell): Clean up the low latency terminology so that it's less | |
| 375 // confusing. | |
| 376 entry->controller = media::AudioInputController::CreateLowLatency( | |
| 377 audio_manager_, this, audio_params, device_id, entry->writer.get(), | |
| 378 std::move(debug_writer), user_input_monitor_, | |
| 379 config.automatic_gain_control); | 374 config.automatic_gain_control); |
| 380 oss << ", AGC=" << config.automatic_gain_control; | 375 oss << ", AGC=" << config.automatic_gain_control; |
| 381 | 376 |
| 382 // Only count for captures from desktop media picker dialog and system loop | 377 // Only count for captures from desktop media picker dialog and system loop |
| 383 // back audio. | 378 // back audio. |
| 384 if (entry->controller.get() && type == MEDIA_DESKTOP_AUDIO_CAPTURE && | 379 if (entry->controller.get() && type == MEDIA_DESKTOP_AUDIO_CAPTURE && |
| 385 (device_id == media::AudioDeviceDescription::kLoopbackInputDeviceId || | 380 (device_id == media::AudioDeviceDescription::kLoopbackInputDeviceId || |
| 386 device_id == | 381 device_id == |
| 387 media::AudioDeviceDescription::kLoopbackWithMuteDeviceId)) { | 382 media::AudioDeviceDescription::kLoopbackWithMuteDeviceId)) { |
| 388 IncrementDesktopCaptureCounter(SYSTEM_LOOPBACK_AUDIO_CAPTURER_CREATED); | 383 IncrementDesktopCaptureCounter(SYSTEM_LOOPBACK_AUDIO_CAPTURER_CREATED); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 entry->controller->EnableDebugRecording( | 595 entry->controller->EnableDebugRecording( |
| 601 file_name.AddExtension(IntToStringType(stream_id)) | 596 file_name.AddExtension(IntToStringType(stream_id)) |
| 602 .AddExtension(kDebugRecordingFileNameExtension)); | 597 .AddExtension(kDebugRecordingFileNameExtension)); |
| 603 } | 598 } |
| 604 | 599 |
| 605 #undef IntToStringType | 600 #undef IntToStringType |
| 606 | 601 |
| 607 #endif // BUILDFLAG(ENABLE_WEBRTC) | 602 #endif // BUILDFLAG(ENABLE_WEBRTC) |
| 608 | 603 |
| 609 } // namespace content | 604 } // namespace content |
| OLD | NEW |