Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ extension AVCaptureDevice: CaptureDevice {
var maxISO: Float { activeFormat.maxISO }
var minFrameRate: Float64? { activeFormat.videoSupportedFrameRateRanges.first?.minFrameRate }
var maxFrameRate: Float64? { activeFormat.videoSupportedFrameRateRanges.first?.maxFrameRate }
var isVideoHDRSupported: Bool { activeFormat.isVideoHDRSupported }
}

// MARK: Getters & Setters
Expand All @@ -34,6 +35,7 @@ extension AVCaptureDevice {
else { return .off }
}
set {
guard isVideoHDRSupported else { return }
automaticallyAdjustsVideoHDREnabled = newValue == .auto
if newValue != .auto { isVideoHDREnabled = newValue == .on }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class MockCaptureDevice: NSObject, CaptureDevice {
var hasTorch: Bool { true }
var isExposurePointOfInterestSupported: Bool { true }
var isFocusPointOfInterestSupported: Bool { true }
var isVideoHDRSupported: Bool { true }

// MARK: Setters
var videoZoomFactor: CGFloat = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ protocol CaptureDevice: NSObject {
var hasTorch: Bool { get }
var isExposurePointOfInterestSupported: Bool { get }
var isFocusPointOfInterestSupported: Bool { get }
var isVideoHDRSupported: Bool { get }

// MARK: Getters & Setters
var videoZoomFactor: CGFloat { get set }
Expand Down