public class TextureBuffer extends java.lang.Object implements VideoFrame.TextureBuffer, io.agora.base.internal.video.IHandlerReplaceable
VideoFrame.TextureBuffer.ContextType, VideoFrame.TextureBuffer.Type
Constructor and Description |
---|
TextureBuffer(android.opengl.EGLContext sharedContext,
int width,
int height,
VideoFrame.TextureBuffer.Type type,
int id,
Matrix transformMatrix,
Handler toI420Handler,
io.agora.base.internal.video.YuvConverter yuvConverter,
java.lang.Runnable releaseCallback)
Constructs a new TextureBuffer backed by the given texture id.
|
TextureBuffer(io.agora.base.internal.video.EglBase.Context eglContext,
int width,
int height,
VideoFrame.TextureBuffer.Type type,
int id,
Matrix transformMatrix,
Handler toI420Handler,
io.agora.base.internal.video.YuvConverter yuvConverter,
java.lang.Runnable releaseCallback) |
TextureBuffer(io.agora.base.internal.video.EglBase.Context eglContext,
int width,
int height,
VideoFrame.TextureBuffer.Type type,
int id,
Matrix transformMatrix,
Handler toI420Handler,
io.agora.base.internal.video.YuvConverter yuvConverter,
java.lang.Runnable releaseCallback,
int sequence)
Constructs a new TextureBuffer backed by the given texture id
|
TextureBuffer(javax.microedition.khronos.egl.EGLContext sharedContext,
int width,
int height,
VideoFrame.TextureBuffer.Type type,
int id,
Matrix transformMatrix,
Handler toI420Handler,
io.agora.base.internal.video.YuvConverter yuvConverter,
java.lang.Runnable releaseCallback)
Constructs a new TextureBuffer backed by the given texture id.
|
Modifier and Type | Method and Description |
---|---|
VideoFrame.Buffer |
applyNewI420Handler(Handler toI420Handler,
io.agora.base.internal.video.YuvConverter yuvConverter)
Create a new TextureBuffer with an applied transform toI420Handler and a new yuvConverter.
|
TextureBuffer |
applyTransformMatrix(Matrix transformMatrix,
int newWidth,
int newHeight)
Create a new TextureBuffer with an applied transform matrix and a new size.
|
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|.
|
io.agora.base.internal.video.EglBase.Context |
getEglBaseContext()
Retrieve the wrapped eglcontext
EglBase.Context |
int |
getEglContextType() |
int |
getHeight()
Resolution of the buffer in pixels.
|
long |
getNativeEglContext() |
int |
getSequence()
Sequence number managed by texture buffer creator.
|
int |
getTextureId() |
Handler |
getToI420Handler() |
Matrix |
getTransformMatrix()
Retrieve the transform matrix associated with the frame.
|
float[] |
getTransformMatrixArray() |
VideoFrame.TextureBuffer.Type |
getType() |
int |
getWidth()
Resolution of the buffer in pixels.
|
io.agora.base.internal.video.YuvConverter |
getYuvConverter() |
VideoFrame.Buffer |
mirror(int frameRotation)
Apply mirror
|
void |
release()
Decreases ref count by one.
|
void |
retain()
Increases ref count by one.
|
VideoFrame.Buffer |
rotate(int frameRotation)
Apply rotate
|
VideoFrame.I420Buffer |
toI420()
Returns a memory-backed frame in I420 format.
|
VideoFrame.Buffer |
transform(int cropX,
int cropY,
int cropWidth,
int cropHeight,
int scaleWidth,
int scaleHeight,
int rotation)
Apply crop/scale/mirror/rotate
|
TextureBuffer |
withSequence(int sequence) |
public TextureBuffer(javax.microedition.khronos.egl.EGLContext sharedContext, int width, int height, VideoFrame.TextureBuffer.Type type, int id, Matrix transformMatrix, Handler toI420Handler, io.agora.base.internal.video.YuvConverter yuvConverter, java.lang.Runnable releaseCallback)
sharedContext
- egl 1.0 EGLContext javax.microedition.khronos.egl.EGLContext
width
- widthheight
- heighttype
- texture type TextureBuffer.Type
id
- texture idtransformMatrix
- the transform matrix associated with the texture idtoI420Handler
- nullable, the Handler
related to the GL thread which create the
textureyuvConverter
- nullable, yuv converter YuvConverter
releaseCallback
- nullable, invoked the this buffer released.public TextureBuffer(android.opengl.EGLContext sharedContext, int width, int height, VideoFrame.TextureBuffer.Type type, int id, Matrix transformMatrix, Handler toI420Handler, io.agora.base.internal.video.YuvConverter yuvConverter, java.lang.Runnable releaseCallback)
sharedContext
- egl 1.4 EGLContextt android.opengl.EGLContext
width
- widthheight
- heighttype
- texture type TextureBuffer.Type
id
- texture idtransformMatrix
- the transform matrix associated with the texture idtoI420Handler
- nullable, the Handler
related to the GL thread which create the
textureyuvConverter
- nullable, yuv converter YuvConverter
releaseCallback
- nullable, invoked the this buffer released.public TextureBuffer(io.agora.base.internal.video.EglBase.Context eglContext, int width, int height, VideoFrame.TextureBuffer.Type type, int id, Matrix transformMatrix, Handler toI420Handler, io.agora.base.internal.video.YuvConverter yuvConverter, java.lang.Runnable releaseCallback)
public TextureBuffer(io.agora.base.internal.video.EglBase.Context eglContext, int width, int height, VideoFrame.TextureBuffer.Type type, int id, Matrix transformMatrix, Handler toI420Handler, io.agora.base.internal.video.YuvConverter yuvConverter, java.lang.Runnable releaseCallback, int sequence)
eglContext
- wrapped eglContextwidth
- widthheight
- heighttype
- texture type TextureBuffer.Type
id
- texture idtransformMatrix
- the transform matrix associated with the texture idtoI420Handler
- nullable, the Handler
related to the GL thread which create the
textureyuvConverter
- nullable, yuv converter YuvConverter
releaseCallback
- nullable, invoked the this buffer released.public TextureBuffer withSequence(int sequence)
public VideoFrame.TextureBuffer.Type getType()
getType
in interface VideoFrame.TextureBuffer
public int getTextureId()
getTextureId
in interface VideoFrame.TextureBuffer
public Matrix getTransformMatrix()
VideoFrame.TextureBuffer
getTransformMatrix
in interface VideoFrame.TextureBuffer
public io.agora.base.internal.video.EglBase.Context getEglBaseContext()
VideoFrame.TextureBuffer
EglBase.Context
getEglBaseContext
in interface VideoFrame.TextureBuffer
public long getNativeEglContext()
getNativeEglContext
in interface VideoFrame.TextureBuffer
public int getEglContextType()
getEglContextType
in interface VideoFrame.TextureBuffer
public float[] getTransformMatrixArray()
getTransformMatrixArray
in interface VideoFrame.TextureBuffer
public int getSequence()
VideoFrame.TextureBuffer
getSequence
in interface VideoFrame.TextureBuffer
public int getWidth()
VideoFrame.Buffer
getWidth
in interface VideoFrame.Buffer
public int getHeight()
VideoFrame.Buffer
getHeight
in interface VideoFrame.Buffer
public io.agora.base.internal.video.YuvConverter getYuvConverter()
getYuvConverter
in interface io.agora.base.internal.video.IHandlerReplaceable
public Handler getToI420Handler()
getToI420Handler
in interface io.agora.base.internal.video.IHandlerReplaceable
public VideoFrame.Buffer applyNewI420Handler(Handler toI420Handler, io.agora.base.internal.video.YuvConverter yuvConverter)
applyNewI420Handler
in interface io.agora.base.internal.video.IHandlerReplaceable
public VideoFrame.I420Buffer toI420()
VideoFrame.Buffer
toI420
in interface VideoFrame.Buffer
public void retain()
VideoFrame.Buffer
retain
in interface VideoFrame.Buffer
public void release()
VideoFrame.Buffer
release
in interface VideoFrame.Buffer
public VideoFrame.Buffer cropAndScale(int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight)
VideoFrame.Buffer
cropAndScale
in interface VideoFrame.Buffer
public VideoFrame.Buffer mirror(int frameRotation)
VideoFrame.Buffer
mirror
in interface VideoFrame.Buffer
public VideoFrame.Buffer rotate(int frameRotation)
VideoFrame.Buffer
rotate
in interface VideoFrame.Buffer
public VideoFrame.Buffer transform(int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight, int rotation)
VideoFrame.Buffer
transform
in interface VideoFrame.Buffer
public TextureBuffer applyTransformMatrix(Matrix transformMatrix, int newWidth, int newHeight)