public class JavaI010Buffer extends java.lang.Object implements VideoFrame.I420Buffer
Constructor and Description |
---|
JavaI010Buffer(int width,
int height,
java.nio.ByteBuffer dataY,
int strideY,
java.nio.ByteBuffer dataU,
int strideU,
java.nio.ByteBuffer dataV,
int strideV,
java.lang.Runnable releaseCallback)
Constructs a new JavaI010Buffer backed by the given data
|
Modifier and Type | Method and Description |
---|---|
static JavaI010Buffer |
allocate(int width,
int height)
Allocates an empty I010Buffer suitable for an image of the given dimensions.
|
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|.
|
java.nio.ByteBuffer |
getDataU()
Returns a direct ByteBuffer containing U-plane data.
|
java.nio.ByteBuffer |
getDataV()
Returns a direct ByteBuffer containing V-plane data.
|
java.nio.ByteBuffer |
getDataY()
Returns a direct ByteBuffer containing Y-plane data.
|
int |
getHeight()
Resolution of the buffer in pixels.
|
int |
getStrideU() |
int |
getStrideV() |
int |
getStrideY() |
int |
getWidth()
Resolution of the buffer in pixels.
|
static VideoFrame.I420Buffer |
i010BufferToI420(JavaI010Buffer buffer) |
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
|
static JavaI010Buffer |
wrap(int width,
int height,
java.nio.ByteBuffer dataY,
int strideY,
java.nio.ByteBuffer dataU,
int strideU,
java.nio.ByteBuffer dataV,
int strideV,
java.lang.Runnable releaseCallback) |
public JavaI010Buffer(int width, int height, java.nio.ByteBuffer dataY, int strideY, java.nio.ByteBuffer dataU, int strideU, java.nio.ByteBuffer dataV, int strideV, java.lang.Runnable releaseCallback)
public static JavaI010Buffer wrap(int width, int height, java.nio.ByteBuffer dataY, int strideY, java.nio.ByteBuffer dataU, int strideU, java.nio.ByteBuffer dataV, int strideV, java.lang.Runnable releaseCallback)
public static JavaI010Buffer allocate(int width, int height)
width
- width.height
- height.public java.nio.ByteBuffer getDataY()
VideoFrame.I420Buffer
getDataY
in interface VideoFrame.I420Buffer
public java.nio.ByteBuffer getDataV()
VideoFrame.I420Buffer
getDataV
in interface VideoFrame.I420Buffer
public java.nio.ByteBuffer getDataU()
VideoFrame.I420Buffer
getDataU
in interface VideoFrame.I420Buffer
public int getHeight()
VideoFrame.Buffer
getHeight
in interface VideoFrame.Buffer
public int getWidth()
VideoFrame.Buffer
getWidth
in interface VideoFrame.Buffer
public int getStrideV()
getStrideV
in interface VideoFrame.I420Buffer
public int getStrideY()
getStrideY
in interface VideoFrame.I420Buffer
public int getStrideU()
getStrideU
in interface VideoFrame.I420Buffer
public void release()
VideoFrame.Buffer
release
in interface VideoFrame.Buffer
public VideoFrame.I420Buffer toI420()
VideoFrame.Buffer
toI420
in interface VideoFrame.Buffer
public void retain()
VideoFrame.Buffer
retain
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 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 VideoFrame.Buffer mirror(int frameRotation)
VideoFrame.Buffer
mirror
in interface VideoFrame.Buffer
public static VideoFrame.I420Buffer i010BufferToI420(JavaI010Buffer buffer)