Agora Java API Reference for Android
Public Member Functions | List of all members
io.agora.rtc.gl.VideoFrame.Buffer Interface Reference
Inheritance diagram for io.agora.rtc.gl.VideoFrame.Buffer:
io.agora.rtc.gl.RgbaBuffer io.agora.rtc.gl.VideoFrame.I420Buffer io.agora.rtc.gl.VideoFrame.TextureBuffer io.agora.rtc.gl.JavaI420Buffer io.agora.rtc.gl.TextureBufferImpl

Public Member Functions

int getWidth ()
 
int getHeight ()
 
I420Buffer toI420 ()
 
void retain ()
 
void release ()
 
Buffer cropAndScale (int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight)
 

Member Function Documentation

◆ getWidth()

int io.agora.rtc.gl.VideoFrame.Buffer.getWidth ( )

Resolution of the buffer in pixels.

Implemented in io.agora.rtc.gl.JavaI420Buffer, io.agora.rtc.gl.TextureBufferImpl, and io.agora.rtc.gl.RgbaBuffer.

◆ toI420()

I420Buffer io.agora.rtc.gl.VideoFrame.Buffer.toI420 ( )

Returns a memory-backed frame in I420 format. If the pixel data is in another format, a conversion will take place. All implementations must provide a fallback to I420 for compatibility with e.g. the internal WebRTC software encoders.

Implemented in io.agora.rtc.gl.JavaI420Buffer, io.agora.rtc.gl.TextureBufferImpl, and io.agora.rtc.gl.RgbaBuffer.

◆ retain()

void io.agora.rtc.gl.VideoFrame.Buffer.retain ( )

Reference counting is needed since a video buffer can be shared between multiple VideoSinks, and the buffer needs to be returned to the VideoSource as soon as all references are gone.

Implemented in io.agora.rtc.gl.JavaI420Buffer, io.agora.rtc.gl.TextureBufferImpl, and io.agora.rtc.gl.RgbaBuffer.

◆ cropAndScale()

Buffer io.agora.rtc.gl.VideoFrame.Buffer.cropAndScale ( int  cropX,
int  cropY,
int  cropWidth,
int  cropHeight,
int  scaleWidth,
int  scaleHeight 
)

Crops a region defined by |cropx|, |cropY|, |cropWidth| and |cropHeight|. Scales it to size |scaleWidth| x |scaleHeight|.

Implemented in io.agora.rtc.gl.JavaI420Buffer, io.agora.rtc.gl.TextureBufferImpl, and io.agora.rtc.gl.RgbaBuffer.