flutter_ffi_uvc 0.4.1
flutter_ffi_uvc: ^0.4.1 copied to clipboard
UVC camera plugin based on libuvc, with live preview, frame access, and device controls.
0.4.1 #
Changed #
- Lowered minimum Dart SDK requirement to
^3.8.1. - Lowered plugin Android
compileSdkfrom 36 to 35 and pinnedndkVersionto26.3.11579264to align with Flutter 3.32.x defaults. - Example app: set
minSdk = 24explicitly to satisfy the plugin's minimum Android API requirement.
0.4.0 #
Fixed #
- Improved Android isochronous UVC streaming compatibility by limiting large ISO transfers and retrying with a smaller transfer size when initial submit fails.
- Fixed UVC stream transfer selection to use the endpoint descriptor transfer type instead of assuming interfaces with multiple altsettings are always isochronous.
- Fixed a libuvc streaming startup path that could report success even when no USB transfers were submitted.
- Relaxed MJPEG pre-validation so decodable frames are not rejected before libjpeg-turbo can process them.
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.