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`)
This commit is contained in:
Marc Rousavy
2023-09-21 17:18:54 +02:00
committed by GitHub
parent aafffa60f6
commit fffefa9d12
9 changed files with 96 additions and 20 deletions

View File

@@ -0,0 +1,21 @@
//
// 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)
}
}
}