CameraFrameOutput
interface CameraFrameOutput extends CameraOutputThe CameraFrameOutput allows synchronously streaming
Frames from the Camera, aka "Frame Processing".
See
Example
const frameOutput = useFrameOutput({
pixelFormat: 'yuv',
onFrame(frame) {
'worklet'
frame.dispose()
}
})Properties
mediaType
readonly mediaType: MediaTypeThe media type of the content being streamed
by this CameraOutput.
Inherited from
outputOrientation
outputOrientation: OrientationGets or sets the output orientation of this CameraOutput.
Individual implementations of CameraOutput
may choose different strategies for implementing
output orientation, for example:
- A Photo output might apply orientation via EXIF flags.
- A Video output might apply orientation via track transform metadata.
- A Preview output might apply orientation via view transforms.
- A Frame output might not apply orientation and only pass it as a
property via the
Frameobject, unless explicitly configured to physically rotate buffers.
Inherited from
CameraOutput.outputOrientation
outputType
readonly outputType: CameraOutputTypeThe type of the CameraOutput.
Inherited from
thread
readonly thread: NativeThreadGet the NativeThread that this CameraFrameOutput
is running on.
This is the thread that setOnFrameCallback(...)
callbacks run on.
Methods
setOnFrameCallback()
setOnFrameCallback(onFrame: (frame: Frame) => boolean & object | undefined): voidAdds a callback that calls the given onFrame function
every time the Camera produces a new Frame.
Note
This method has to be called on a Worklet running on this thread.
setOnFrameDroppedCallback()
setOnFrameDroppedCallback(onFrameDropped:
| (reason: FrameDroppedReason) => void
| undefined): voidAdds a callback that gets called when a Frame has been dropped.
This often happens if your Frame Callback is taking longer than a frame interval.
CameraDepthFrameOutput
The CameraDepthFrameOutput allows synchronously streaming Depth Frames from the Camera, aka "Depth Frame Processing".
The CameraObjectOutput allows scanning various objects (ScannedObject), faces (ScannedFace), or machine-readable codes (ScannedCode) in the Camera, using a platform-native detection algorithm.