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. |