flutter_ffi_uvc 0.3.2
flutter_ffi_uvc: ^0.3.2 copied to clipboard
Flutter UVC camera plugin using FFI (libuvc) — live preview, frame access, and device control
0.3.2 #
Added #
getStreamStats()/UvcStreamStats— exposes cumulative native preview session stats such as input and delivered FPS, drop counts, decode failures, frame gap timing, and first-frame latency.
0.3.0 #
Added #
copyLatestFrameTransformed(UvcPreviewTransform)— copies the latest frame with rotation and flip applied to the pixel data.UvcPreviewTransform.applyToSize(int width, int height)— returns the width and height after applying the transform, for use withAspectRatiowhen displaying the previewTexture.
Fixed #
- Example:
AspectRatiofor the previewTexturewas not updated when rotation was 90° or 270°.
0.2.0 #
Breaking changes #
startPreview(mode)now returnsFuture<UvcPreviewStartResult>instead ofintand verifies frame delivery on startup before returning.
Migration notes #
- Update code that uses the
intreturned bystartPreview(mode)to useUvcPreviewStartResultinstead. - Use
openPreview(mode)instead ofstartPreview(mode)if you want the previous non-verifying startup behaviour.
Added #
- Preview transform: rotation (0/90/180/270°) and flip (horizontal/vertical) applied to the Flutter
Textureoutput.copyLatestFrame()always returns the original camera orientation unaffected. SeeUvcPreviewTransform,setPreviewTransform(), and the convenience helpersrotatePreviewClockwise(),rotatePreviewCounterClockwise(),togglePreviewFlipHorizontal(),togglePreviewFlipVertical(). - Streaming error reporting: frame pipeline errors (decode failures, undersized frames, buffer allocation failures) are now delivered proactively via
UvcCamera.streamErrors(Stream<UvcStreamError>). startPreview(mode, {policy, consecutiveValidFrames, timeout})— starts the preview stream and verifies frame delivery before returning.UvcPreviewPolicy.stableFrames(default) verifies both frame delivery and frame validity;UvcPreviewPolicy.sequenceOnlyverifies frame delivery only. On success the stream remains running; on failure preview is stopped. ReturnsUvcPreviewStartResult.
Fixed #
- USB permission intent now explicitly sets the package name, improving permission reliability on Android.
- libuvc initialization no longer triggers libusb device discovery
0.1.0 #
Changed #
openUsbDevice(deviceId)is now the standard USB opening path.openFd(fd)remains available if you need to manage the USB file descriptor yourself.- Flutter
Textureis now the standard preview path. copyLatestFrame()is recommended for capture or frame inspection.
Migration notes #
- Use
openUsbDevice(deviceId)instead ofopenFd(fd). Get thedeviceIdfromlistUsbDevices().
Added #
- USB device management is now handled by the package —
UvcUsbDevice,ensureCameraPermission(),listUsbDevices(),openUsbDevice(),closeUsbDevice(). - Native preview renders directly into a Flutter
TextureviaANativeWindow—createPreviewTexture(),attachPreviewTexture(),disposePreviewTexture(). uvc_stop_previewnow waits for any in-flight frame callback to finish before returning.
0.0.2 #
- Improve README documentation, including installation, usage, and package boundary clarifications.
- Rename the example USB device class to
AndroidUsbDeviceEntryto better reflect its role.
0.0.1 #
- Initial public release.