openCamera method
- String deviceId,
- int width,
- int height,
- int fps,
- int enableAudio,
- int frameWidth,
- int frameHeight,
- int enablePhoto,
- int directPreview,
Opens the camera identified by deviceId and starts streaming frames
into a Flutter Texture. Returns the Flutter texture ID.
width / height — requested preview resolution.
fps — target frame rate (e.g. 30 or 60).
enableAudio — 1 to capture audio for video recording, 0 otherwise.
frameWidth / frameHeight — requested frame-processor stream size,
independent of the preview (vision-camera's frame-output
targetResolution); 0 = same as the preview. Android only — iOS/macOS
deliver frames at the session format's size.
enablePhoto — 0 leaves the still (JPEG) stream out of the session, as
vision-camera does without a photo output; photo capture then fails.
Android only — iOS/macOS always attach the photo output.
directPreview — 1 lets the camera write straight into the Flutter
texture (no GL copy) while no shader, lens undistortion or GL recording
needs the renderer; frame it with getPreviewTransform. Only for the
Texture preview — a platform view needs the GL path. Android only.
Implementation
@override
Future<int> openCamera(
String deviceId,
int width,
int height,
int fps,
int enableAudio,
int frameWidth,
int frameHeight,
int enablePhoto,
int directPreview,
) => throw UnimplementedError('NitroCamera.openCamera');