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

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

Issue 411983002: Fix force-qtkit flag on dev channel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | « chrome/browser/media/media_capture_devices_dispatcher.cc ('k') | 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 afc92d159bfad89c2ed5c1bee2a5ff1b0de5eda3..c46b4895327db58eeb553677cf3d32e60cd09b72 100644
--- a/media/video/capture/mac/avfoundation_glue.mm
+++ b/media/video/capture/mac/avfoundation_glue.mm
@@ -110,12 +110,24 @@ bool AVFoundationGlue::IsAVFoundationSupported() {
// once, during Chrome startup so this construction is thread safe.
// Use AVFoundation if possible, enabled, and QTKit is not explicitly forced.
static CommandLine* command_line = CommandLine::ForCurrentProcess();
- static bool is_av_foundation_supported = base::mac::IsOSLionOrLater() &&
- ((command_line->HasSwitch(switches::kEnableAVFoundation) &&
- !command_line->HasSwitch(switches::kForceQTKit)) ||
- base::FieldTrialList::FindFullName("AVFoundationMacVideoCapture")
- == "Enabled") && [AVFoundationBundle() load];
- return is_av_foundation_supported;
+
+ // AVFoundation is only available on OS Lion and above.
+ if (!base::mac::IsOSLionOrLater())
DaleCurtis 2014/07/23 20:54:38 I think you want to merge these into the static in
vrk (LEFT CHROMIUM) 2014/07/25 00:01:15 Ah, thanks for the catch! Didn't pay attention to
+ return false;
+
+ // The force-qtkit flag takes precedence over enable-avfoundation.
+ if (command_line->HasSwitch(switches::kForceQTKit))
+ return false;
+
+ // Next in precedence is the Enable AVFoundation flag.
+ // TODO(mcasas,vrk): There should be 3 states of AVFoundation: user forced on,
+ // user forced off (i.e. force QTKit), and default (respect field trial).
+ // crbug.com/396764
+ static bool avfoundation_requested =
+ command_line->HasSwitch(switches::kEnableAVFoundation) ||
+ (base::FieldTrialList::FindFullName("AVFoundationMacVideoCapture")
+ == "Enabled");
+ return avfoundation_requested && [AVFoundationBundle() load];
}
NSBundle const* AVFoundationGlue::AVFoundationBundle() {
« no previous file with comments | « chrome/browser/media/media_capture_devices_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698