open method

bool open(
  1. String uri, {
  2. int apiPreference = CAP_ANY,
})

Opens a video file or a capturing device or an IP video stream for video capturing with API Preference and parameters.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

https://docs.opencv.org/4.x/d8/dfe/classcv_1_1VideoCapture.html#aa6480e6972ef4c00d74814ec841a2939

Implementation

bool open(String uri, {int apiPreference = CAP_ANY}) {
  final cname = uri.toNativeUtf8().cast<ffi.Char>();
  final success = calloc<ffi.Bool>();
  cvRun(() => cvideoio.cv_VideoCapture_open_1(ref, cname, apiPreference, success, ffi.nullptr));
  final rval = success.value;
  calloc.free(cname);
  calloc.free(success);
  return rval;
}