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

Public Member Functions

 TextureBufferImpl (EglBase.Context eglContext, int width, int height, Type type, int id, Matrix transformMatrix, Handler toI420Handler, YuvConverter yuvConverter, Runnable releaseCallback, int sequence)
 
 TextureBufferImpl (EglBase.Context eglContext, int width, int height, Type type, int id, Matrix transformMatrix, Handler toI420Handler, YuvConverter yuvConverter, Runnable releaseCallback)
 
Type getType ()
 
int getTextureId ()
 
Matrix getTransformMatrix ()
 
EglBase.Context getEglBaseContext ()
 
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)
 
VideoFrame.Buffer mirror (int frameRotation)
 
VideoFrame.TextureBuffer rotate (int degrees)
 
long getNativeEglContext ()
 
int getEglContextType ()
 
YuvConverter getYuvConverter ()
 
Handler getToI420Handler ()
 
float[] getTransformMatrixArray ()
 
VideoFrame.Buffer transform (int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight, int rotation)
 
- Public Member Functions inherited from io.agora.base.TextureBuffer
 TextureBuffer (@NonNull javax.microedition.khronos.egl.EGLContext sharedContext, int width, int height, Type type, int id, Matrix transformMatrix, @Nullable Handler toI420Handler, @Nullable YuvConverter yuvConverter, @Nullable Runnable releaseCallback)
 
 TextureBuffer (@NonNull android.opengl.EGLContext sharedContext, int width, int height, Type type, int id, Matrix transformMatrix, @Nullable Handler toI420Handler, @Nullable YuvConverter yuvConverter, @Nullable Runnable releaseCallback)
 
 TextureBuffer (@NonNull EglBase.Context eglContext, int width, int height, Type type, int id, Matrix transformMatrix, @Nullable Handler toI420Handler, @Nullable YuvConverter yuvConverter, @Nullable Runnable releaseCallback)
 
TextureBuffer applyNewI420Handler ( @NonNull Handler toI420Handler, @NonNull YuvConverter yuvConverter)
 
TextureBuffer applyTransformMatrix (Matrix transformMatrix, int newWidth, int newHeight)
 

Detailed Description

Android texture buffer that glues together the necessary information together with a generic release callback. ToI420() is implemented by providing a Handler and a YuvConverter.

Member Function Documentation

◆ getTextureId()

int io.agora.mediaplayer.gl.TextureBufferImpl.getTextureId ( )
Returns
texture id

Reimplemented from io.agora.base.TextureBuffer.

◆ getTransformMatrix()

Matrix io.agora.mediaplayer.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.

Reimplemented from io.agora.base.TextureBuffer.

◆ getEglBaseContext()

EglBase.Context io.agora.mediaplayer.gl.TextureBufferImpl.getEglBaseContext ( )

Retrieve the wrapped eglcontext EglBase.Context

Reimplemented from io.agora.base.TextureBuffer.

◆ getWidth()

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

Resolution of the buffer in pixels.

Returns
width.

Reimplemented from io.agora.base.TextureBuffer.

◆ getHeight()

int io.agora.mediaplayer.gl.TextureBufferImpl.getHeight ( )

Resolution of the buffer in pixels.

Returns
height.

Reimplemented from io.agora.base.TextureBuffer.

◆ toI420()

VideoFrame.I420Buffer io.agora.mediaplayer.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.

Note
invoke release() to release the memory or decreases ref count by one, otherwise memory may be leaked.

Reimplemented from io.agora.base.TextureBuffer.

◆ retain()

void io.agora.mediaplayer.gl.TextureBufferImpl.retain ( )

Increases ref count by one.

Reimplemented from io.agora.base.TextureBuffer.

◆ release()

void io.agora.mediaplayer.gl.TextureBufferImpl.release ( )

Decreases ref count by one. When the ref count reaches zero, resources related to the object will be freed.

Reimplemented from io.agora.base.TextureBuffer.

◆ cropAndScale()

VideoFrame.Buffer io.agora.mediaplayer.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|.

Returns
a new buffer which match the request, null if not supported.
Note
invoke release() to release the memory or decreases ref count by one, otherwise memory may be leaked.

Reimplemented from io.agora.base.TextureBuffer.

◆ mirror()

VideoFrame.Buffer io.agora.mediaplayer.gl.TextureBufferImpl.mirror ( int  frameRotation)

Apply mirror

Returns
a new buffer which match the request, null if not supported.
Note
invoke release() to release the memory or decreases ref count by one, otherwise memory may be leaked.

Reimplemented from io.agora.base.TextureBuffer.

◆ rotate()

VideoFrame.TextureBuffer io.agora.mediaplayer.gl.TextureBufferImpl.rotate ( int  frameRotation)

Apply rotate

Returns
a new buffer which match the request, null if not supported.
Note
invoke release() to release the memory or decreases ref count by one, otherwise memory may be leaked.

Reimplemented from io.agora.base.TextureBuffer.

◆ transform()

VideoFrame.Buffer io.agora.mediaplayer.gl.TextureBufferImpl.transform ( int  cropX,
int  cropY,
int  cropWidth,
int  cropHeight,
int  scaleWidth,
int  scaleHeight,
int  frameRotation 
)

Apply crop/scale/mirror/rotate

Returns
a new buffer which match the request, null if not supported.
Note
invoke release() to release the memory or decreases ref count by one, otherwise memory may be leaked.

Reimplemented from io.agora.base.TextureBuffer.