overview

command
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Camera2 pipeline overview.

Documents the complete Android Camera2 capture pipeline using the ndk camera package types. Each stage of the pipeline is shown in sequence with the types that participate. Because a real capture requires an ANativeWindow (obtained from a Surface), runtime camera permissions, and a running Android activity, this example cannot execute end-to-end on its own. It serves as a reference for the object graph and cleanup order.

Pipeline summary:

Manager
  -> open Device (via manager.OpenCamera)
       -> create CaptureRequest (via device.CreateCaptureRequest)
       -> create SessionOutputContainer
            -> add SessionOutput (wrapping an ANativeWindow)
       -> create CaptureSession (via device.CreateCaptureSession)
            -> set repeating request or single capture
            -> stop repeating
       <- close CaptureSession
  <- close Device
<- close Manager

Prerequisites:

  • Android device with API level 24+.
  • android.permission.CAMERA must be granted at runtime before opening any camera device. Without it the NDK returns camera.ErrPermissionDenied.
  • A valid ANativeWindow handle is needed to create OutputTarget and SessionOutput. Typically this comes from an Android Surface provided by SurfaceView, TextureView, or an ImageReader.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL