Native CameraX in Jetpack Compose - Filling the View-Shaped Hole
summary
Native CameraX now exposes a SurfaceRequest and a composable CameraXViewfinder that replaces PreviewView and publishes frames via SurfaceRequest to StateFlow, enabling a reactive pipeline that actually works end to end. CoordinateTransformer handles tap‑to‑focus math and rotation automatically. Two rendering modes trade battery for effects: EXTERNAL (SurfaceView) vs EMBEDDED (TextureView) — external is cheap but blocks modifiers, embedded supports blur/alpha/rotation at GPU cost. Demo app and Camera2Interop examples compile and run, and integrate with ML Kit and MediaPipe.
AI-written summary · about
chapters (19)
- 0:00Welcome
- 3:20Android camera APIs
- 5:13Introducing CameraX Compose
- 7:46Viewfinder composable explained
- 11:22Surface request deep dive
- 15:17CameraX preview
- 17:45Viewfinder design
- 19:10PreviewView vs Viewfinder
- 20:56Modifiers and scaling
- 22:22Content scale and alignment
- 23:05Coordinate transformer
- 23:50Camera switching
- 24:56Tap to focus
- 25:39Pinch to zoom
- 27:08Photo and video capture
- 28:34Embedded vs external demo
- 33:39Embedded vs external modes
- 37:15Summary
- 39:01Q&A



