node-ffi 调用 DLL 变量类型的问题
时间: 2020-08-20来源:V2EX
前景提要
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 ] ], // 获取图片数据 })

科技资讯:

科技学院:

科技百科:

科技书籍:

网站大全:

软件大全:

热门排行