openAsync method
Implementation
Future<bool> openAsync(
String filename,
String codec,
double fps,
(int, int) frameSize, {
int? apiPreference,
bool isColor = true,
}) {
final cname = filename.toNativeUtf8();
final codec_ = VideoWriter.fourcc(codec);
final p = calloc<ffi.Bool>();
if (apiPreference == null) {
return cvRunAsync0(
(callback) => cvideoio.cv_VideoWriter_open(
ref,
cname.cast(),
codec_,
fps,
frameSize.$1,
frameSize.$2,
isColor,
p,
callback,
),
(c) {
calloc.free(cname);
final rval = p.value;
calloc.free(p);
c.complete(rval);
},
);
}
return cvRunAsync0(
(callback) => cvideoio.cv_VideoWriter_open_1(
ref,
cname.cast(),
apiPreference,
codec_,
fps,
frameSize.$1,
frameSize.$2,
isColor,
p,
callback,
),
(c) {
calloc.free(cname);
final rval = p.value;
calloc.free(p);
c.complete(rval);
},
);
}