lesingo

ADR-0003: VisionCamera 5 FrameOutput with a Nitro adapter

Context

SayLens needs direct access to camera frames without transferring pixel buffers to the JavaScript thread. VisionCamera 5 offers FrameOutput, worklet runtimes, asynchronous frame processing, coordinate conversion, and native Nitro extension points.

A fully custom CameraOutput would require implementing and maintaining a CameraX UseCase, resolution negotiation, and output lifecycle before those capabilities are needed.

Decision

Use VisionCamera 5 FrameOutput as the frame source and implement a narrow Android Nitro plugin in Kotlin for object detection.

Use VisionCamera’s asynchronous runner as the single backpressure owner:

Use VisionCamera coordinate conversion APIs to move bounding-box corners from frame space to normalized camera space and then to preview space.

Consequences

Positive

Negative and risks

Alternatives considered

Validation

References