public class ExternalVideoFrame
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.nio.ByteBuffer |
alphaBuffer
Portrait Segmentation meta buffer, dimension of which is the same as
VideoFrame.
|
private int |
alphaMode
The relative position between alphabuffer and the frame.
|
private java.nio.ByteBuffer |
buffer
The video buffer.Must be DirectByteBuffer
|
private ColorSpace |
colorSpace
The color space type.
|
private int |
cropBottom
[Raw data related parameter] The number of pixels trimmed from the bottom.
|
private int |
cropLeft
[Raw data related parameter] The number of pixels trimmed from the left.
|
private int |
cropRight
[Raw data related parameter] The number of pixels trimmed from the right.
|
private int |
cropTop
[Raw data related parameter] The number of pixels trimmed from the top.
|
private java.lang.Object |
eglContext
[Texture-related parameter]
When using the OpenGL interface (javax.microedition.khronos.egl.*) defined by
Khronos, set EGLContext to this field.
|
private int |
eglType
[Texture related parameter] Texture ID used by the video frame.
|
private int |
fillAlphaBuffer
[For bgra or rgba only] Extract alphaBuffer from bgra or rgba data.
|
private int |
format
The pixel format.
|
private int |
height
Height of the incoming video frame.
|
private float |
matrix
[Texture related parameter] Incoming 4 × 4 transformational matrix.
|
private java.nio.ByteBuffer |
metadataBuffer
[Texture related parameter] The MetaData buffer.
|
private int |
rotation
[Raw data related parameter] The clockwise rotation of the video frame.
|
private int |
stride
Line spacing of the incoming video frame, which must be in pixels instead of
bytes.
|
private int |
textureId
[Texture related parameter] Incoming 4 × 4 transformational matrix.
|
private long |
timestamp
Timestamp of the incoming video frame (ms).
|
private int |
type
The buffer type.
|
| Constructor and Description |
|---|
ExternalVideoFrame()
Default constructor for ExternalVideoFrame.
|
ExternalVideoFrame(int type,
int format,
java.nio.ByteBuffer buffer,
int stride,
int height,
int cropLeft,
int cropTop,
int cropRight,
int cropBottom,
int rotation,
long timestamp,
java.lang.Object eglContext,
int eglType,
int textureId,
float matrix,
java.nio.ByteBuffer metadataBuffer,
java.nio.ByteBuffer alphaBuffer,
int fillAlphaBuffer,
int alphaMode,
ColorSpace colorSpace)
Constructs ExternalVideoFrame with all parameters.
|
| Modifier and Type | Method and Description |
|---|---|
java.nio.ByteBuffer |
getAlphaBuffer()
Gets the Portrait Segmentation meta buffer.
|
int |
getAlphaMode()
Gets the relative position between alphabuffer and the frame.
|
java.nio.ByteBuffer |
getBuffer()
Gets the video buffer (must be DirectByteBuffer).
|
ColorSpace |
getColorSpace()
Gets the color space type.
|
int |
getCropBottom()
Gets the number of pixels trimmed from the bottom.
|
int |
getCropLeft()
Gets the number of pixels trimmed from the left.
|
int |
getCropRight()
Gets the number of pixels trimmed from the right.
|
int |
getCropTop()
Gets the number of pixels trimmed from the top.
|
java.lang.Object |
getEglContext()
Gets the EGL context for texture.
|
int |
getEglType()
Gets the EGL type.
|
int |
getFillAlphaBuffer()
Gets whether to extract alphaBuffer from bgra or rgba data.
|
int |
getFormat()
Gets the pixel format.
|
int |
getHeight()
Gets the height of the incoming video frame.
|
float |
getMatrix()
Gets the incoming 4x4 transformational matrix.
|
java.nio.ByteBuffer |
getMetadataBuffer()
Gets the MetaData buffer.
|
int |
getRotation()
Gets the clockwise rotation of the video frame (0, 90, 180, or 270).
|
int |
getStride()
Gets the line spacing of the incoming video frame in pixels.
|
int |
getTextureId()
Gets the texture ID used by the video frame.
|
long |
getTimestamp()
Gets the timestamp of the incoming video frame (ms).
|
int |
getType()
Gets the buffer type.
|
void |
setAlphaBuffer(java.nio.ByteBuffer buffer)
Sets the Portrait Segmentation meta buffer.
|
void |
setAlphaMode(int alphaMode)
Sets the relative position between alphabuffer and the frame.
|
void |
setBuffer(java.nio.ByteBuffer buffer)
Sets the video buffer (must be DirectByteBuffer).
|
void |
setColorSpace(ColorSpace colorSpace)
Sets the color space type.
|
void |
setCropBottom(int cropBottom)
Sets the number of pixels trimmed from the bottom.
|
void |
setCropLeft(int cropLeft)
Sets the number of pixels trimmed from the left.
|
void |
setCropRight(int cropRight)
Sets the number of pixels trimmed from the right.
|
void |
setCropTop(int cropTop)
Sets the number of pixels trimmed from the top.
|
void |
setEglContext(java.lang.Object eglContext)
Sets the EGL context for texture.
|
void |
setEglType(int eglType)
Sets the EGL type.
|
void |
setFillAlphaBuffer(int fillAlphaBuffer)
Sets whether to extract alphaBuffer from bgra or rgba data.
|
void |
setFormat(int format)
Sets the pixel format.
|
void |
setHeight(int height)
Sets the height of the incoming video frame.
|
void |
setMatrix(float matrix)
Sets the incoming 4x4 transformational matrix.
|
void |
setMetadataBuffer(java.nio.ByteBuffer metadataBuffer)
Sets the MetaData buffer.
|
void |
setRotation(int rotation)
Sets the clockwise rotation of the video frame (0, 90, 180, or 270).
|
void |
setStride(int stride)
Sets the line spacing of the incoming video frame in pixels.
|
void |
setTextureId(int textureId)
Sets the texture ID used by the video frame.
|
void |
setTimestamp(long timestamp)
Sets the timestamp of the incoming video frame (ms).
|
void |
setType(int type)
Sets the buffer type.
|
java.lang.String |
toString() |
private int type
private int format
private java.nio.ByteBuffer buffer
private int stride
private int height
private int cropLeft
private int cropTop
private int cropRight
private int cropBottom
private int rotation
private long timestamp
private java.lang.Object eglContext
private int eglType
private int textureId
private float matrix
private java.nio.ByteBuffer metadataBuffer
private java.nio.ByteBuffer alphaBuffer
private int fillAlphaBuffer
private int alphaMode
private ColorSpace colorSpace
public ExternalVideoFrame()
public ExternalVideoFrame(int type,
int format,
java.nio.ByteBuffer buffer,
int stride,
int height,
int cropLeft,
int cropTop,
int cropRight,
int cropBottom,
int rotation,
long timestamp,
java.lang.Object eglContext,
int eglType,
int textureId,
float matrix,
java.nio.ByteBuffer metadataBuffer,
java.nio.ByteBuffer alphaBuffer,
int fillAlphaBuffer,
int alphaMode,
ColorSpace colorSpace)
type - The buffer typeformat - The pixel formatbuffer - The video buffer (must be DirectByteBuffer)stride - Line spacing of the incoming video frame in pixelsheight - Height of the incoming video framecropLeft - The number of pixels trimmed from the leftcropTop - The number of pixels trimmed from the topcropRight - The number of pixels trimmed from the rightcropBottom - The number of pixels trimmed from the bottomrotation - The clockwise rotation of the video frame (0, 90, 180, or 270)timestamp - Timestamp of the incoming video frame (ms)eglContext - EGL context for textureeglType - EGL typetextureId - Texture ID used by the video framematrix - Incoming 4x4 transformational matrixmetadataBuffer - The MetaData bufferalphaBuffer - Portrait Segmentation meta bufferfillAlphaBuffer - Extract alphaBuffer from bgra or rgba dataalphaMode - The relative position between alphabuffer and the framecolorSpace - The color space typepublic int getType()
public void setType(int type)
type - The buffer typepublic int getFormat()
public void setFormat(int format)
format - The pixel formatpublic java.nio.ByteBuffer getBuffer()
public void setBuffer(java.nio.ByteBuffer buffer)
buffer - The video bufferpublic int getStride()
public void setStride(int stride)
stride - Line spacing of the incoming video frame in pixelspublic int getHeight()
public void setHeight(int height)
height - Height of the incoming video framepublic int getCropLeft()
public void setCropLeft(int cropLeft)
cropLeft - The number of pixels trimmed from the leftpublic int getCropTop()
public void setCropTop(int cropTop)
cropTop - The number of pixels trimmed from the toppublic int getCropRight()
public void setCropRight(int cropRight)
cropRight - The number of pixels trimmed from the rightpublic int getCropBottom()
public void setCropBottom(int cropBottom)
cropBottom - The number of pixels trimmed from the bottompublic int getRotation()
public void setRotation(int rotation)
rotation - The clockwise rotation of the video framepublic long getTimestamp()
public void setTimestamp(long timestamp)
timestamp - Timestamp of the incoming video frame (ms)public java.lang.Object getEglContext()
public void setEglContext(java.lang.Object eglContext)
eglContext - EGL context for texturepublic int getEglType()
public void setEglType(int eglType)
eglType - EGL typepublic int getTextureId()
public void setTextureId(int textureId)
textureId - Texture ID used by the video framepublic float getMatrix()
public void setMatrix(float matrix)
matrix - Incoming 4x4 transformational matrixpublic java.nio.ByteBuffer getMetadataBuffer()
public void setMetadataBuffer(java.nio.ByteBuffer metadataBuffer)
metadataBuffer - The MetaData bufferpublic java.nio.ByteBuffer getAlphaBuffer()
public void setAlphaBuffer(java.nio.ByteBuffer buffer)
buffer - Portrait Segmentation meta bufferpublic int getFillAlphaBuffer()
public void setFillAlphaBuffer(int fillAlphaBuffer)
fillAlphaBuffer - Whether to extract alphaBuffer from bgra or rgba datapublic int getAlphaMode()
public void setAlphaMode(int alphaMode)
alphaMode - The relative position between alphabuffer and the framepublic ColorSpace getColorSpace()
public void setColorSpace(ColorSpace colorSpace)
colorSpace - The color space typepublic java.lang.String toString()
toString in class java.lang.Object