Agora Java API Reference for Android

Public Member Functions | Public Attributes | Static Public Attributes | List of all members
io.agora.rtc2.video.AgoraVideoFrame Class Reference

The external video frame. More...

## Public Member Functions
String | toString ()

## Public Attributes
int | format
long | timeStamp
int | stride
int | height
int | textureID
boolean | syncMode
float[] | transform
javax.microedition.khronos.egl.EGLContext | eglContext10
android.opengl.EGLContext | eglContext14
byte[] | buf
int | cropLeft
int | cropTop
int | cropRight
int | cropBottom
int | rotation
AlphaStitchMode | alphaStitchMode

## Static Public Attributes
static final int | FORMAT_NONE = -1
static final int | FORMAT_TEXTURE_2D = 10
static final int | FORMAT_TEXTURE_OES = 11
static final int | FORMAT_I420 = 1
static final int | FORMAT_BGRA = 2
static final int | FORMAT_NV21 = 3
static final int | FORMAT_RGBA = 4
static final int | FORMAT_I422 = 16
static final int | BUFFER_TYPE_NONE = -1
static final int | BUFFER_TYPE_BUFFER = 1
static final int | BUFFER_TYPE_ARRAY = 2
static final int | BUFFER_TYPE_TEXTURE = 3

## Detailed Description

The external video frame.

## Member Data Documentation

## ◆ FORMAT_NONE

final int io.agora.rtc2.video.AgoraVideoFrame.FORMAT_NONE = -1
| static

-1: No video format.

## ◆ FORMAT_TEXTURE_2D

final int io.agora.rtc2.video.AgoraVideoFrame.FORMAT_TEXTURE_2D = 10
| static

10: The video format is TEXTURE_2D.

## ◆ FORMAT_TEXTURE_OES

final int io.agora.rtc2.video.AgoraVideoFrame.FORMAT_TEXTURE_OES = 11
| static

11: The video format is TEXTURE_OES.

## ◆ FORMAT_I420

final int io.agora.rtc2.video.AgoraVideoFrame.FORMAT_I420 = 1
| static

1: The video format is I420.

## ◆ FORMAT_BGRA

final int io.agora.rtc2.video.AgoraVideoFrame.FORMAT_BGRA = 2
| static

2: The video format is BGRA.

## ◆ FORMAT_NV21

final int io.agora.rtc2.video.AgoraVideoFrame.FORMAT_NV21 = 3
| static

3: The video format is NV21.

## ◆ FORMAT_RGBA

final int io.agora.rtc2.video.AgoraVideoFrame.FORMAT_RGBA = 4
| static

4: The video format is RGBA.

## ◆ FORMAT_I422

final int io.agora.rtc2.video.AgoraVideoFrame.FORMAT_I422 = 16
| static

16: Video frame in the format of I422.

## ◆ BUFFER_TYPE_NONE

final int io.agora.rtc2.video.AgoraVideoFrame.BUFFER_TYPE_NONE = -1
| static

-1: No buffer type.

## ◆ BUFFER_TYPE_BUFFER

final int io.agora.rtc2.video.AgoraVideoFrame.BUFFER_TYPE_BUFFER = 1
| static

1: The buffer type is buffer.

## ◆ BUFFER_TYPE_ARRAY

final int io.agora.rtc2.video.AgoraVideoFrame.BUFFER_TYPE_ARRAY = 2
| static

2: The buffer type is array.

## ◆ BUFFER_TYPE_TEXTURE

final int io.agora.rtc2.video.AgoraVideoFrame.BUFFER_TYPE_TEXTURE = 3
| static

3: The buffer type is texture.

## ◆ format

int io.agora.rtc2.video.AgoraVideoFrame.format

The format of the video data:

- 10: TEXTURE_2D
- 11: TEXTURE_OES, usually the data captured by the camera is in this format.
- 1: I420
- 3: NV21
- 4: RGBA
- 16: I422

## ◆ timeStamp

long io.agora.rtc2.video.AgoraVideoFrame.timeStamp

Timestamp (ms) of the incoming video frame. An incorrect timestamp results in frame loss or unsynchronized audio and video.

## ◆ stride

int io.agora.rtc2.video.AgoraVideoFrame.stride

Line spacing of the incoming video frame, which must be in pixels instead of bytes. For textures, it is the width of the texture.

## ◆ height

int io.agora.rtc2.video.AgoraVideoFrame.height

Height of the incoming video frame.

## ◆ textureID

int io.agora.rtc2.video.AgoraVideoFrame.textureID

Texture ID of the frame. This parameter only applies to video data in Texture format.

## ◆ syncMode

boolean io.agora.rtc2.video.AgoraVideoFrame.syncMode

Set whether to enable the synchronization mode. After enabling, the SDK waits while Texture processing. This parameter only applies to video data in Texture format.

- `true`: Enable sync mode.
- `false`: Disable sync mode.

## ◆ transform

float [] io.agora.rtc2.video.AgoraVideoFrame.transform

Additional transform of Texture frames. This parameter only applies to video data in Texture format.

## ◆ eglContext10

javax.microedition.khronos.egl.EGLContext io.agora.rtc2.video.AgoraVideoFrame.eglContext10

EGLContext10. This parameter only applies to video data in Texture format.

## ◆ eglContext14

android.opengl.EGLContext io.agora.rtc2.video.AgoraVideoFrame.eglContext14

EGLContext14. This parameter only applies to video data in Texture format.

## ◆ buf

byte [] io.agora.rtc2.video.AgoraVideoFrame.buf

Video frame buffer.

## ◆ cropLeft

int io.agora.rtc2.video.AgoraVideoFrame.cropLeft

Raw data related parameter. The number of pixels trimmed from the left. The default value is 0.

## ◆ cropTop

int io.agora.rtc2.video.AgoraVideoFrame.cropTop

Raw data related parameter. The number of pixels trimmed from the top. The default value is 0.

## ◆ cropRight

int io.agora.rtc2.video.AgoraVideoFrame.cropRight

Raw data related parameter. The number of pixels trimmed from the right. The default value is 0.

## ◆ cropBottom

int io.agora.rtc2.video.AgoraVideoFrame.cropBottom

Raw data related parameter. The number of pixels trimmed from the bottom. The default value is 0.

## ◆ rotation

int io.agora.rtc2.video.AgoraVideoFrame.rotation

Raw data related parameter. The clockwise rotation of the video frame. You can set the rotation angle as 0, 90, 180, or 270. The default value is 0.

## ◆ alphaStitchMode

AlphaStitchMode io.agora.rtc2.video.AgoraVideoFrame.alphaStitchMode

When the video frame contains alpha channel data, it represents the relative position of `alphaBuffer` and the video frame.

- ALPHA_NO_STITCH 0: (Default) Only video frame, that is, `alphaBuffer` is not stitched with the video frame.
- ALPHA_STITCH_UP (1): `alphaBuffer` is above the video frame.
- ALPHA_STITCH_BELOW (2): `alphaBuffer` is below the video frame.
- ALPHA_STITCH_LEFT (3): `alphaBuffer` is to the left of the video frame.
- ALPHA_STITCH_RIGHT (4): `alphaBuffer` is to the right of the video frame.