iOS parity, structural orientation/mirror, frame-lifetime safety, honest packaging & docs - #2
Merged
Conversation
- Modified `project.pbxproj` to include new Pods and framework references. - Updated `contents.xcworkspacedata` to include Pods project. - Enhanced `AppDelegate.swift` to support implicit Flutter engine initialization. - Added scene configuration in `Info.plist` for better scene management. - Updated `pubspec.lock` with new package versions and dependencies. - Created a VSCode task to remove duplicate header files. - Refactored `FlutterNativeVisionCameraPlugin` to forward to Swift implementation. - Introduced `VisionCamera_FFI.h` for better C/C++ interoperability. - Updated podspec to include C++ source files and improved header search paths. - Enhanced `flutter_native_vision_camera.h` for better type definitions and structure.
- pubspec 0.0.4, drop unused plugin_platform_interface, add topics/issue_tracker, raise Flutter floor - real podspec metadata + frameworks + PrivacyInfo.xcprivacy; remove deprecated AndroidManifest package attr; add RECORD_AUDIO - replace broken native-build workflow with CI (format/analyze/test/dry-run/pana + per-platform native builds) - honest README (real platform matrix, threading, orientation & mirror docs) and newest-first CHANGELOG
- frame processor callback runs directly via NativeCallable.listener (honest main-isolate semantics), instance-scoped, always decrements - Android: pass all 3 planes with row/pixel strides; honor planeIndex; stride-aware luminance; working incrementRefCount - atomic frame-processor callback pointer; iOS lock-once/CFRetain balance
…cus, mirror - gate withAudioEnabled behind RECORD_AUDIO with video-only fallback; propagate recording errors - requestMicrophonePermission actually awaits result code 1002 - report framework rotation (TransformationInfo) + front-preview mirror state to Dart - dynamic capture orientation, correct tap-to-focus metering, real photo orientation, mirror setting - fix pre-existing it.cameraInfo compile error
- implement start/stop/cancel recording (reuses the live frame stream), setFocusDistance, barcode symbology filtering + Vision orientation - teardown-on-reinit, CVPixelBuffer retain + lock balance, honest pixel format, main-thread results - deterministic preview rotation + report mirror state; mirror setting for photo/video - fix pre-existing .externalUnknown / .codabar availability errors
- single source of truth: controller.previewRotation/displayPreviewSize/previewMirrored from native - CameraPreview applies rotation once, mirrors only when needed (no double-mirror), BoxFit-aware tap-to-focus - single 'mirror' flag drives both preview and captured photo/video; ResizeMode honored - CameraPreview rebuilds reactively via ListenableBuilder
…-tooling build files
- C: free NativeFrame only on final decrement (so incrementRefCount/retain works); iOS retain takes a matching CVPixelBuffer lock; mutex serializes dispatch vs callback teardown - controller: stop the frame pipeline + reset session state (active/recording/texture/size) before re-init/device-switch, preventing a use-after-free of recycled buffers - CameraPreview: tap-to-focus inverts the actual rendered flip, not the desired mirror state
- nil the recorder on the session queue (not the asset-writer queue) to avoid racing the frame-append path - complete a pending photo result on teardown so the Dart future never hangs on dispose/device-switch - guard AVAssetWriter.startWriting() failure instead of appending into a non-writing writer - report oriented (portrait) recorded dimensions
- on a Finalize error, drop the dangling recording (so a later stopRecording doesn't hang) and surface onError - reject a concurrent microphone-permission request instead of overwriting/leaking the pending Dart result
…r in Android video - iOS: all pendingPhotoResult access (set/read/clear) now on the session queue, reject overlapping captures - Android: VideoCapture honors the mirror flag (MIRROR_MODE_ON_FRONT_ONLY) to match the photo path
- Frame.planeBytesPerRow(i)/planePixelStride(i) (C exports) so chroma planes can be walked correctly — the headline real-time-CV use case - CameraDevices.getCameraFormat(device, targetWidth/Height/Fps) to pick a format without hand-rolling a comparator
- rewrite README: compile-correct quickstart with permissions, photo/video/scan/lifecycle snippets, correct native C++ plugin guide, requirements (iOS 13 / minSdk 21 / physical device), expanded platform matrix, Limitations & Roadmap - correct the 'background isolate' claim in dartdoc to match reality (main isolate) - document takeSnapshot (iOS-only), setExposure units, initialize pixelFormat/mirror; mark initializeNativeExamplePlugin demo-only - rewrite the boilerplate example README
…el pages - Native Vision Camera page reads the raw frame buffer over FFI and shows live average brightness (proves the headline feature, not just FPS) - fix the C++ sample's row-stride indexing (was using width instead of bytesPerRow) - relabel cards (Barcode/QR Scanner; FFI frame processor)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the plugin to real iOS+Android parity and a credible, adoptable state. Device-verified on Pixel 8 (Android) and iPhone SE / iOS 18 (preview, photo, video recording, scanning, orientation, mirror).
Highlights
setFocusDistance, barcode symbology filtering, teardown/lifecycle/buffer fixes, deterministic orientation.TransformationInfo/ iOS sensor-relative) and apply it once inCameraPreview— fixes the recurring 90° tilt; addspreviewRotation/displayPreviewSize.mirrorflag drives both the front preview and the saved photo/video.Known residuals (documented)
clearFramesuse-after-free on framework activity/engine-detach (re-init/dispose paths fixed).RecordVideoOptions, runtimesetMirror/switchCamera, typed exceptions are roadmap.