71730a73ef
* Set category always if different * rename org * Fix video format sorting * fix format filtering * Update AVAudioSession+setCategoryIfNotSet.swift * upgrade all dependencies * Also run dependabot for JS codebase * Update MediaPage.tsx * Use typescript 4.2.4 * Also run TS in check-all * Downgrade typescript to 4.2.3 * f * recreate lockfiles * docs: Revert package.json changes * revert all package.json changes * Update Podfile.lock * bump all dependencies, pin typescript to 4.2.4 * Downgrade react-native-navigation for now * upgrade to later snapshot * Update yarn.lock * remove yeet
56 lines
1.1 KiB
Swift
56 lines
1.1 KiB
Swift
//
|
|
// AVCaptureSession.Preset+descriptor.swift
|
|
// Cuvent
|
|
//
|
|
// Created by Marc Rousavy on 15.12.20.
|
|
// Copyright © 2020 mrousavy. All rights reserved.
|
|
//
|
|
|
|
import AVFoundation
|
|
import Foundation
|
|
|
|
extension AVCaptureSession.Preset {
|
|
init(withString string: String) throws {
|
|
switch string {
|
|
case "cif-352x288":
|
|
self = .cif352x288
|
|
return
|
|
case "hd-1280x720":
|
|
self = .hd1280x720
|
|
return
|
|
case "hd-1920x1080":
|
|
self = .hd1920x1080
|
|
return
|
|
case "hd-3840x2160":
|
|
self = .hd4K3840x2160
|
|
return
|
|
case "high":
|
|
self = .high
|
|
return
|
|
case "iframe-1280x720":
|
|
self = .iFrame1280x720
|
|
return
|
|
case "iframe-960x540":
|
|
self = .iFrame960x540
|
|
return
|
|
case "input-priority":
|
|
self = .inputPriority
|
|
return
|
|
case "low":
|
|
self = .low
|
|
return
|
|
case "medium":
|
|
self = .medium
|
|
return
|
|
case "photo":
|
|
self = .photo
|
|
return
|
|
case "vga-640x480":
|
|
self = .vga640x480
|
|
return
|
|
default:
|
|
throw EnumParserError.invalidValue
|
|
}
|
|
}
|
|
}
|