VideoFrame.copyTo
JS
Promise<Object[]> VideoFrame.copyTo(ArrayBuffer|TypedArray destination, Object options)功能描述
把本帧像素拷到 destination。
参数
- ArrayBuffer / TypedArray destination: 目标缓冲。
byteLength必须不小于allocationSize(options) - Object options: 可选拷贝参数
options 的属性说明:
| 属性 | 键值类型 | 默认值 | 是否必填 | 说明 |
|---|---|---|---|---|
| rect | Object | 整幅 visibleRect | 否 | { x, y, width, height },数值向下取整 |
| layout | Object[] | 紧凑排布 | 否 | 单平面 { offset, stride } |
| format | string | "RGBA" | 否 | 目标像素格式 |
| colorSpace | string | "srgb" | 否 | 目标色彩空间。 |
返回值
- Promise: 成功时 resolve 为
[{ offset, stride }]
