Skip to content

Commit

Permalink
Remove comments in CaptureSessionManager
Browse files Browse the repository at this point in the history
  • Loading branch information
nauaros committed Feb 24, 2025
1 parent 27339bf commit bceaefc
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions AdyenCardScanner/Sources/CaptureSessionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,17 @@ class CaptureSessionManager: NSObject, CaptureSessionManaging {
private func configureCaptureSession() throws {
captureSession.beginConfiguration()

// Set up input
guard
let videoInput = try? AVCaptureDeviceInput(device: captureDevice),
captureSession.canAddInput(videoInput)
else {
throw CardScannerError(kind: .capture)
}

// Configure capture device settings
configureCaptureDevice(captureDevice)

captureSession.addInput(videoInput)

// Set up output
let videoOutput = AVCaptureVideoDataOutput()
let videoSettings = Constants.videoSettings
videoOutput.videoSettings = videoSettings
Expand All @@ -131,16 +128,13 @@ class CaptureSessionManager: NSObject, CaptureSessionManaging {
private func configureCaptureDevice(_ device: AVCaptureDevice) {
try? device.lockForConfiguration()

// Adjust Frame Rate
device.activeVideoMinFrameDuration = CMTime(value: 1, timescale: 15) // 15 fps
device.activeVideoMaxFrameDuration = CMTime(value: 1, timescale: 30) // 30 fps

// Focus and Exposure Settings
if device.isFocusModeSupported(.continuousAutoFocus) {
device.focusMode = .continuousAutoFocus
}

// Auto Exposure
if device.isExposureModeSupported(.continuousAutoExposure) {
device.exposureMode = .continuousAutoExposure
}
Expand Down

0 comments on commit bceaefc

Please sign in to comment.