wireless camera app for Android

Stream a phone's camera to a tablet over WiFi/hotspot.
WebSocket transport with native YUV-to-JPEG encoding,
UDP auto-discovery, remote control (zoom, flash, camera switch,
rotate, mirror) from the viewer.
This commit is contained in:
2026-03-06 18:14:27 +00:00
commit 1660696d7f
32 changed files with 1962 additions and 0 deletions

18
lib/jpeg_encoder.dart Normal file
View File

@@ -0,0 +1,18 @@
import 'package:camera/camera.dart';
import 'package:flutter/services.dart';
const _channel = MethodChannel('com.kschappell.external_cam/jpeg');
Future<Uint8List?> encodeJpeg(CameraImage image, {int quality = 50}) async {
return _channel.invokeMethod<Uint8List>('encodeJpeg', {
'width': image.width,
'height': image.height,
'y': image.planes[0].bytes,
'u': image.planes[1].bytes,
'v': image.planes[2].bytes,
'yRowStride': image.planes[0].bytesPerRow,
'uvRowStride': image.planes[1].bytesPerRow,
'uvPixelStride': image.planes[1].bytesPerPixel,
'quality': quality,
});
}