Agora Java API Reference for Android
|
Public Member Functions | |
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, @NonNull Handler toI420Handler, @NonNull 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, int sequence) | |
TextureBuffer | withSequence (int sequence) |
VideoFrame.TextureBuffer.Type | getType () |
int | getTextureId () |
Matrix | getTransformMatrix () |
EglBase.Context | getEglBaseContext () |
long | getNativeEglContext () |
int | getEglContextType () |
float[] | getTransformMatrixArray () |
int | getSequence () |
int | getWidth () |
int | getHeight () |
YuvConverter | getYuvConverter () |
Handler | getToI420Handler () |
VideoFrame.Buffer | applyNewI420Handler ( @NonNull Handler toI420Handler, @NonNull YuvConverter yuvConverter) |
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.Buffer | rotate (int frameRotation) |
VideoFrame.Buffer | transform (int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight, int rotation) |
TextureBuffer | applyTransformMatrix (Matrix transformMatrix, int newWidth, int newHeight) |
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.
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 | ||
) |
Constructs a new TextureBuffer backed by the given texture id.
sharedContext | egl 1.0 EGLContext javax.microedition.khronos.egl.EGLContext |
width | width |
height | height |
type | texture type TextureBuffer.Type |
id | texture id |
transformMatrix | the transform matrix associated with the texture id |
toI420Handler | nullable, the Handler related to the GL thread which create the texture |
yuvConverter | nullable, yuv converter YuvConverter |
releaseCallback | nullable, invoked the this buffer released. |
@apiNote either toI420Handler or yuvConverter is null, toI420() will throw exception, but sdk will try to complete these two parameter in some inner component.
io.agora.base.TextureBuffer.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 | ||
) |
Constructs a new TextureBuffer backed by the given texture id.
sharedContext | egl 1.4 EGLContextt android.opengl.EGLContext |
width | width |
height | height |
type | texture type TextureBuffer.Type |
id | texture id |
transformMatrix | the transform matrix associated with the texture id |
toI420Handler | nullable, the Handler related to the GL thread which create the texture |
yuvConverter | nullable, yuv converter YuvConverter |
releaseCallback | nullable, invoked the this buffer released. |
@apiNote either toI420Handler or yuvConverter is null, toI420() will throw exception, but sdk will try to complete these two parameter in some inner component.
io.agora.base.TextureBuffer.TextureBuffer | ( | @NonNull EglBase.Context | eglContext, |
int | width, | ||
int | height, | ||
Type | type, | ||
int | id, | ||
Matrix | transformMatrix, | ||
@Nullable Handler | toI420Handler, | ||
@Nullable YuvConverter | yuvConverter, | ||
@Nullable Runnable | releaseCallback, | ||
int | sequence | ||
) |
Constructs a new TextureBuffer backed by the given texture id
eglContext | wrapped eglContext |
width | width |
height | height |
type | texture type TextureBuffer.Type |
id | texture id |
transformMatrix | the transform matrix associated with the texture id |
toI420Handler | nullable, the Handler related to the GL thread which create the texture |
yuvConverter | nullable, yuv converter YuvConverter |
releaseCallback | nullable, invoked the this buffer released. |
@apiNote either toI420Handler or yuvConverter is null, toI420() will throw exception, but sdk will try to complete these two parameter in some inner component.
int io.agora.base.TextureBuffer.getTextureId | ( | ) |
Implements io.agora.base.VideoFrame.TextureBuffer.
Matrix io.agora.base.TextureBuffer.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.base.VideoFrame.TextureBuffer.
EglBase.Context io.agora.base.TextureBuffer.getEglBaseContext | ( | ) |
Retrieve the wrapped eglcontext EglBase.Context
Implements io.agora.base.VideoFrame.TextureBuffer.
int io.agora.base.TextureBuffer.getSequence | ( | ) |
Sequence number managed by texture buffer creator.
Implements io.agora.base.VideoFrame.TextureBuffer.
int io.agora.base.TextureBuffer.getWidth | ( | ) |
int io.agora.base.TextureBuffer.getHeight | ( | ) |
VideoFrame.Buffer io.agora.base.TextureBuffer.applyNewI420Handler | ( | @NonNull Handler | toI420Handler, |
@NonNull YuvConverter | yuvConverter | ||
) |
Create a new TextureBuffer with an applied transform toI420Handler and a new yuvConverter. The existing buffer is unchanged.
VideoFrame.I420Buffer io.agora.base.TextureBuffer.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.base.VideoFrame.Buffer.
void io.agora.base.TextureBuffer.retain | ( | ) |
Increases ref count by one.
Implements io.agora.base.VideoFrame.Buffer.
void io.agora.base.TextureBuffer.release | ( | ) |
Decreases ref count by one. When the ref count reaches zero, resources related to the object will be freed.
Implements io.agora.base.VideoFrame.Buffer.
VideoFrame.Buffer io.agora.base.TextureBuffer.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.base.VideoFrame.Buffer.
VideoFrame.Buffer io.agora.base.TextureBuffer.mirror | ( | int | frameRotation | ) |
Apply mirror
Implements io.agora.base.VideoFrame.Buffer.
VideoFrame.Buffer io.agora.base.TextureBuffer.rotate | ( | int | frameRotation | ) |
Apply rotate
Implements io.agora.base.VideoFrame.Buffer.
VideoFrame.Buffer io.agora.base.TextureBuffer.transform | ( | int | cropX, |
int | cropY, | ||
int | cropWidth, | ||
int | cropHeight, | ||
int | scaleWidth, | ||
int | scaleHeight, | ||
int | frameRotation | ||
) |
Apply crop/scale/mirror/rotate
Implements io.agora.base.VideoFrame.Buffer.
TextureBuffer io.agora.base.TextureBuffer.applyTransformMatrix | ( | Matrix | transformMatrix, |
int | newWidth, | ||
int | newHeight | ||
) |
Create a new TextureBuffer with an applied transform matrix and a new size. The existing buffer is unchanged. The given transform matrix is applied first when texture coordinates are still in the unmodified [0, 1] range.