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()
Resolution of the buffer in pixels.
|
int |
getWidth()
Resolution of the buffer in pixels.
|
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
|
public NV12Buffer(int width,
int height,
int stride,
int sliceHeight,
java.nio.ByteBuffer buffer,
java.lang.Runnable releaseCallback)
public int getWidth()
VideoFrame.BuffergetWidth in interface VideoFrame.Bufferpublic int getHeight()
VideoFrame.BuffergetHeight in interface VideoFrame.Bufferpublic VideoFrame.I420Buffer toI420()
VideoFrame.BuffertoI420 in interface VideoFrame.Bufferpublic void retain()
VideoFrame.Bufferretain in interface VideoFrame.Bufferpublic void release()
VideoFrame.Bufferrelease in interface VideoFrame.Bufferpublic VideoFrame.Buffer cropAndScale(int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight)
VideoFrame.BuffercropAndScale in interface VideoFrame.Bufferpublic VideoFrame.Buffer mirror(int frameRotation)
VideoFrame.Buffermirror in interface VideoFrame.Bufferpublic VideoFrame.Buffer rotate(int frameRotation)
VideoFrame.Bufferrotate in interface VideoFrame.Bufferpublic VideoFrame.Buffer transform(int cropX, int cropY, int cropWidth, int cropHeight, int scaleWidth, int scaleHeight, int rotation)
VideoFrame.Buffertransform in interface VideoFrame.Buffer