feat: Add pixelFormat field (#559)

* Add `mediaSubType` field to device formats

* Create FourCharCode `toString` extension

* Move pixelFormat -> `AVCaptureDevice.Format+toDictionary`

* `mediaSubType` -> `pixelFormat` + non-optional

* ts pixelFormat `string` -> specific formats

* Add default pixelFormat value of `420v` on Android

Co-authored-by: tcoldwell72 <31568400+tcoldwell72@users.noreply.github.com>
This commit is contained in:
Thomas Coldwell
2021-12-10 08:44:30 +00:00
committed by GitHub
parent a54ff5782c
commit c3039c94c6
5 changed files with 35 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
import type { CameraPosition } from './CameraPosition';
import type { PixelFormat } from './PixelFormat';
/**
* Indentifiers for a physical camera (one that actually exists on the back/front of the device)
@@ -171,6 +172,10 @@ export interface CameraDeviceFormat {
* All supported video stabilization modes
*/
videoStabilizationModes: VideoStabilizationMode[];
/**
* Specifies the pixel format on iOS. e.g. 420v, 420f
*/
pixelFormat: PixelFormat;
}
/**

7
src/PixelFormat.ts Normal file
View File

@@ -0,0 +1,7 @@
/**
* Represents the pixel format of a `Frame`.
* * `420v`: 420 YpCbCr 8 Bi-Planar Video Range
* * `420f`: 420 YpCbCr 8 Bi-Planar Full Range
* * `x420`: 420 YpCbCr 10 Bi-Planar Video Range
*/
export type PixelFormat = '420f' | '420v' | 'x420';