diff options
-rw-r--r-- | media/base/media_switches.cc | 7 | ||||
-rw-r--r-- | media/base/media_switches.h | 1 | ||||
-rw-r--r-- | media/video/capture/mac/avfoundation_glue.mm | 6 |
3 files changed, 13 insertions, 1 deletions
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc index 8ae41eb..4e75216 100644 --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc @@ -56,6 +56,13 @@ const char kAlsaOutputDevice[] = "alsa-output-device"; // tested. See http://crbug.com/158170. // TODO(dalecurtis): Remove this once we're sure nothing has exploded. const char kDisableMainThreadAudio[] = "disable-main-thread-audio"; +// AVFoundation is available in versions 10.7 and onwards, and is to be used +// http://crbug.com/288562 for both audio and video device monitoring and for +// video capture. Being a dynamically loaded NSBundle and library, it hits the +// Chrome startup time (http://crbug.com/311325 and http://crbug.com/311437); +// until development is finished and the library load time issue is solved, the +// usage of this library is hidden behind this flag. +const char kEnableAVFoundation[] = "enable-avfoundation"; #endif #if defined(OS_WIN) diff --git a/media/base/media_switches.h b/media/base/media_switches.h index feb65c4..69fb10e 100644 --- a/media/base/media_switches.h +++ b/media/base/media_switches.h @@ -40,6 +40,7 @@ MEDIA_EXPORT extern const char kAlsaOutputDevice[]; #if defined(OS_MACOSX) MEDIA_EXPORT extern const char kDisableMainThreadAudio[]; +MEDIA_EXPORT extern const char kEnableAVFoundation[]; #endif #if defined(OS_WIN) diff --git a/media/video/capture/mac/avfoundation_glue.mm b/media/video/capture/mac/avfoundation_glue.mm index 65e3dc3..5510141 100644 --- a/media/video/capture/mac/avfoundation_glue.mm +++ b/media/video/capture/mac/avfoundation_glue.mm @@ -6,10 +6,14 @@ #include <dlfcn.h> +#include "base/command_line.h" #include "base/mac/mac_util.h" +#include "media/base/media_switches.h" bool AVFoundationGlue::IsAVFoundationSupported() { - return (base::mac::IsOSLionOrLater() && [AVFoundationBundle() load]); + const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + return cmd_line->HasSwitch(switches::kEnableAVFoundation) && + base::mac::IsOSLionOrLater() && [AVFoundationBundle() load]; } NSBundle const* AVFoundationGlue::AVFoundationBundle() { |