openAsync method

Future<bool> openAsync(
  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

Future<bool> openAsync(String uri, {int apiPreference = CAP_ANY}) {
  final cname = uri.toNativeUtf8().cast<ffi.Char>();
  final rval = cvRunAsync<bool>(
    (callback) => cvideo.VideoCapture_OpenWithAPI_Async(ref, cname, apiPreference, callback),
    boolCompleter,
  );
  calloc.free(cname);
  return rval;
}