feat: Make videoWidth
and videoHeight
available on all devices
This commit is contained in:
parent
b2f3c08a07
commit
5126dd63b4
@ -22,11 +22,15 @@ extension AVCaptureDevice.Format {
|
||||
}
|
||||
|
||||
func toDictionary() -> [String: Any] {
|
||||
let videoDimensions = CMVideoFormatDescriptionGetDimensions(formatDescription)
|
||||
|
||||
var dict: [String: Any] = [
|
||||
"videoStabilizationModes": videoStabilizationModes.map(\.descriptor),
|
||||
"autoFocusSystem": autoFocusSystem.descriptor,
|
||||
"photoHeight": highResolutionStillImageDimensions.height,
|
||||
"photoWidth": highResolutionStillImageDimensions.width,
|
||||
"videoHeight": videoDimensions.height,
|
||||
"videoWidth": videoDimensions.width,
|
||||
"maxISO": maxISO,
|
||||
"minISO": minISO,
|
||||
"fieldOfView": videoFieldOfView,
|
||||
@ -41,11 +45,11 @@ extension AVCaptureDevice.Format {
|
||||
]
|
||||
},
|
||||
]
|
||||
|
||||
if #available(iOS 13.0, *) {
|
||||
dict["isHighestPhotoQualitySupported"] = self.isHighestPhotoQualitySupported
|
||||
dict["videoHeight"] = self.formatDescription.presentationDimensions().height
|
||||
dict["videoWidth"] = self.formatDescription.presentationDimensions().width
|
||||
}
|
||||
|
||||
return dict
|
||||
}
|
||||
}
|
||||
|
@ -118,16 +118,12 @@ export interface CameraDeviceFormat {
|
||||
photoWidth: number;
|
||||
/**
|
||||
* The video resolutions's height
|
||||
*
|
||||
* @platform iOS 13.0
|
||||
*/
|
||||
videoHeight?: number;
|
||||
videoHeight: number;
|
||||
/**
|
||||
* The video resolution's width
|
||||
*
|
||||
* @platform iOS 13.0
|
||||
*/
|
||||
videoWidth?: number;
|
||||
videoWidth: number;
|
||||
/**
|
||||
* A boolean value specifying whether this format supports the highest possible photo quality that can be delivered on the current platform.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user