react-native-vision-camera/package/ios/Extensions/AVCaptureVideoDataOutput+findPixelFormat.swift
Marc Rousavy fffefa9d12
feat: Add support for Buffer Compression for a more efficient Video Pipeline (enableBufferCompression) (#1828)
feat: Add support for Buffer Compression for more efficient Video Pipeline (`enableBufferCompression`)
2023-09-21 17:18:54 +02:00

22 lines
544 B
Swift

//
// AVCaptureVideoDataOutput+findPixelFormat.swift
// VisionCamera
//
// Created by Marc Rousavy on 21.09.23.
// Copyright © 2023 mrousavy. All rights reserved.
//
import AVFoundation
extension AVCaptureVideoDataOutput {
/**
Of the given list, find the first that is available on this video data output.
If none are supported, this returns nil.
*/
func findPixelFormat(firstOf pixelFormats: [OSType]) -> OSType? {
return pixelFormats.first { format in
availableVideoPixelFormatTypes.contains(format)
}
}
}