Commit 37eec866 by Daniel Dahan

added tap focus, tap exposure, tap reset layers

parent 2685c8f6
...@@ -392,7 +392,7 @@ public class CaptureSession : NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -392,7 +392,7 @@ public class CaptureSession : NSObject, AVCaptureFileOutputRecordingDelegate {
/** /**
:name: switchCameras :name: switchCameras
*/ */
public func switchCameras() { public func switchCameras(completion: ((success: Bool) -> Void)? = nil) {
if canSwitchCameras { if canSwitchCameras {
do { do {
self.delegate?.captureSessionWillSwitchCameras?(self, position: self.cameraPosition) self.delegate?.captureSessionWillSwitchCameras?(self, position: self.cameraPosition)
...@@ -407,8 +407,10 @@ public class CaptureSession : NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -407,8 +407,10 @@ public class CaptureSession : NSObject, AVCaptureFileOutputRecordingDelegate {
self.session.addInput(self.activeVideoInput) self.session.addInput(self.activeVideoInput)
} }
self.session.commitConfiguration() self.session.commitConfiguration()
completion?(success: true)
self.delegate?.captureSessionDidSwitchCameras?(self, position: self.cameraPosition) self.delegate?.captureSessionDidSwitchCameras?(self, position: self.cameraPosition)
} catch let e as NSError { } catch let e as NSError {
completion?(success: false)
self.delegate?.captureSessionFailedWithError?(self, error: e) self.delegate?.captureSessionFailedWithError?(self, error: e)
} }
} }
...@@ -560,7 +562,7 @@ public class CaptureSession : NSObject, AVCaptureFileOutputRecordingDelegate { ...@@ -560,7 +562,7 @@ public class CaptureSession : NSObject, AVCaptureFileOutputRecordingDelegate {
:name: startRecording :name: startRecording
*/ */
public func startRecording() { public func startRecording() {
if !self.isRecording { if !isRecording {
dispatch_async(sessionQueue) { dispatch_async(sessionQueue) {
let connection: AVCaptureConnection = self.movieOutput.connectionWithMediaType(AVMediaTypeVideo) let connection: AVCaptureConnection = self.movieOutput.connectionWithMediaType(AVMediaTypeVideo)
connection.videoOrientation = self.currentVideoOrientation connection.videoOrientation = self.currentVideoOrientation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment