被 io.agora.rtc.mediaio.IVideoSink 继承.
|
void | consumeByteBufferFrame (ByteBuffer buffer, int format, int width, int height, int rotation, long timestamp) |
|
void | consumeByteArrayFrame (byte[] data, int format, int width, int height, int rotation, long timestamp) |
|
void | consumeTextureFrame (int textureId, int format, int width, int height, int rotation, long timestamp, float[] matrix) |
|
IVideoFrameConsumer 类,支持接收三种 Buffer 类型的视频帧数据:ByteBuffer、ByteArray 和 Texture。请调用 getBufferType
方法指定 Buffer 类型。
◆ consumeByteBufferFrame()
void io.agora.rtc.mediaio.IVideoFrameConsumer.consumeByteBufferFrame |
( |
ByteBuffer |
buffer, |
|
|
int |
format, |
|
|
int |
width, |
|
|
int |
height, |
|
|
int |
rotation, |
|
|
long |
timestamp |
|
) |
| |
接收 ByteBuffer 类型的视频帧。
- 参数
-
buffer | Byte Buffer 型的视频数据。 |
format | 像素格式:
|
- 注解
- SDK 目前不支持 alpha 通道。传入的 alpha 值将被丢弃。
- 参数
-
width | 视频帧的宽度。 |
height | 视频帧的高度。 |
rotation | 视频帧顺时针旋转的角度。如果设置了旋转角度,媒体引擎会对图像进行旋转。你可以根据需要将角度值设为 0 度、90 度、180 度和 270 度,如果设置为其他数字,系统会自动忽略。 |
timestamp | 传入的视频帧的时间戳。开发者必须为每一个视频帧设置一个时间戳。 |
◆ consumeByteArrayFrame()
void io.agora.rtc.mediaio.IVideoFrameConsumer.consumeByteArrayFrame |
( |
byte[] |
data, |
|
|
int |
format, |
|
|
int |
width, |
|
|
int |
height, |
|
|
int |
rotation, |
|
|
long |
timestamp |
|
) |
| |
接收 ByteArray 类型的视频帧。
- 参数
-
data | Byte Array 型的数据数据。 |
format | 像素格式:
|
- 注解
- SDK 目前不支持 alpha 通道。传入的 alpha 值将被丢弃。
- 参数
-
width | 视频帧的宽度。 |
height | 视频帧的高度。 |
rotation | 视频帧顺时针旋转的角度。如果设置了旋转角度,媒体引擎会对图像进行旋转。你可以根据需要将角度值设为 0 度、90 度、180 度和 270 度,如果设置为其他数字,系统会自动忽略。 |
timestamp | 传入的视频帧的时间戳。开发者必须为每一个视频帧设置一个时间戳。 |
◆ consumeTextureFrame()
void io.agora.rtc.mediaio.IVideoFrameConsumer.consumeTextureFrame |
( |
int |
textureId, |
|
|
int |
format, |
|
|
int |
width, |
|
|
int |
height, |
|
|
int |
rotation, |
|
|
long |
timestamp, |
|
|
float[] |
matrix |
|
) |
| |
接收 Texture 类型的视频帧。
- 参数
-
textureId | Texture 的 ID。 |
format | 像素格式:
|
width | 视频帧的宽度。 |
height | 视频帧的高度。 |
rotation | 视频帧顺时针旋转的角度。如果设置了旋转角度,媒体引擎会对图像进行旋转。你可以根据需要将角度值设为 0 度、90 度、180 度和 270 度,如果设置为其他数字,系统会自动忽略。 |
timestamp | 传入的视频帧的时间戳。开发者必须为每一个视频帧设置一个时间戳。 |
matrix | texture 的纹理坐标。浮点数 float 一般介于 0~1 之间,如 0.1,0.2 等。 |