Chromium Code Reviews| Index: media/video/capture/mac/avfoundation_glue.mm |
| diff --git a/media/video/capture/mac/avfoundation_glue.mm b/media/video/capture/mac/avfoundation_glue.mm |
| index 1610d0f104a7e48bd8a1302e0023bcdb810149aa..38f8b8282721739687bd3f15b6a345d8eaaa199e 100644 |
| --- a/media/video/capture/mac/avfoundation_glue.mm |
| +++ b/media/video/capture/mac/avfoundation_glue.mm |
| @@ -9,6 +9,7 @@ |
| #include "base/command_line.h" |
| #include "base/lazy_instance.h" |
| #include "base/mac/mac_util.h" |
| +#include "base/metrics/field_trial.h" |
| #include "media/base/media_switches.h" |
| namespace { |
| @@ -53,12 +54,19 @@ static NSString* ReadNSStringPtr(const char* symbol) { |
| return *string_pointer; |
| } |
| +bool UseAVFoundationExperiment() { |
| + const std::string group_name = |
| + base::FieldTrialList::FindFullName("AVFoundationMacVideoCapture"); |
| + return group_name == "Enabled"; |
| +} |
| + |
| } // namespace media |
| bool AVFoundationGlue::IsAVFoundationSupported() { |
| const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| - return cmd_line->HasSwitch(switches::kEnableAVFoundation) && |
| - base::mac::IsOSLionOrLater() && [AVFoundationBundle() load]; |
| + return (cmd_line->HasSwitch(switches::kEnableAVFoundation) || |
| + media::UseAVFoundationExperiment()) && base::mac::IsOSLionOrLater() && |
|
Alexei Svitkine (slow)
2014/01/09 15:50:39
This is a bit tricky. One thing to understand is t
Alexei Svitkine (slow)
2014/01/09 15:56:20
Just to clarify, since I think I didn't give enoug
mcasas
2014/01/09 16:20:35
I think it makes sense: only use the experiment co
|
| + [AVFoundationBundle() load]; |
|
Alexei Svitkine (slow)
2014/01/09 15:50:39
Not super familiar with this code, but is it safe
mcasas
2014/01/09 16:20:35
NSBundle -load can be called safely several times
|
| } |
| NSBundle const* AVFoundationGlue::AVFoundationBundle() { |