Agora Java API Reference for Android
|
Public Member Functions | |
JavaI010Buffer (int width, int height, ByteBuffer dataY, int strideY, ByteBuffer dataU, int strideU, ByteBuffer dataV, int strideV, @Nullable Runnable releaseCallback) | |
ByteBuffer | getDataY () |
ByteBuffer | getDataV () |
ByteBuffer | getDataU () |
int | getHeight () |
int | getWidth () |
int | getStrideV () |
int | getStrideY () |
int | getStrideU () |
void | release () |
I420Buffer | toI420 () |
void | retain () |
VideoFrame.Buffer | cropAndScale (int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight) |
VideoFrame.Buffer | rotate (int frameRotation) |
VideoFrame.Buffer | transform (int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight, int rotation) |
VideoFrame.Buffer | mirror (int frameRotation) |
Static Public Member Functions | |
static JavaI010Buffer | wrap (int width, int height, ByteBuffer dataY, int strideY, ByteBuffer dataU, int strideU, ByteBuffer dataV, int strideV, @Nullable Runnable releaseCallback) |
static JavaI010Buffer | allocate (int width, int height) |
static I420Buffer | i010BufferToI420 (JavaI010Buffer buffer) |
Implementation of VideoFrame.I420Buffer backed by Java direct byte buffers.
io.agora.base.JavaI010Buffer.JavaI010Buffer | ( | int | width, |
int | height, | ||
ByteBuffer | dataY, | ||
int | strideY, | ||
ByteBuffer | dataU, | ||
int | strideU, | ||
ByteBuffer | dataV, | ||
int | strideV, | ||
@Nullable Runnable | releaseCallback | ||
) |
Constructs a new JavaI010Buffer backed by the given data
|
static |
Allocates an empty I010Buffer suitable for an image of the given dimensions.
width | width. |
height | height. |
ByteBuffer io.agora.base.JavaI010Buffer.getDataY | ( | ) |
Returns a direct ByteBuffer containing Y-plane data. The buffer capacity is at least getStrideY() * getHeight() bytes. The position of the returned buffer is ignored and must be 0. Callers may mutate the ByteBuffer (eg. through relative-read operations), so implementations must return a new ByteBuffer or slice for each call.
Implements io.agora.base.VideoFrame.I420Buffer.
ByteBuffer io.agora.base.JavaI010Buffer.getDataV | ( | ) |
Returns a direct ByteBuffer containing V-plane data. The buffer capacity is at least getStrideV() * ((getHeight() + 1) / 2) bytes. The position of the returned buffer is ignored and must be 0. Callers may mutate the ByteBuffer (eg. through relative-read operations), so implementations must return a new ByteBuffer or slice for each call.
Implements io.agora.base.VideoFrame.I420Buffer.
ByteBuffer io.agora.base.JavaI010Buffer.getDataU | ( | ) |
Returns a direct ByteBuffer containing U-plane data. The buffer capacity is at least getStrideU() * ((getHeight() + 1) / 2) bytes. The position of the returned buffer is ignored and must be 0. Callers may mutate the ByteBuffer (eg. through relative-read operations), so implementations must return a new ByteBuffer or slice for each call.
Implements io.agora.base.VideoFrame.I420Buffer.
int io.agora.base.JavaI010Buffer.getHeight | ( | ) |
int io.agora.base.JavaI010Buffer.getWidth | ( | ) |
void io.agora.base.JavaI010Buffer.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.
I420Buffer io.agora.base.JavaI010Buffer.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.JavaI010Buffer.retain | ( | ) |
Increases ref count by one.
Implements io.agora.base.VideoFrame.Buffer.
VideoFrame.Buffer io.agora.base.JavaI010Buffer.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.JavaI010Buffer.rotate | ( | int | frameRotation | ) |
Apply rotate
Implements io.agora.base.VideoFrame.Buffer.
VideoFrame.Buffer io.agora.base.JavaI010Buffer.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.
VideoFrame.Buffer io.agora.base.JavaI010Buffer.mirror | ( | int | frameRotation | ) |
Apply mirror
Implements io.agora.base.VideoFrame.Buffer.