CameraOutputSynchronizer

iOS
interface CameraOutputSynchronizer extends HybridObject

A CameraOutputSynchronizer synchronizes 2 or more CameraOutputs to align their timestamps.

The most common use-case is to synchronize a CameraFrameOutput and a CameraDepthFrameOutput to ensure the delivered Frame and Depth are synchronized.

When an output is connected to the CameraOutputSynchronizer you should no longer use its own frame callback, but instead use the setOnFramesCallback provided here.

Properties

outputs

readonly outputs: CameraOutput[]

The list of CameraOutputs that are connected to this CameraOutputSynchronizer.


thread

readonly thread: NativeThread

The NativeThread this CameraOutputSynchronizer is running on.

Methods

setOnFrameDroppedCallback()

setOnFrameDroppedCallback(onFrameDropped: 
  | (frameType: MediaType, reason: FrameDroppedReason) => void
  | undefined): void

Sets the callback that gets called when a Frame or Depth-frame has been dropped, possibly due to a long drift in timelines.


setOnFramesCallback()

setOnFramesCallback(onFrames: 
  | (frames: (Frame | Depth)[]) => boolean & object
  | undefined): void

Set the callback to be called when a new set of synchronized Frames arrive.

Note

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