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

Unified Diff: content/browser/browser_main_loop.cc

Issue 2634263002: Pass camera facing info to audio client (Closed)
Patch Set: refactor to pass VideoCaptureObserver in setters, not in ctor Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index d6d917b4c3f3ac7a90f23333b621bec4cf94a67f..77c04511c1b8e92f4236aa1ad683585f420752ce 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -94,6 +94,7 @@
#include "device/gamepad/gamepad_service.h"
#include "media/base/media.h"
#include "media/base/user_input_monitor.h"
+#include "media/base/video_facing.h"
#include "media/midi/midi_service.h"
#include "mojo/edk/embedder/embedder.h"
#include "mojo/edk/embedder/scoped_ipc_support.h"
@@ -162,6 +163,7 @@
#if defined(OS_CHROMEOS)
#include "base/memory/memory_pressure_monitor_chromeos.h"
+#include "chromeos/audio/cras_audio_handler.h"
#include "chromeos/chromeos_switches.h"
#endif
@@ -1157,6 +1159,21 @@ int BrowserMainLoop::PreMainMessageLoopRun() {
"BrowserMainLoop::CreateThreads:PreMainMessageLoopRun");
parts_->PreMainMessageLoopRun();
+
+#if defined(OS_CHROMEOS)
+ if (chromeos::CrasAudioHandler::IsInitialized()) {
+ if (media_stream_manager_.get() != NULL) {
+ media_stream_manager_->SetVideoCaptureObserver(
+ new media::VideoCaptureObserver(
chfremer1 2017/01/25 18:13:44 Similar to the issue we had in the previous PatchS
shenghao 2017/01/29 10:21:01 Done.
+ static_cast<chromeos::VideoCaptureObserver*>(
+ chromeos::CrasAudioHandler::Get())));
chfremer1 2017/01/25 18:13:44 Can we guarantee that the CrasAudioHandler instanc
shenghao 2017/01/29 10:21:01 Nope, CrasAudioHandler is deleted in PostMainMessa
+ } else {
+ DLOG(ERROR) << "media_stream_manager_ is null.";
+ }
+ } else {
+ DLOG(ERROR) << "CrasAudioHandler is not initialized.";
+ }
+#endif
}
// If the UI thread blocks, the whole UI is unresponsive.

Powered by Google App Engine
This is Rietveld 408576698