startLiveFeed method

Future startLiveFeed()

Implementation

Future startLiveFeed() async {
  final camera = _cameras[_cameraIndex];
  _controller = CameraController(
    camera,
    ResolutionPreset.medium,
    enableAudio: false,
    imageFormatGroup: Platform.isAndroid
        ? ImageFormatGroup.nv21
        : ImageFormatGroup.bgra8888,
  );

  _controller?.initialize().then((_) {
    if (!mounted) {
      return;
    }

    _controller?.startImageStream(_processCameraImage).then((value) {});
    setState(() {});
  });
}