Agora Java API Reference for Android
|
Public Member Functions | |
NV21Buffer (byte[] data, int width, int height, @Nullable Runnable releaseCallback) | |
NV21Buffer (int width, int height, int stride, int sliceHeight, ByteBuffer buffer, @Nullable Runnable releaseCallback) | |
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.Buffer | rotate (int frameRotation) |
VideoFrame.Buffer | transform (int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight, int rotation) |
io.agora.base.NV21Buffer.NV21Buffer | ( | byte[] | data, |
int | width, | ||
int | height, | ||
@Nullable Runnable | releaseCallback | ||
) |
Constructs a new TextureBuffer backed by the given data.
data | buffer data |
width | width |
height | height |
releaseCallback | nullable, invoked the this buffer released. |
int io.agora.base.NV21Buffer.getWidth | ( | ) |
int io.agora.base.NV21Buffer.getHeight | ( | ) |
VideoFrame.I420Buffer io.agora.base.NV21Buffer.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.NV21Buffer.retain | ( | ) |
Increases ref count by one.
Implements io.agora.base.VideoFrame.Buffer.
void io.agora.base.NV21Buffer.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.NV21Buffer.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.NV21Buffer.mirror | ( | int | frameRotation | ) |
Apply mirror
Implements io.agora.base.VideoFrame.Buffer.
VideoFrame.Buffer io.agora.base.NV21Buffer.rotate | ( | int | frameRotation | ) |
Apply rotate
Implements io.agora.base.VideoFrame.Buffer.
VideoFrame.Buffer io.agora.base.NV21Buffer.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.