chore: Move code

This commit is contained in:
Marc Rousavy 2023-11-15 15:44:19 +01:00
parent dc89664be2
commit e8ebc6ee9f
No known key found for this signature in database
GPG Key ID: 8B9C709EA0B16A6D

View File

@ -123,9 +123,10 @@ export function getCameraFormat(device: CameraDevice, filters: FormatFilter[]):
let leftPoints = 0 let leftPoints = 0
let rightPoints = 0 let rightPoints = 0
// Video Resolution
if (filter.videoResolution != null) {
const leftVideoResolution = bestFormat.videoWidth * bestFormat.videoHeight const leftVideoResolution = bestFormat.videoWidth * bestFormat.videoHeight
const rightVideoResolution = format.videoWidth * format.videoHeight const rightVideoResolution = format.videoWidth * format.videoHeight
if (filter.videoResolution != null) {
if (filter.videoResolution.target === 'max') { if (filter.videoResolution.target === 'max') {
// We just want the maximum resolution // We just want the maximum resolution
if (leftVideoResolution > rightVideoResolution) leftPoints += filter.videoResolution.priority if (leftVideoResolution > rightVideoResolution) leftPoints += filter.videoResolution.priority
@ -140,9 +141,10 @@ export function getCameraFormat(device: CameraDevice, filters: FormatFilter[]):
} }
} }
// Photo Resolution
if (filter.photoResolution != null) {
const leftPhotoResolution = bestFormat.photoWidth * bestFormat.photoHeight const leftPhotoResolution = bestFormat.photoWidth * bestFormat.photoHeight
const rightPhotoResolution = format.photoWidth * format.photoHeight const rightPhotoResolution = format.photoWidth * format.photoHeight
if (filter.photoResolution != null) {
if (filter.photoResolution.target === 'max') { if (filter.photoResolution.target === 'max') {
// We just want the maximum resolution // We just want the maximum resolution
if (leftPhotoResolution > rightPhotoResolution) leftPoints += filter.photoResolution.priority if (leftPhotoResolution > rightPhotoResolution) leftPoints += filter.photoResolution.priority