io.agora.rtc

## Class VideoFrame

- java.lang.Object
- - io.agora.rtc.VideoFrame

-     public class VideoFrame
      extends java.lang.Object

- - ### Field Summary

    Fields
    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 int` | `avsyncType`
    `private int` | `height` Video pixel height.
    `private float[]` | `matrix` [Texture related parameter], Incoming 4 × 4 transformational matrix.
    `private java.nio.ByteBuffer` | `metadataBuffer` [Texture related parameter] The MetaData buffer.
    `private long` | `renderTimeMs` Timestamp to render the video stream.
    `private int` | `rotation` rotation of this frame (0, 90, 180, 270)
    `private java.lang.Object` | `sharedContext` [Texture related parameter], egl context.
    `private int` | `textureId` [Texture related parameter], Texture ID used by the video frame.
    `private int` | `type`
    `private java.nio.ByteBuffer` | `uBuffer` U data buffer
    `private int` | `uStride` Line span of U buffer in YUV data.
    `private java.nio.ByteBuffer` | `vBuffer` V data buffer
    `private int` | `vStride` Line span of V buffer in YUV data.
    `private int` | `width` Video pixel width.
    `private java.nio.ByteBuffer` | `yBuffer` Y data buffer
    `private int` | `yStride` Line span of Y buffer in YUV data.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VideoFrame()`
    `VideoFrame(int type, int width, int height, int yStride, int uStride, int vStride, java.nio.ByteBuffer yBuffer, java.nio.ByteBuffer uBuffer, java.nio.ByteBuffer vBuffer, int rotation, long renderTimeMs, int avsyncType, java.nio.ByteBuffer metadataBuffer, java.lang.Object sharedContext, int textureId, float[] matrix, java.nio.ByteBuffer alphaBuffer, int alphaMode)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.nio.ByteBuffer` | `getAlphaBuffer()`
    `int` | `getAlphaMode()`
    `int` | `getAvsyncType()`
    `int` | `getHeight()`
    `float[]` | `getMatrix()`
    `java.nio.ByteBuffer` | `getMetadataBuffer()`
    `long` | `getRenderTimeMs()`
    `int` | `getRotation()`
    `java.lang.Object` | `getSharedContext()`
    `int` | `getTextureId()`
    `int` | `getType()`
    `java.nio.ByteBuffer` | `getUBuffer()`
    `int` | `getUStride()`
    `java.nio.ByteBuffer` | `getVBuffer()`
    `int` | `getVStride()`
    `int` | `getWidth()`
    `java.nio.ByteBuffer` | `getYBuffer()`
    `int` | `getYStride()`
    `void` | `setAlphaBuffer(java.nio.ByteBuffer alphaBuffer)`
    `void` | `setAlphaMode(int alphaMode)`
    `void` | `setAvsyncType(int avsyncType)`
    `void` | `setHeight(int height)`
    `void` | `setMatrix(float[] matrix)`
    `void` | `setMetadataBuffer(java.nio.ByteBuffer metadataBuffer)`
    `void` | `setRenderTimeMs(long renderTimeMs)`
    `void` | `setRotation(int rotation)`
    `void` | `setSharedContext(java.lang.Object sharedContext)`
    `void` | `setTextureId(int textureId)`
    `void` | `setType(int type)`
    `void` | `setUBuffer(java.nio.ByteBuffer uBuffer)`
    `void` | `setUStride(int uStride)`
    `void` | `setVBuffer(java.nio.ByteBuffer vBuffer)`
    `void` | `setVStride(int vStride)`
    `void` | `setWidth(int width)`
    `void` | `setYBuffer(java.nio.ByteBuffer yBuffer)`
    `void` | `setYStride(int yStride)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### type

          private int type

    - #### width

          private int width

      Video pixel width.

    - #### height

          private int height

      Video pixel height.

    - #### yStride

          private int yStride

      Line span of Y buffer in YUV data.

    - #### uStride

          private int uStride

      Line span of U buffer in YUV data.

    - #### vStride

          private int vStride

      Line span of V buffer in YUV data.

    - #### yBuffer

          private java.nio.ByteBuffer yBuffer

      Y data buffer

    - #### uBuffer

          private java.nio.ByteBuffer uBuffer

      U data buffer

    - #### vBuffer

          private java.nio.ByteBuffer vBuffer

      V data buffer

    - #### rotation

          private int rotation

      rotation of this frame (0, 90, 180, 270)

    - #### renderTimeMs

          private long renderTimeMs

      Timestamp to render the video stream. It instructs the users to use this timestamp to synchronize the video stream render while rendering the video streams. Note: This timestamp is for rendering the video stream, not for capturing the video stream.

    - #### avsyncType

          private int avsyncType

    - #### metadataBuffer

          private java.nio.ByteBuffer metadataBuffer

      [Texture related parameter] The MetaData buffer. The default value is NULL

    - #### sharedContext

          private java.lang.Object sharedContext

      [Texture related parameter], egl context.

    - #### textureId

          private int textureId

      [Texture related parameter], Texture ID used by the video frame.

    - #### matrix

          private float[] matrix

      [Texture related parameter], Incoming 4 × 4 transformational matrix.

    - #### alphaBuffer

          private java.nio.ByteBuffer alphaBuffer

      Portrait Segmentation meta buffer, dimension of which is the same as VideoFrame. Pixl value is between 0-255, 0 represents totally background, 255 represents totally foreground. The default value is NULL

    - #### alphaMode

          private int alphaMode

      The relative position between alphabuffer and the frame. 0: Normal frame; 1: Alphabuffer is above the frame; 2: Alphabuffer is below the frame; 3: Alphabuffer is on the left of frame; 4: Alphabuffer is on the right of frame; The default value is 0.

  - ### Constructor Detail

    - #### VideoFrame

          public VideoFrame()

    - #### VideoFrame

          public VideoFrame(int type,
                            int width,
                            int height,
                            int yStride,
                            int uStride,
                            int vStride,
                            java.nio.ByteBuffer yBuffer,
                            java.nio.ByteBuffer uBuffer,
                            java.nio.ByteBuffer vBuffer,
                            int rotation,
                            long renderTimeMs,
                            int avsyncType,
                            java.nio.ByteBuffer metadataBuffer,
                            java.lang.Object sharedContext,
                            int textureId,
                            float[] matrix,
                            java.nio.ByteBuffer alphaBuffer,
                            int alphaMode)

  - ### Method Detail

    - #### getType

          public int getType()

    - #### setType

          public void setType(int type)

    - #### getWidth

          public int getWidth()

    - #### setWidth

          public void setWidth(int width)

    - #### getHeight

          public int getHeight()

    - #### setHeight

          public void setHeight(int height)

    - #### getYStride

          public int getYStride()

    - #### setYStride

          public void setYStride(int yStride)

    - #### getUStride

          public int getUStride()

    - #### setUStride

          public void setUStride(int uStride)

    - #### getVStride

          public int getVStride()

    - #### setVStride

          public void setVStride(int vStride)

    - #### getYBuffer

          public java.nio.ByteBuffer getYBuffer()

    - #### setYBuffer

          public void setYBuffer(java.nio.ByteBuffer yBuffer)

    - #### getUBuffer

          public java.nio.ByteBuffer getUBuffer()

    - #### setUBuffer

          public void setUBuffer(java.nio.ByteBuffer uBuffer)

    - #### getVBuffer

          public java.nio.ByteBuffer getVBuffer()

    - #### setVBuffer

          public void setVBuffer(java.nio.ByteBuffer vBuffer)

    - #### getRotation

          public int getRotation()

    - #### setRotation

          public void setRotation(int rotation)

    - #### getRenderTimeMs

          public long getRenderTimeMs()

    - #### setRenderTimeMs

          public void setRenderTimeMs(long renderTimeMs)

    - #### getAvsyncType

          public int getAvsyncType()

    - #### setAvsyncType

          public void setAvsyncType(int avsyncType)

    - #### getMetadataBuffer

          public java.nio.ByteBuffer getMetadataBuffer()

    - #### setMetadataBuffer

          public void setMetadataBuffer(java.nio.ByteBuffer metadataBuffer)

    - #### getSharedContext

          public java.lang.Object getSharedContext()

    - #### setSharedContext

          public void setSharedContext(java.lang.Object sharedContext)

    - #### getTextureId

          public int getTextureId()

    - #### setTextureId

          public void setTextureId(int textureId)

    - #### getMatrix

          public float[] getMatrix()

    - #### setMatrix

          public void setMatrix(float[] matrix)

    - #### getAlphaBuffer

          public java.nio.ByteBuffer getAlphaBuffer()

    - #### setAlphaBuffer

          public void setAlphaBuffer(java.nio.ByteBuffer alphaBuffer)

    - #### getAlphaMode

          public int getAlphaMode()

    - #### setAlphaMode

          public void setAlphaMode(int alphaMode)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`