Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: content/browser/renderer_host/media/audio_input_renderer_host.cc

Issue 2885173002: Make AudioDebugFileWriter create its own file worker thread. (Closed)
Patch Set: Remove useless include Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 // For MEDIA_TAB_AUDIO_CAPTURE, the probable use case is Cast, we mute 348 // For MEDIA_TAB_AUDIO_CAPTURE, the probable use case is Cast, we mute
349 // the source audio. 349 // the source audio.
350 // TODO(qiangchen): Analyze audio constraints to make a duplicating or 350 // TODO(qiangchen): Analyze audio constraints to make a duplicating or
351 // diverting decision. It would give web developer more flexibility. 351 // diverting decision. It would give web developer more flexibility.
352 entry->controller = media::AudioInputController::CreateForStream( 352 entry->controller = media::AudioInputController::CreateForStream(
353 audio_manager_->GetTaskRunner(), this, 353 audio_manager_->GetTaskRunner(), this,
354 WebContentsAudioInputStream::Create( 354 WebContentsAudioInputStream::Create(
355 device_id, audio_params, audio_manager_->GetWorkerTaskRunner(), 355 device_id, audio_params, audio_manager_->GetWorkerTaskRunner(),
356 audio_mirroring_manager_), 356 audio_mirroring_manager_),
357 entry->writer.get(), user_input_monitor_, 357 entry->writer.get(), user_input_monitor_,
358 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
359 audio_params); 358 audio_params);
360 // Only count for captures from desktop media picker dialog. 359 // Only count for captures from desktop media picker dialog.
361 if (entry->controller.get() && type == MEDIA_DESKTOP_AUDIO_CAPTURE) 360 if (entry->controller.get() && type == MEDIA_DESKTOP_AUDIO_CAPTURE)
362 IncrementDesktopCaptureCounter(TAB_AUDIO_CAPTURER_CREATED); 361 IncrementDesktopCaptureCounter(TAB_AUDIO_CAPTURER_CREATED);
363 } else { 362 } else {
364 entry->controller = media::AudioInputController::Create( 363 entry->controller = media::AudioInputController::Create(
365 audio_manager_, this, entry->writer.get(), user_input_monitor_, 364 audio_manager_, this, entry->writer.get(), user_input_monitor_,
366 audio_params, device_id, config.automatic_gain_control, 365 audio_params, device_id, config.automatic_gain_control);
367 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE));
368 oss << ", AGC=" << config.automatic_gain_control; 366 oss << ", AGC=" << config.automatic_gain_control;
369 367
370 // Only count for captures from desktop media picker dialog and system loop 368 // Only count for captures from desktop media picker dialog and system loop
371 // back audio. 369 // back audio.
372 if (entry->controller.get() && type == MEDIA_DESKTOP_AUDIO_CAPTURE && 370 if (entry->controller.get() && type == MEDIA_DESKTOP_AUDIO_CAPTURE &&
373 (device_id == media::AudioDeviceDescription::kLoopbackInputDeviceId || 371 (device_id == media::AudioDeviceDescription::kLoopbackInputDeviceId ||
374 device_id == 372 device_id ==
375 media::AudioDeviceDescription::kLoopbackWithMuteDeviceId)) { 373 media::AudioDeviceDescription::kLoopbackWithMuteDeviceId)) {
376 IncrementDesktopCaptureCounter(SYSTEM_LOOPBACK_AUDIO_CAPTURER_CREATED); 374 IncrementDesktopCaptureCounter(SYSTEM_LOOPBACK_AUDIO_CAPTURER_CREATED);
377 } 375 }
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 const base::FilePath& file, 594 const base::FilePath& file,
597 int stream_id) { 595 int stream_id) {
598 DCHECK_CURRENTLY_ON(BrowserThread::IO); 596 DCHECK_CURRENTLY_ON(BrowserThread::IO);
599 EnableDebugRecordingForId(GetDebugRecordingFilePathWithExtensions(file), 597 EnableDebugRecordingForId(GetDebugRecordingFilePathWithExtensions(file),
600 stream_id); 598 stream_id);
601 } 599 }
602 600
603 #endif // BUILDFLAG(ENABLE_WEBRTC) 601 #endif // BUILDFLAG(ENABLE_WEBRTC)
604 602
605 } // namespace content 603 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/browser/renderer_host/media/audio_input_renderer_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698