decodeSingleFrameImage method
Implementation
@override
Future<Frame> decodeSingleFrameImage({required Uint8List avifBytes}) {
final request = KeyRequest(
key: "",
data: avifBytes,
).writeToBuffer();
final nativeRequest = toPointer(request);
final completer = Completer<Frame>();
final port = RawReceivePort();
port.handler = (response) {
port.close();
final frame = Frame.fromBuffer(response);
completer.complete(frame);
};
flutterAvifFFI.decode_single_frame_image(
port.sendPort.nativePort,
nativeRequest[0],
nativeRequest[1],
);
malloc.free(nativeRequest[0]);
return completer.future;
}