openCamera method

  1. @override
Future<int> openCamera(
  1. String deviceId,
  2. int width,
  3. int height,
  4. int fps,
  5. int enableAudio,
  6. int frameWidth,
  7. int frameHeight,
  8. int enablePhoto,
  9. int directPreview,
)
override

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');