Skip to content

VideoFrame.copyTo ​

JS
Promise<Object[]> VideoFrame.copyTo(ArrayBuffer|TypedArray destination, Object options)

功能描述

把本帧像素拷到 destination。

参数

  • ArrayBuffer / TypedArray destination: 目标缓冲。byteLength 必须不小于 allocationSize(options)
  • Object options: 可选拷贝参数

options 的属性说明:

属性键值类型默认值是否必填说明
rectObject整幅 visibleRect否{ x, y, width, height },数值向下取整
layoutObject[]紧凑排布否单平面 { offset, stride }
formatstring"RGBA"否目标像素格式
colorSpacestring"srgb"否目标色彩空间。

返回值

  • Promise: 成功时 resolve 为 [{ offset, stride }]