public interface MediaFrame
Modifier and Type | Method and Description |
---|---|
MediaFrame |
convertToFormat(PixelFormat fmt)
Converts the video frame to a different video format.
|
java.nio.ByteBuffer |
getBufferForPlane(int plane) |
int |
getEncodedHeight() |
int |
getEncodedWidth() |
int |
getHeight() |
PixelFormat |
getPixelFormat() |
int |
getWidth() |
void |
holdFrame()
This method will prevent the frame from being deallocated or recycled.
|
int |
planeCount() |
int[] |
planeStrides()
The plane line stride is the number of bytes between two consecutive
lines in the buffer.
|
void |
releaseFrame()
When you're finished with a video frame, call this to allow the media
subsystem to deallocate or recycle the frame immediately.
|
int |
strideForPlane(int planeIndex)
The plane line stride is the number of bytes between two consecutive
lines in the buffer.
|
java.nio.ByteBuffer getBufferForPlane(int plane)
plane
- the numeric index of the plane, for chunky formats pass zeroByteBuffer
for the specified plane or null for
non-existent planesPixelFormat getPixelFormat()
PixelFormat
describing how pixels are stored in this
frame's bufferint getWidth()
int getHeight()
int getEncodedWidth()
int getEncodedHeight()
int planeCount()
int[] planeStrides()
PixelFormat
and decoder output.int strideForPlane(int planeIndex)
PixelFormat
and decoder output.planeIndex
- which plane to get the stride for, valid range is zero
to planeCount()
non-inclusiveMediaFrame convertToFormat(PixelFormat fmt)
fmt
- The new video pixel format, if the same format is specified then
the same frame will be returned. If a conversion is unsupported then this
will return null. The converted frame must be released when you're done
with it by calling releaseFrame()
or it will leak.void holdFrame()
void releaseFrame()