nitro_camera 0.0.2
nitro_camera: ^0.0.2 copied to clipboard
High-performance vision-camera-style plugin built on the Nitro FFI bridge — photo/video capture, code scanning, frame processing, and GPU filters with zero method-channel overhead.
0.0.2 #
Added #
- High-speed (slow-motion) recording —
startHighSpeedRecording(path, fps)/stopHighSpeedRecording(): 120/240 fps → 8× slow-mo. - Native detector plugin registry —
NitraDetectors.register(name, factory); select custom detectors from Dart by name.barcode/facebuilt-in. - Manual focus & exposure —
setFocusDistance,setManualExposure,setAutoExposure(clamped natively). - Keep-screen-on —
setKeepScreenOn(bool)(FFI, no extra plugin). - Frame helpers —
FrameData.resized / cropped / rotated. - Scanner ROI —
CodeScanner(windowFraction: …). - Multi-cam discovery — typed
ConcurrentCameraSet+getConcurrentCameraSets.
Fixed #
- Android: recorded video no longer squished — encoder size matches session aspect.
- Android: fixed a persistent-surface teardown race that could crash the camera.
- iOS: back↔front switch with manual white balance no longer crashes.
- RAW/DNG on HALs that gate it now fails fast + falls back to JPEG (no freeze).
- Android:
RecordingResult.durationMswas inflated by the encoder's finalize latency (a 2 s clip could report 4.7 s). It now reads the finalized container's own duration, with a stop-requested wall clock as fallback. - Videos no longer save sideways — recordings ignored the requested orientation and were stored in sensor orientation.
isRecordingno longer gets stuck on when a recording ends by itself (duration/file-size limit or encoder failure) — Dart is now notified.- Encoder crashes are no longer silent — a dying recorder stops the
recording, deletes the unusable file and emits an
errorevent. - Photos no longer save 90° off in landscape, on both platforms;
PhotoResult.orientation/isMirrorednow describe the saved file accurately. - A failed stop no longer returns a truncated, unplayable file as success — it
throws
RecorderException('recorder/finalize-failed'). AddsRecordingFinishedReason.failedandRecordingResult.isFinalized. initialize()without a size/format now targets 1080p instead of the platform's first format (4K on Android, smallest on iOS).- iOS: an unsupported
setFrameFormatvalue no longer crashes the app. - iOS: external and Continuity Cameras (iOS 17+) now appear in
getAvailableCameraDevices(). - Android: opening external/UVC cameras that report no preview sizes no longer crashes; they're also labelled as external instead of phone lenses.
- Android: session state no longer reports
bgrawhen frames are delivered asyuv420.
Changed #
- Upgraded to nitro 0.7.5.
0.0.1 - 2026-07-12 #
Initial release.
- Curated exports:
nitro_camera.dartexposes the high-level API only. The raw FFI layer moved topackage:nitro_camera/native.dartand the FPS HUD topackage:nitro_camera/debug.dart. - Typed device model: positions, lens types, hardware level, extensions, auto-focus system and stabilization modes are enums rather than ints.
- Typed errors: failures throw
CameraExceptionsubtypes (PermissionException,DeviceException,SessionException,CaptureException,RecorderException) with stabledomain/codestrings.
Fixed #
frameStreamdelivered frames from other open sessions; it is now scoped to its own session.PreviewMode.platformViewrendered nothing off-Android; it now falls back to the texture path.- Pinch-to-zoom clamped to a hardcoded 1–8× instead of the device's real range.
- Unknown values from a newer native layer are skipped instead of throwing a
RangeError.