OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "media/base/mac/avfoundation_glue.h" | 5 #import "media/base/mac/avfoundation_glue.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 // This contains the logic of checking whether AVFoundation is supported. | 120 // This contains the logic of checking whether AVFoundation is supported. |
121 // It's called only once and the results are cached in a static bool. | 121 // It's called only once and the results are cached in a static bool. |
122 bool IsAVFoundationSupportedHelper() { | 122 bool IsAVFoundationSupportedHelper() { |
123 // AVFoundation is only available on OS Lion and above. | 123 // AVFoundation is only available on OS Lion and above. |
124 if (!base::mac::IsOSLionOrLater()) { | 124 if (!base::mac::IsOSLionOrLater()) { |
125 LogCaptureApi(CAPTURE_API_QTKIT_DUE_TO_OS_PREVIOUS_TO_LION); | 125 LogCaptureApi(CAPTURE_API_QTKIT_DUE_TO_OS_PREVIOUS_TO_LION); |
126 return false; | 126 return false; |
127 } | 127 } |
128 | 128 |
129 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 129 const base::CommandLine* command_line = |
| 130 base::CommandLine::ForCurrentProcess(); |
130 // The force-qtkit flag takes precedence over enable-avfoundation. | 131 // The force-qtkit flag takes precedence over enable-avfoundation. |
131 if (command_line->HasSwitch(switches::kForceQTKit)) { | 132 if (command_line->HasSwitch(switches::kForceQTKit)) { |
132 LogCaptureApi(CAPTURE_API_QTKIT_FORCED_BY_FLAG); | 133 LogCaptureApi(CAPTURE_API_QTKIT_FORCED_BY_FLAG); |
133 return false; | 134 return false; |
134 } | 135 } |
135 | 136 |
136 if (!command_line->HasSwitch(switches::kEnableAVFoundation)) { | 137 if (!command_line->HasSwitch(switches::kEnableAVFoundation)) { |
137 LogCaptureApi(CAPTURE_API_QTKIT_DUE_TO_NO_FLAG); | 138 LogCaptureApi(CAPTURE_API_QTKIT_DUE_TO_NO_FLAG); |
138 return false; | 139 return false; |
139 } | 140 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 @implementation AVCaptureDeviceInputGlue | 233 @implementation AVCaptureDeviceInputGlue |
233 | 234 |
234 + (CrAVCaptureDeviceInput*)deviceInputWithDevice:(CrAVCaptureDevice*)device | 235 + (CrAVCaptureDeviceInput*)deviceInputWithDevice:(CrAVCaptureDevice*)device |
235 error:(NSError**)outError { | 236 error:(NSError**)outError { |
236 return [[AVFoundationGlue::AVFoundationBundle() | 237 return [[AVFoundationGlue::AVFoundationBundle() |
237 classNamed:@"AVCaptureDeviceInput"] deviceInputWithDevice:device | 238 classNamed:@"AVCaptureDeviceInput"] deviceInputWithDevice:device |
238 error:outError]; | 239 error:outError]; |
239 } | 240 } |
240 | 241 |
241 @end // @implementation AVCaptureDeviceInputGlue | 242 @end // @implementation AVCaptureDeviceInputGlue |
OLD | NEW |