0
Fork 0
mirror of https://github.com/Droid-VM/crosvm.git synced 2026-11-17 06:58:03 +00:00
crosvm/android_camera/Android.bp
HuJK 79d77b8d38 android_camera: what the camera device needs from the NDK crate
M4 (VPU_DESIGN.md 7.1). The crate was a probe's library; the camera device
needs five things it did not have:

- an open that unwinds: Camera::open_with builds through an OpenGuard that
  releases every handle made so far, in Camera::drop's order, on any failure,
  and takes an optional StateListener; Camera::open is open_with(.., None), so
  camera_probe is unchanged;
- the device-state callbacks with a context: ACameraDeviceStateCallbacks now
  points at a Box<StateContext> the camera keeps, and the listener is called
  with DeviceState::Disconnected / Error(code) from the binder thread that
  delivers them, which is how the guest learns the host took the camera away;
- AImageReader_acquireLatestImage when the NDK has it (the ndk_api! macro grew
  an optional group resolved with .ok()): next_frame_latest drops the frames a
  slow consumer left behind, and is next_frame where the symbol is missing;
- the two tables the device answers ENUM_FRAMEINTERVALS and S_PARM from,
  SCALER_AVAILABLE_MIN_FRAME_DURATIONS (YUV_420_888 only) and
  CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES, in CameraInfo and in camera_probe
  list;
- Plane::as_ptr/len for the interleaved-chroma copy, which a per-plane slice
  cannot express.

libc is a real dependency now and the crate is a workspace member, so it and
camera_probe build under cargo on the build host (logs/vpu_wp/scratch-m4).
apex_available: com.android.virt, because libdevices, which depends on this
since the camera device, is available to that APEX and soong refuses the
dependency otherwise.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011BkN7vYhuc1w9iVuqsHzSn
2026-10-28 06:23:28 +08:00

61 lines
2.3 KiB