Agora Java API Reference for Android
Public Member Functions | List of all members
io.agora.rtc.mediaio.IVideoFrameConsumer Interface Reference
Inheritance diagram for io.agora.rtc.mediaio.IVideoFrameConsumer:
io.agora.rtc.mediaio.IVideoSink io.agora.rtc.mediaio.VideoFrameConsumerImpl io.agora.rtc.mediaio.AgoraDefaultRender io.agora.rtc.mediaio.AgoraSurfaceView io.agora.rtc.mediaio.AgoraTextureView

Public Member Functions

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)
 

Detailed Description

The IVideoFrameConsumer object passed by the Media Engine.

Reserve this object and then pass the video frame to the Media Engine through this object once the video source is initialized.

The IVideoFrameConsumer object supports video data in three buffer types: Byte buffer type, byte array frame type, and texture frame type. Call the getBufferType method to specify a buffer type. The video data can only be transmitted in the corresponding type.

Member Function Documentation

◆ consumeByteBufferFrame()

void io.agora.rtc.mediaio.IVideoFrameConsumer.consumeByteBufferFrame ( ByteBuffer  buffer,
int  format,
int  width,
int  height,
int  rotation,
long  timestamp 
)

Receives the video frame in a byte buffer.

Parameters
bufferVideo in the format of ByteBuffer
formatPixel format of the video frame:
widthWidth of the video frame
heightHeight of the video frame
rotationClockwise rotating angle (0, 90, 180, and 270 degrees) of the video frame
timestampTimestamp of the video frame. For each video frame, you need to set a timestamp

Implemented in io.agora.rtc.mediaio.AgoraTextureView, io.agora.rtc.mediaio.AgoraSurfaceView, io.agora.rtc.mediaio.AgoraDefaultRender, and io.agora.rtc.mediaio.VideoFrameConsumerImpl.

◆ consumeByteArrayFrame()

void io.agora.rtc.mediaio.IVideoFrameConsumer.consumeByteArrayFrame ( byte []  data,
int  format,
int  width,
int  height,
int  rotation,
long  timestamp 
)

Receives the video frame in a byte array.

Parameters
dataVideo in the format of ByteArray
formatPixel format of the video frame:
widthWidth of the video frame
heightHeight of the video frame
rotationClockwise rotating angle (0, 90, 180, and 270 degrees) of the video frame
timestampTimestamp of the video frame. For each video frame, you need to set a timestamp

Implemented in io.agora.rtc.mediaio.AgoraTextureView, io.agora.rtc.mediaio.AgoraSurfaceView, io.agora.rtc.mediaio.AgoraDefaultRender, and io.agora.rtc.mediaio.VideoFrameConsumerImpl.

◆ consumeTextureFrame()

void io.agora.rtc.mediaio.IVideoFrameConsumer.consumeTextureFrame ( int  textureId,
int  format,
int  width,
int  height,
int  rotation,
long  timestamp,
float []  matrix 
)

Receives the video frame in texture.

Parameters
textureIdID of the texture
formatPixel format of the video frame:
widthWidth of the video frame
heightHeight of the video frame
rotationClockwise rotating angle (0, 90, 180, and 270 degrees) of the video frame
timestampTimestamp of the video frame. For each video frame, you need to set a timestamp
matrixMatrix of the texture. The float value is between 0 and 1, such as 0.1, 0.2, and so on

Implemented in io.agora.rtc.mediaio.AgoraTextureView, io.agora.rtc.mediaio.AgoraSurfaceView, io.agora.rtc.mediaio.AgoraDefaultRender, and io.agora.rtc.mediaio.VideoFrameConsumerImpl.