final class NativeVideoBuffer extends java.lang.Object implements VideoDataBuffer
| Modifier and Type | Class and Description |
|---|---|
private static class |
NativeVideoBuffer.VideoBufferDisposer |
| Modifier and Type | Field and Description |
|---|---|
private NativeVideoBuffer |
cachedBGRARep |
private static boolean |
DEBUG_DISPOSED_BUFFERS |
private static NativeVideoBuffer.VideoBufferDisposer |
disposer |
private java.util.concurrent.atomic.AtomicInteger |
holdCount |
private long |
nativePeer |
PACKED_FORMAT_PLANE, YCBCR_PLANE_ALPHA, YCBCR_PLANE_CB, YCBCR_PLANE_CR, YCBCR_PLANE_LUMA| Modifier | Constructor and Description |
|---|---|
private |
NativeVideoBuffer(long nativePeer) |
| Modifier and Type | Method and Description |
|---|---|
VideoDataBuffer |
convertToFormat(VideoFormat newFormat)
Converts the video image to the specified format.
|
static NativeVideoBuffer |
createVideoBuffer(long nativePeer) |
java.nio.ByteBuffer |
getBufferForPlane(int plane)
Retrieve the data buffer for the specified plane.
|
int |
getEncodedHeight()
Gets the height of the image as created by the decoder, this may be larger
than the display height.
|
int |
getEncodedWidth()
Gets the width of the image as created by the decoder, this may be larger
than the display width.
|
VideoFormat |
getFormat() |
int |
getHeight()
Gets the height of the VideoDataBuffer
|
int |
getPlaneCount() |
int[] |
getPlaneStrides() |
int |
getStrideForPlane(int planeIndex)
Returns the number of bytes in each row of pixels for the specified plane.
|
double |
getTimestamp()
Retrieve the timestamp of the buffer.
|
int |
getWidth()
Gets the width of the VideoDataBuffer
|
boolean |
hasAlpha()
Determine if a video buffer has an alpha channel.
|
void |
holdFrame()
Place a hold on a buffer so that it cannot be reused by the buffer pool
from whence it came.
|
private long |
nativeConvertToFormat(long handle,
int formatType) |
private static void |
nativeDisposeBuffer(long handle) |
private java.nio.ByteBuffer |
nativeGetBufferForPlane(long handle,
int plane) |
private int |
nativeGetEncodedHeight(long handle) |
private int |
nativeGetEncodedWidth(long handle) |
private int |
nativeGetFormat(long handle) |
private int |
nativeGetHeight(long handle) |
private int |
nativeGetPlaneCount(long handle) |
private int[] |
nativeGetPlaneStrides(long handle) |
private double |
nativeGetTimestamp(long handle) |
private int |
nativeGetWidth(long handle) |
private boolean |
nativeHasAlpha(long handle) |
private void |
nativeSetDirty(long handle) |
void |
releaseFrame()
Releases a hold previously placed on this frame.
|
void |
setDirty()
Flags a video buffer indicating the contents of the buffer have been
updated and any cached representations need to be updated.
|
java.lang.String |
toString() |
private long nativePeer
private final java.util.concurrent.atomic.AtomicInteger holdCount
private NativeVideoBuffer cachedBGRARep
private static final boolean DEBUG_DISPOSED_BUFFERS
private static final NativeVideoBuffer.VideoBufferDisposer disposer
private static void nativeDisposeBuffer(long handle)
private double nativeGetTimestamp(long handle)
private java.nio.ByteBuffer nativeGetBufferForPlane(long handle,
int plane)
private int nativeGetWidth(long handle)
private int nativeGetHeight(long handle)
private int nativeGetEncodedWidth(long handle)
private int nativeGetEncodedHeight(long handle)
private int nativeGetFormat(long handle)
private boolean nativeHasAlpha(long handle)
private int nativeGetPlaneCount(long handle)
private int[] nativeGetPlaneStrides(long handle)
private long nativeConvertToFormat(long handle,
int formatType)
private void nativeSetDirty(long handle)
public static NativeVideoBuffer createVideoBuffer(long nativePeer)
public void holdFrame()
VideoDataBufferholdFrame in interface VideoDataBufferpublic void releaseFrame()
VideoDataBufferreleaseFrame in interface VideoDataBufferpublic double getTimestamp()
VideoDataBuffergetTimestamp in interface VideoDataBufferpublic java.nio.ByteBuffer getBufferForPlane(int plane)
VideoDataBufferPACKED_FORMAT_PLANE as the plane index. If an invalid plane
index is passed this method returns null.getBufferForPlane in interface VideoDataBufferplane - The numeric index of the planeByteBuffer containing video data for the specified
plane or null for non-existent or invalid planespublic int getWidth()
VideoDataBuffergetWidth in interface VideoDataBufferpublic int getHeight()
VideoDataBuffergetHeight in interface VideoDataBufferpublic int getEncodedWidth()
VideoDataBuffergetEncodedWidth in interface VideoDataBufferpublic int getEncodedHeight()
VideoDataBuffergetEncodedHeight in interface VideoDataBufferpublic VideoFormat getFormat()
getFormat in interface VideoDataBufferpublic boolean hasAlpha()
VideoDataBufferhasAlpha in interface VideoDataBufferpublic int getPlaneCount()
getPlaneCount in interface VideoDataBufferpublic int getStrideForPlane(int planeIndex)
VideoDataBuffergetStrideForPlane in interface VideoDataBufferplaneIndex - The numeric index of the plane.public int[] getPlaneStrides()
getPlaneStrides in interface VideoDataBuffergetStrideForPlanepublic VideoDataBuffer convertToFormat(VideoFormat newFormat)
VideoDataBufferARGB_PRE or BGRA_PRE, converting to YCbCr is not
supported here. Once a conversion is done, a reference to the converted
buffer is retained so that future conversions do not need to be performed.convertToFormat in interface VideoDataBuffernewFormat - the video format to convert topublic void setDirty()
VideoDataBuffersetDirty in interface VideoDataBufferpublic java.lang.String toString()
toString in class java.lang.Object