Skip to content
Merged
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
1 change: 1 addition & 0 deletions Sources/VideoIO/Camera+AudioQueueCapture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Foundation
@available(iOS 10.0, macOS 10.15, *)
@available(tvOS, unavailable)
@available(macOS, unavailable)
@available(macCatalyst 14.0, *)
extension Camera {
public func enableAudioQueueCaptureDataOutput(on queue: DispatchQueue = .main, delegate: AudioQueueCaptureSessionDelegate) throws {
assert(self.audioDataOutput == nil)
Expand Down
1 change: 1 addition & 0 deletions Sources/VideoIO/Camera+FocusExposure.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import AVFoundation

@available(iOS 10.0, macOS 10.15, *)
@available(tvOS, unavailable)
@available(macCatalyst 14.0, *)
extension Camera {
@available(macOS, unavailable)
public func setFocusExposurePointOfInterest(to devicePoint: CGPoint, focusMode: AVCaptureDevice.FocusMode = .continuousAutoFocus, exposureMode: AVCaptureDevice.ExposureMode = .continuousAutoExposure, shouldMonitorSubjectAreaChange: Bool = false) throws {
Expand Down
3 changes: 3 additions & 0 deletions Sources/VideoIO/Camera+PhotoCapture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import AVFoundation

@available(macOS 10.15, *)
@available(tvOS, unavailable)
@available(macCatalyst 14.0, *)
extension Camera {

@available(iOS 11.0, *)
@available(macCatalyst 14.0, *)
private class PhotoCaptureDelegateHandler: NSObject, AVCapturePhotoCaptureDelegate {
var willBeginCaptureHandler: ((AVCaptureResolvedPhotoSettings) -> Void)?
var didFinishProcessingHandler: ((Result<AVCapturePhoto, Swift.Error>) -> Void)?
Expand All @@ -29,6 +31,7 @@ extension Camera {
}

@available(iOS 11.0, *)
@available(macCatalyst 14.0, *)
public func capturePhoto(with settings: AVCapturePhotoSettings,
willBeginCaptureHandler: ((AVCaptureResolvedPhotoSettings) -> Void)? = nil,
didFinishProcessingHandler: @escaping (Result<AVCapturePhoto, Swift.Error>) -> Void) {
Expand Down
6 changes: 6 additions & 0 deletions Sources/VideoIO/Camera.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import AVFoundation

@available(iOS 10.0, macOS 10.15, *)
@available(tvOS, unavailable)
@available(macCatalyst 14.0, *)
public class Camera {
public enum Error: Swift.Error {
case noDeviceFound
Expand Down Expand Up @@ -289,6 +290,7 @@ public class Camera {

private var _outputSynchronizer: Any?
@available(iOS 11.0, *)
@available(macCatalyst 14.0, *)
private var outputSynchronizer: AVCaptureDataOutputSynchronizer? {
get {
return _outputSynchronizer as? AVCaptureDataOutputSynchronizer
Expand All @@ -299,12 +301,14 @@ public class Camera {
}

@available(iOS 11.0, *)
@available(macCatalyst 14.0, *)
public var depthCaptureConnection: AVCaptureConnection? {
return self.depthDataOutput?.connection(with: .depthData)
}

private var _depthDataOutput: Any?
@available(iOS 11.0, *)
@available(macCatalyst 14.0, *)
public private(set) var depthDataOutput: AVCaptureDepthDataOutput? {
get {
return _depthDataOutput as? AVCaptureDepthDataOutput
Expand All @@ -315,6 +319,7 @@ public class Camera {
}

@available(iOS 11.0, *)
@available(macCatalyst 14.0, *)
public func enableSynchronizedVideoAndDepthDataOutput(on queue: DispatchQueue, delegate: AVCaptureDataOutputSynchronizerDelegate) throws {
assert(self.videoDataOutput == nil)
assert(self.outputSynchronizer == nil)
Expand Down Expand Up @@ -356,6 +361,7 @@ public class Camera {
}

@available(iOS 11.0, *)
@available(macCatalyst 14.0, *)
public func disableSynchronizedVideoAndDepthDataOutput() {
self.captureSession.beginConfiguration()

Expand Down
2 changes: 2 additions & 0 deletions Sources/VideoIO/DeviceOrientationTracker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ import CoreMotion
import UIKit
import AVFoundation

@available(macCatalyst 14.0, *)
public protocol DeviceOrientationTrackerDelegate: AnyObject {
func deviceOrientationUpdated(tracker: DeviceOrientationTracker, orientation: UIDeviceOrientation)
}

@available(macOS, unavailable)
@available(macCatalyst 14.0, *)
public class DeviceOrientationTracker {

private let motionManager = CMMotionManager()
Expand Down
1 change: 1 addition & 0 deletions Sources/VideoIO/VideoOrientationUtilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import CoreGraphics
public struct VideoOrientationUtilities {

@available(tvOS, unavailable)
@available(macCatalyst 14.0, *)
public static func exifOrientationToApply(from captureOrientation: AVCaptureVideoOrientation, to targetOrientation: AVCaptureVideoOrientation, shouldMirror: Bool) -> CGImagePropertyOrientation {
switch captureOrientation {
case .landscapeLeft:
Expand Down