CameraDepthFrameOutput

interface CameraDepthFrameOutput extends CameraOutput

The CameraDepthFrameOutput allows synchronously streaming Depth Frames from the Camera, aka "Depth Frame Processing".

See

Example

const depthOutput = useDepthOutput({
  onDepth(depth) {
    'worklet'
    depth.dispose()
  }
})

Properties

mediaType

readonly mediaType: MediaType

The media type of the content being streamed by this CameraOutput.

Inherited from

CameraOutput.mediaType


outputOrientation

outputOrientation: Orientation

Gets 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 Frame object, unless explicitly configured to physically rotate buffers.

Inherited from

CameraOutput.outputOrientation


outputType

readonly outputType: CameraOutputType

The type of the CameraOutput.

Inherited from

CameraOutput.outputType


thread

readonly thread: NativeThread

Get the NativeThread that this CameraDepthFrameOutput is running on. This is the thread that setOnDepthFrameCallback(...) callbacks run on.

Methods

setOnDepthFrameCallback()

setOnDepthFrameCallback(onDepthFrame: (depth: Depth) => boolean & object | undefined): void

Adds a callback that calls the given onDepthFrame function every time the Camera produces a new Depth.

Note

This method has to be called on a Worklet running on this thread.


setOnDepthFrameDroppedCallback()

setOnDepthFrameDroppedCallback(onDepthFrameDropped: 
  | (reason: FrameDroppedReason) => void
  | undefined): void

Adds a callback that gets called when a Depth has been dropped. This often happens if your Depth Frame Callback is taking longer than a frame interval.