前景提要
electron app 有一个 DLL 库 方法是这样定义的 SMART_EXPORTS bool getCameraFrameRGB(int handle, unsigned char *pdata, int *height, int *width, int channels, int type);
其中的第二个参数 unsigned char *pdata
不太清楚用什么方式去调用
尝试过好几种方案 都有问题
要么调用结束后获取到值为 0 要么控制台崩溃 let VEncode = new ffi.Library(dllFilePath, { getCameraFrameRGB: [ ref.types.bool, [ ref.types.int, ref.refType(ref.types.uchar), 'int *', 'int *', ref.types.int, ref.types.int ] ], // 获取图片数据 })