flutter_native_vision_camera 0.0.4
flutter_native_vision_camera: ^0.0.4 copied to clipboard
High-performance Flutter FFI camera plugin with zero-copy preview textures, integrated MLKit/Vision barcode scanning, and low-latency native frame access for real-time on-device vision.
Changelog #
0.0.4 #
Correctness, honesty, and packaging pass.
- Fixed: removed the deprecated
packageattribute from the Android manifest (broke builds under AGP 8.x; the namespace is set inbuild.gradle). - Fixed: Android video recording no longer crashes —
RECORD_AUDIOis now declared and audio is gated behind a runtime permission check, falling back to video-only when the mic is unavailable. - Fixed:
requestMicrophonePermissionnow actually awaits the permission dialog result. - Fixed: frame processor no longer routes frames through a no-op relay isolate. The Dart callback is now
delivered directly via
NativeCallable.listener; documentation corrected to state it runs on the main isolate event loop (not a background isolate). - Fixed:
CameraPreviewnow rebuilds when the controller updates (e.g. after async init or device switch). - Fixed: Android tap-to-focus now targets the correct metering point.
- Improved: Android frames now expose all YUV planes with correct row strides (previously only the Y plane).
- Improved: iOS reports the real frame pixel format and retains preview buffers safely.
- Packaging: real podspec metadata, version lockstep, honest README/feature matrix,
topics/issue_tracker, CI (format/analyze/test/dry-run/pana + per-platform native builds), dropped the unusedplugin_platform_interfacedependency. - iOS: implemented video recording (AVAssetWriter, keeps the frame stream live),
setFocusDistance, barcode symbology filtering, teardown-on-reinit,CVPixelBufferretain/lock balance, honest pixel format, main-thread results. Device-verified on iOS 18 (preview, photo, video, scanning). - Orientation (structural): preview rotation is now read from the camera framework
(Android
SurfaceRequest.TransformationInfo, iOS sensor-relative) and applied once inCameraPreview— fixing the recurring 90° tilt. Addedcontroller.previewRotation/displayPreviewSize; scanner overlay and camera page no longer compensate for rotation themselves. iOS Vision boxes now use the buffer orientation. - Mirroring: a single
mirrorflag oninitializedrives both the front-camera preview and the saved photo/video; the preview no longer double-mirrors on Android.CameraPreviewgainsResizeMode.contain. - Android: dynamic capture orientation, correct tap-to-focus metering, real photo orientation.
- API: exposed per-plane strides (
Frame.planeBytesPerRow/planePixelStride) so chroma planes can be walked correctly; addedCameraDevices.getCameraFormat(...)to pick a format by resolution/fps. - Docs: comprehensive README (compile-correct quickstart with permissions, photo/video/scan/lifecycle
snippets, a correct native C/C++ plugin guide, requirements, expanded platform matrix, Limitations & Roadmap);
rewrote the example README; corrected the "background isolate" claim in the API docs to match reality
(main isolate); documented
takeSnapshot(iOS-only),setExposureunits, andinitialize'spixelFormat/mirror. - Example: the Native Vision Camera page now reads the raw frame buffer over FFI and shows a live average brightness, demonstrating the headline feature; fixed the C++ sample's row-stride indexing.
0.0.3 #
- Migrated the Android embedding to AndroidX for better compatibility.
0.0.2 #
- Fixed pubspec metadata (homepage, repository).
0.0.1 #
- Initial release of
flutter_native_vision_camera. - FFI pipeline for frame access, zero-copy preview textures, basic camera controls (zoom, focus, flash), and real-time barcode scanning.