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

Unified Diff: media/video/capture/mac/avfoundation_glue.mm

Issue 128373002: Added code for AVFoundation Finch Experiment enabling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698