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

Public Member Functions

 TextureBufferImpl (int width, int height, Type type, int id, Matrix transformMatrix, SurfaceTextureHelper surfaceTextureHelper, Runnable releaseCallback)
 
VideoFrame.TextureBuffer.Type getType ()
 
int getTextureId ()
 
Matrix getTransformMatrix ()
 
int getWidth ()
 
int getHeight ()
 
VideoFrame.I420Buffer toI420 ()
 
void retain ()
 
void release ()
 
VideoFrame.Buffer cropAndScale (int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight)
 

Detailed Description

Android texture buffer backed by a SurfaceTextureHelper's texture. The buffer calls |releaseCallback| when it is released.

Member Function Documentation

◆ getTransformMatrix()

Matrix io.agora.rtc.gl.TextureBufferImpl.getTransformMatrix ( )

Retrieve the transform matrix associated with the frame. This transform matrix maps 2D homogeneous coordinates of the form (s, t, 1) with s and t in the inclusive range [0, 1] to the coordinate that should be used to sample that location from the buffer.

Implements io.agora.rtc.gl.VideoFrame.TextureBuffer.

◆ getWidth()

int io.agora.rtc.gl.TextureBufferImpl.getWidth ( )

Resolution of the buffer in pixels.

Implements io.agora.rtc.gl.VideoFrame.Buffer.

◆ toI420()

VideoFrame.I420Buffer io.agora.rtc.gl.TextureBufferImpl.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.

Implements io.agora.rtc.gl.VideoFrame.Buffer.

◆ retain()

void io.agora.rtc.gl.TextureBufferImpl.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.

Implements io.agora.rtc.gl.VideoFrame.Buffer.

◆ cropAndScale()

VideoFrame.Buffer io.agora.rtc.gl.TextureBufferImpl.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|.

Implements io.agora.rtc.gl.VideoFrame.Buffer.