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

## 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 AgoraVideoFrame class, which defines the format of the external video source.

## 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

Format of the incoming video frame, which must be specified as one of the following:

- 10: (Default) GL_TEXTURE_2D
- 11: OES, typically from the camera
- 1: I420
- 3: NV21
- 4: RGBA

## ◆ timeStamp

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

The timestamp (ms) of this frame.

Note
  Ensure that you set the correct timestamp, or it may cause frame dropping.

## ◆ stride

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

The stride of this frame, which means the number of pixels between two consecutive rows.

Note
  - Set this member is in pixel, not byte.
  - If the video format is texture, set this member as the texture width.

## ◆ height

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

The height of this frame.

## ◆ textureID

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

The ID of the texture.

Note
  Applies to Android texture only.

## ◆ syncMode

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

Determines whether to enable the sync mode, which means that the SDK waits while the texture is being processed.

Note
  Applies to Android texture only.

## ◆ transform

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

The extra transform for the texture.

Note
  Applies to Android texture only.

## ◆ eglContext10

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

EGLContext10.

Note
  Applies to Android texture only.

## ◆ eglContext14

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

EGLContext14.

Note
  Applies to Android texture only.

## ◆ buf

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

The buffer of this frame.

Note
  Applies to non-texture frames.

## ◆ cropLeft

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

The number of pixels to crop from the left. Typically, set it as 0.

Note
  Applies to non-texture frames.

## ◆ cropTop

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

The number of pixels to crop from the top. Typically, set it as 0.

Note
  Applies to non-texture frames.

## ◆ cropRight

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

The number of pixels to crop from the right. Typically, set it as the value of （stride - width）.

Note
  Applies to non-texture frames.

## ◆ cropBottom

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

The number of pixels to crop from the bottom. Typically, set it as 0.

Note
  Applies to non-texture frames.

## ◆ rotation

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

The rotation information (clockwise) of this frame. Set it as 0, 90, 180, or 270.

## ◆ alphaStitchMode

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

The relative position between alphabuffer and the frame. The default value is AlphaStitchMode.ALPHA_NO_STITCH.