public class NV12Buffer extends java.lang.Object implements VideoFrame.Buffer
Constructor and Description |
---|
NV12Buffer(int width,
int height,
int stride,
int sliceHeight,
java.nio.ByteBuffer buffer,
java.lang.Runnable releaseCallback) |
Modifier and Type | Method and Description |
---|---|
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|.
|
int |
getHeight() |
int |
getWidth()
Resolution of the buffer in pixels.
|
void |
release()
Decreases ref count by one.
|
void |
retain()
Increases ref count by one.
|
VideoFrame.I420Buffer |
toI420()
Returns a memory-backed frame in I420 format.
|
public NV12Buffer(int width, int height, int stride, int sliceHeight, java.nio.ByteBuffer buffer, @Nullable java.lang.Runnable releaseCallback)
public int getWidth()
VideoFrame.Buffer
getWidth
in interface VideoFrame.Buffer
public int getHeight()
getHeight
in interface VideoFrame.Buffer
public VideoFrame.I420Buffer toI420()
VideoFrame.Buffer
toI420
in interface VideoFrame.Buffer
public void retain()
RefCounted
retain
in interface RefCounted
retain
in interface VideoFrame.Buffer
public void release()
RefCounted
release
in interface RefCounted
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
6.0.0