private class PrismMediaFrameHandler.PrismFrameBuffer extends java.lang.Object implements MediaFrame
| Modifier and Type | Field and Description |
|---|---|
private VideoDataBuffer |
master |
private PixelFormat |
videoFormat |
| Constructor and Description |
|---|
PrismFrameBuffer(VideoDataBuffer sourceBuffer) |
| 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.
|
private final PixelFormat videoFormat
private final VideoDataBuffer master
public PrismFrameBuffer(VideoDataBuffer sourceBuffer)
public java.nio.ByteBuffer getBufferForPlane(int plane)
getBufferForPlane in interface MediaFrameplane - the numeric index of the plane, for chunky formats pass zeroByteBuffer for the specified plane or null for
non-existent planespublic void holdFrame()
MediaFrameholdFrame in interface MediaFramepublic void releaseFrame()
MediaFramereleaseFrame in interface MediaFramepublic PixelFormat getPixelFormat()
getPixelFormat in interface MediaFramePixelFormat describing how pixels are stored in this
frame's bufferpublic int getWidth()
getWidth in interface MediaFramepublic int getHeight()
getHeight in interface MediaFramepublic int getEncodedWidth()
getEncodedWidth in interface MediaFramepublic int getEncodedHeight()
getEncodedHeight in interface MediaFramepublic int planeCount()
planeCount in interface MediaFramepublic int[] planeStrides()
MediaFramePixelFormat and decoder output.planeStrides in interface MediaFramepublic int strideForPlane(int planeIndex)
MediaFramePixelFormat and decoder output.strideForPlane in interface MediaFrameplaneIndex - which plane to get the stride for, valid range is zero
to planeCount() non-inclusivepublic MediaFrame convertToFormat(PixelFormat fmt)
MediaFrameconvertToFormat in interface MediaFramefmt - 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 MediaFrame.releaseFrame() or it will leak.