Implementation
Future<int> addVideoFrame(RawImageF image, int timestamp_microsec) async {
ReceivePort receivePort = ReceivePort();
_sendPort.send({
"event": _VideoWorkerEvents.ADD_VIDEO_FRAME,
"sendPort": receivePort.sendPort,
"width": image.width,
"height": image.height,
"format": image.format,
"data": image.data.address,
"with_crop": image.with_crop,
"crop_info_offset_x": image.crop_info_offset_x,
"crop_info_offset_y": image.crop_info_offset_y,
"crop_info_data_image_width": image.crop_info_data_image_width,
"crop_info_data_image_height": image.crop_info_data_image_height,
"timestamp_microsec": timestamp_microsec
});
return await receivePort.first;
}