File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
src/ZXing.Net.Mobile/MonoTouch Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -85,14 +85,17 @@ bool SetupCaptureSession ()
85
85
return false ;
86
86
}
87
87
88
- NSError err = null ;
89
- if ( captureDevice . LockForConfiguration ( out err ) )
88
+ if ( captureDevice . IsFocusModeSupported ( AVCaptureFocusMode . ModeContinuousAutoFocus ) )
90
89
{
91
- captureDevice . FocusMode = AVCaptureFocusMode . ModeContinuousAutoFocus ;
92
- captureDevice . UnlockForConfiguration ( ) ;
90
+ NSError err = null ;
91
+ if ( captureDevice . LockForConfiguration ( out err ) )
92
+ {
93
+ captureDevice . FocusMode = AVCaptureFocusMode . ModeContinuousAutoFocus ;
94
+ captureDevice . UnlockForConfiguration ( ) ;
95
+ }
96
+ else
97
+ Console . WriteLine ( "Failed to Lock for Config: " + err . Description ) ;
93
98
}
94
- else
95
- Console . WriteLine ( "Failed to Lock for Config: " + err . Description ) ;
96
99
97
100
var input = AVCaptureDeviceInput . FromDevice ( captureDevice ) ;
98
101
if ( input == null ) {
You can’t perform that action at this time.
0 commit comments