public interface VideoDataBuffer
VideoDataBuffer
describes a single frame of video.Modifier and Type | Field and Description |
---|---|
static int |
PACKED_FORMAT_PLANE
Plane index used by all packed formats
|
static int |
YCBCR_PLANE_ALPHA
Plane index for YCbCr alpha data, this plane is optional
|
static int |
YCBCR_PLANE_CB
Plane index for YCbCr blue chrominance data
|
static int |
YCBCR_PLANE_CR
Plane index for YCbCr red chrominance data
|
static int |
YCBCR_PLANE_LUMA
Plane index for YCbCr luminance data
|
Modifier and Type | Method and Description |
---|---|
VideoDataBuffer |
convertToFormat(VideoFormat newFormat)
Converts the video image to the specified format.
|
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.
|
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.
|
@Native static final int PACKED_FORMAT_PLANE
@Native static final int YCBCR_PLANE_LUMA
@Native static final int YCBCR_PLANE_CR
@Native static final int YCBCR_PLANE_CB
@Native static final int YCBCR_PLANE_ALPHA
ByteBuffer getBufferForPlane(int plane)
PACKED_FORMAT_PLANE
as the plane index. If an invalid plane
index is passed this method returns null.plane
- The numeric index of the planeByteBuffer
containing video data for the specified
plane or null for non-existent or invalid planesdouble getTimestamp()
int getWidth()
int getHeight()
int getEncodedWidth()
int getEncodedHeight()
VideoFormat getFormat()
boolean hasAlpha()
int getPlaneCount()
int getStrideForPlane(int planeIndex)
planeIndex
- The numeric index of the plane.int[] getPlaneStrides()
getStrideForPlane
VideoDataBuffer convertToFormat(VideoFormat newFormat)
ARGB_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.newFormat
- the video format to convert tovoid setDirty()
void holdFrame()
void releaseFrame()
Copyright © 2020. All rights reserved.