| Index: content/browser/browser_main_loop.cc
|
| diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
|
| index bf849b7102faea1e3a43481ba86002731013d640..ee0827b1c46d850404be0a150020d5e6def3b787 100644
|
| --- a/content/browser/browser_main_loop.cc
|
| +++ b/content/browser/browser_main_loop.cc
|
| @@ -95,6 +95,7 @@
|
| #include "media/audio/audio_system_impl.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"
|
| @@ -163,7 +164,9 @@
|
|
|
| #if defined(OS_CHROMEOS)
|
| #include "base/memory/memory_pressure_monitor_chromeos.h"
|
| +#include "chromeos/audio/cras_audio_handler.h"
|
| #include "chromeos/chromeos_switches.h"
|
| +#include "media/capture/video/linux/video_capture_observer_chromeos.h"
|
| #endif
|
|
|
| #if defined(USE_GLIB)
|
| @@ -1164,6 +1167,20 @@ 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(
|
| + base::MakeUnique<media::VideoCaptureObserverChromeOS>(
|
| + chromeos::CrasAudioHandler::Get()));
|
| + } 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.
|
| @@ -1213,6 +1230,7 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
|
| if (parts_) {
|
| TRACE_EVENT0("shutdown",
|
| "BrowserMainLoop::Subsystem:PostMainMessageLoopRun");
|
| + media_stream_manager_->SetVideoCaptureObserver(nullptr);
|
| parts_->PostMainMessageLoopRun();
|
| }
|
|
|
|
|