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

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

Issue 2060963002: Unmute Tab Audio For Desktop Share By Default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/files/file.h" 10 #include "base/files/file.h"
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 if (!writer->Init()) { 429 if (!writer->Init()) {
430 SendErrorMessage(stream_id, SYNC_WRITER_INIT_FAILED); 430 SendErrorMessage(stream_id, SYNC_WRITER_INIT_FAILED);
431 MaybeUnregisterKeyboardMicStream(config); 431 MaybeUnregisterKeyboardMicStream(config);
432 return; 432 return;
433 } 433 }
434 434
435 // If we have successfully created the SyncWriter then assign it to the 435 // If we have successfully created the SyncWriter then assign it to the
436 // entry and construct an AudioInputController. 436 // entry and construct an AudioInputController.
437 entry->writer.reset(writer.release()); 437 entry->writer.reset(writer.release());
438 if (WebContentsMediaCaptureId::IsWebContentsDeviceId(device_id)) { 438 if (WebContentsMediaCaptureId::IsWebContentsDeviceId(device_id)) {
439 // For MEDIA_DESKTOP_AUDIO_CAPTURE, the source is selected from picker
440 // window, we do not mute the source audio.
441 // For MEDIA_TAB_AUDIO_CAPTURE, the probable use case is Cast, we mute
442 // the source audio.
443 // TODO(qiangchen): Analyze audio constraints to make a duplicating or
444 // diverting decision. It would give web developer more flexibility.
439 entry->controller = media::AudioInputController::CreateForStream( 445 entry->controller = media::AudioInputController::CreateForStream(
440 audio_manager_->GetTaskRunner(), 446 audio_manager_->GetTaskRunner(),
441 this, 447 this,
442 WebContentsAudioInputStream::Create( 448 WebContentsAudioInputStream::Create(
443 device_id, 449 device_id,
444 audio_params, 450 audio_params,
445 audio_manager_->GetWorkerTaskRunner(), 451 audio_manager_->GetWorkerTaskRunner(),
446 audio_mirroring_manager_), 452 audio_mirroring_manager_,
453 type == MEDIA_DESKTOP_AUDIO_CAPTURE),
447 entry->writer.get(), 454 entry->writer.get(),
448 user_input_monitor_); 455 user_input_monitor_);
449 // Only count for captures from desktop media picker dialog. 456 // Only count for captures from desktop media picker dialog.
450 if (entry->controller.get() && type == MEDIA_DESKTOP_AUDIO_CAPTURE) 457 if (entry->controller.get() && type == MEDIA_DESKTOP_AUDIO_CAPTURE)
451 IncrementDesktopCaptureCounter(TAB_AUDIO_CAPTURER_CREATED); 458 IncrementDesktopCaptureCounter(TAB_AUDIO_CAPTURER_CREATED);
452 } else { 459 } else {
453 // We call CreateLowLatency regardless of the value of 460 // We call CreateLowLatency regardless of the value of
454 // |audio_params.format|. Low latency can currently mean different things in 461 // |audio_params.format|. Low latency can currently mean different things in
455 // different parts of the stack. 462 // different parts of the stack.
456 // TODO(grunell): Clean up the low latency terminology so that it's less 463 // TODO(grunell): Clean up the low latency terminology so that it's less
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 if (entry->input_debug_writer.get()) { 736 if (entry->input_debug_writer.get()) {
730 BrowserThread::PostTask( 737 BrowserThread::PostTask(
731 BrowserThread::FILE, FROM_HERE, 738 BrowserThread::FILE, FROM_HERE,
732 base::Bind(&DeleteInputDebugWriterOnFileThread, 739 base::Bind(&DeleteInputDebugWriterOnFileThread,
733 base::Passed(std::move(entry->input_debug_writer)))); 740 base::Passed(std::move(entry->input_debug_writer))));
734 } 741 }
735 } 742 }
736 #endif // defined(ENABLE_WEBRTC) 743 #endif // defined(ENABLE_WEBRTC)
737 744
738 } // namespace content 745 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698