提交 8f0023b6 编写于 作者: Z zhang-xiaobo1997

add imageReceiver use

Signed-off-by: Nzhang-xiaobo1997 <tony.zhangxiaobo@huawei.com>
上级 956eef68
...@@ -258,16 +258,36 @@ imagePackerApi.packing(imageSourceApi, packOpts) ...@@ -258,16 +258,36 @@ imagePackerApi.packing(imageSourceApi, packOpts)
//编码完成,释放imagepacker //编码完成,释放imagepacker
imagePackerApi.release(); imagePackerApi.release();
//用于获取imagesource信息 //用于获取imagesource信息
imageSourceApi.getImageInfo(imageInfo => { imageSourceApi.getImageInfo(imageInfo => {
console.info('TC_045 imageInfo'); console.info('TC_045 imageInfo');
expect(imageInfo !== null).assertTrue(); expect(imageInfo !== null).assertTrue();
done(); done();
}) })
//用于更新增量数据 //用于更新增量数据
imageSourceIncrementalSApi.updateData(array, false, 0, 10,(error,data )=> {}) imageSourceIncrementalSApi.updateData(array, false, 0, 10,(error,data )=> {})
``` ```
### ImageReceivert的使用
```js
//创建ImageReceiver
var receiver = image.createImageReceiver(8 * 1024, 8, image.ImageFormat.JPEG, 1);
//获取Surface ID
var surfaceId = await receiver.getReceivingSurfaceId();
receiver.on('imageArrival', () => {
//去获取Surface中的buffer的方法
receiver.readNextImage((err, img) => {
img.getComponent(4, (err, componet) => {
//操作componet.byteBuffer
})
})
})
//调用方法将surfaceId传递给消费端。
```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册