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 MediaFrame
plane
- the numeric index of the plane, for chunky formats pass zeroByteBuffer
for the specified plane or null for
non-existent planespublic void holdFrame()
MediaFrame
holdFrame
in interface MediaFrame
public void releaseFrame()
MediaFrame
releaseFrame
in interface MediaFrame
public PixelFormat getPixelFormat()
getPixelFormat
in interface MediaFrame
PixelFormat
describing how pixels are stored in this
frame's bufferpublic int getWidth()
getWidth
in interface MediaFrame
public int getHeight()
getHeight
in interface MediaFrame
public int getEncodedWidth()
getEncodedWidth
in interface MediaFrame
public int getEncodedHeight()
getEncodedHeight
in interface MediaFrame
public int planeCount()
planeCount
in interface MediaFrame
public int[] planeStrides()
MediaFrame
PixelFormat
and decoder output.planeStrides
in interface MediaFrame
public int strideForPlane(int planeIndex)
MediaFrame
PixelFormat
and decoder output.strideForPlane
in interface MediaFrame
planeIndex
- which plane to get the stride for, valid range is zero
to planeCount()
non-inclusivepublic MediaFrame convertToFormat(PixelFormat fmt)
MediaFrame
convertToFormat
in interface MediaFrame
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 MediaFrame.releaseFrame()
or it will leak.