Skip to content

Instantly share code, notes, and snippets.

@rorodriguez116
Last active October 22, 2020 16:17
Show Gist options
  • Save rorodriguez116/77202cd6917925185f5a953242d1e128 to your computer and use it in GitHub Desktop.
Save rorodriguez116/77202cd6917925185f5a953242d1e128 to your computer and use it in GitHub Desktop.
Remaining properties for CameraService
// ...
// MARK: Alert properties
public var alertError: AlertError = AlertError()
// MARK: Session Management Properties
// 9. The capture session.
public let session = AVCaptureSession()
// 10. Stores whether the session is running or not.
private var isSessionRunning = false
// 11. Stores wether the session is been configured or not.
private var isConfigured = false
// 12. Stores the result of the setup process.
private var setupResult: SessionSetupResult = .success
// 13. The GDC queue to be used to execute most of the capture session's processes.
private let sessionQueue = DispatchQueue(label: "camera session queue")
// 14. The device we'll use to capture video from.
@objc dynamic var videoDeviceInput: AVCaptureDeviceInput!
// MARK: Device Configuration Properties
// 15. Video capture device discovery session.
private let videoDeviceDiscoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInWideAngleCamera, .builtInDualCamera, .builtInTrueDepthCamera], mediaType: .video, position: .unspecified)
// MARK: Capturing Photos Properties
// 16. PhotoOutput. Configures and captures photos.
private let photoOutput = AVCapturePhotoOutput()
// 17 Stores delegates that will handle the photo capture process's stages.
private var inProgressPhotoCaptureDelegates = [Int64: PhotoCaptureProcessor]()
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment