Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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>
- Loading branch information
1 parent
a54ff57
commit c3039c9
Showing
5 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// FourCharCode+toString.swift | ||
// VisionCamera | ||
// | ||
// Created by Thomas Coldwell on 28/10/2021. | ||
// Based off this SO answer: https://stackoverflow.com/a/25625744 | ||
// | ||
|
||
extension FourCharCode { | ||
func toString() -> String { | ||
var s: String = String (UnicodeScalar((self >> 24) & 255)!) | ||
s.append(String(UnicodeScalar((self >> 16) & 255)!)) | ||
s.append(String(UnicodeScalar((self >> 8) & 255)!)) | ||
s.append(String(UnicodeScalar(self & 255)!)) | ||
return (s) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'; |