io.agora.rtc

## Class ExternalVideoFrame

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

-     public class ExternalVideoFrame
      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 java.nio.ByteBuffer` | `buffer` The video buffer.Must be DirectByteBuffer
    `private ColorSpace` | `colorSpace`
    `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 Summary

    Constructors
    Constructor and Description
    `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)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.nio.ByteBuffer` | `getAlphaBuffer()`
    `int` | `getAlphaMode()`
    `java.nio.ByteBuffer` | `getBuffer()`
    `ColorSpace` | `getColorSpace()`
    `int` | `getCropBottom()`
    `int` | `getCropLeft()`
    `int` | `getCropRight()`
    `int` | `getCropTop()`
    `java.lang.Object` | `getEglContext()`
    `int` | `getEglType()`
    `int` | `getFillAlphaBuffer()`
    `int` | `getFormat()`
    `int` | `getHeight()`
    `float` | `getMatrix()`
    `java.nio.ByteBuffer` | `getMetadataBuffer()`
    `int` | `getRotation()`
    `int` | `getStride()`
    `int` | `getTextureId()`
    `long` | `getTimestamp()`
    `int` | `getType()`
    `void` | `setAlphaBuffer(java.nio.ByteBuffer buffer)`
    `void` | `setAlphaMode(int alphaMode)`
    `void` | `setBuffer(java.nio.ByteBuffer buffer)`
    `void` | `setColorSpace(ColorSpace colorSpace)`
    `void` | `setCropBottom(int cropBottom)`
    `void` | `setCropLeft(int cropLeft)`
    `void` | `setCropRight(int cropRight)`
    `void` | `setCropTop(int cropTop)`
    `void` | `setEglContext(java.lang.Object eglContext)`
    `void` | `setEglType(int eglType)`
    `void` | `setFillAlphaBuffer(int fillAlphaBuffer)`
    `void` | `setFormat(int format)`
    `void` | `setHeight(int height)`
    `void` | `setMatrix(float matrix)`
    `void` | `setMetadataBuffer(java.nio.ByteBuffer metadataBuffer)`
    `void` | `setRotation(int rotation)`
    `void` | `setStride(int stride)`
    `void` | `setTextureId(int textureId)`
    `void` | `setTimestamp(long timestamp)`
    `void` | `setType(int type)`
    `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

      The buffer type. See #VIDEO_BUFFER_TYPE

    - #### format

          private int format

      The pixel format. See #VIDEO_PIXEL_FORMAT

    - #### buffer

          private java.nio.ByteBuffer buffer

      The video buffer.Must be DirectByteBuffer

    - #### stride

          private int stride

      Line spacing of the incoming video frame, which must be in pixels instead of bytes. For textures, it is the width of the texture.

    - #### height

          private int height

      Height of the incoming video frame.

    - #### cropLeft

          private int cropLeft

      [Raw data related parameter] The number of pixels trimmed from the left. The default value is 0.

    - #### cropTop

          private int cropTop

      [Raw data related parameter] The number of pixels trimmed from the top. The default value is 0.

    - #### cropRight

          private int cropRight

      [Raw data related parameter] The number of pixels trimmed from the right. The default value is 0.

    - #### cropBottom

          private int cropBottom

      [Raw data related parameter] The number of pixels trimmed from the bottom. The default value is 0.

    - #### rotation

          private int rotation

      [Raw data related parameter] The clockwise rotation of the video frame. You can set the rotation angle as 0, 90, 180, or 270. The default value is 0.

    - #### timestamp

          private long timestamp

      Timestamp of the incoming video frame (ms). An incorrect timestamp results in frame loss or unsynchronized audio and video.

    - #### eglContext

          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. When using the OpenGL interface (android.opengl.*) defined by Android, set EGLContext to this field.

    - #### eglType

          private int eglType

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

    - #### textureId

          private int textureId

      [Texture related parameter] Incoming 4 × 4 transformational matrix. The typical value is a unit matrix.

    - #### matrix

          private float matrix

      [Texture related parameter] Incoming 4 × 4 transformational matrix. The typical value is a unit matrix.

    - #### metadataBuffer

          private java.nio.ByteBuffer metadataBuffer

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

    - #### 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

    - #### fillAlphaBuffer

          private int fillAlphaBuffer

      [For bgra or rgba only] Extract alphaBuffer from bgra or rgba data. Set it true if you do not explicitly specify the alphabuffer. The default value is false

    - #### 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.

    - #### colorSpace

          private ColorSpace colorSpace

  - ### Constructor Detail

    - #### ExternalVideoFrame

          public ExternalVideoFrame()

    - #### 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)

  - ### Method Detail

    - #### getType

          public int getType()

    - #### setType

          public void setType(int type)

    - #### getFormat

          public int getFormat()

    - #### setFormat

          public void setFormat(int format)

    - #### getBuffer

          public java.nio.ByteBuffer getBuffer()

    - #### setBuffer

          public void setBuffer(java.nio.ByteBuffer buffer)

    - #### getStride

          public int getStride()

    - #### setStride

          public void setStride(int stride)

    - #### getHeight

          public int getHeight()

    - #### setHeight

          public void setHeight(int height)

    - #### getCropLeft

          public int getCropLeft()

    - #### setCropLeft

          public void setCropLeft(int cropLeft)

    - #### getCropTop

          public int getCropTop()

    - #### setCropTop

          public void setCropTop(int cropTop)

    - #### getCropRight

          public int getCropRight()

    - #### setCropRight

          public void setCropRight(int cropRight)

    - #### getCropBottom

          public int getCropBottom()

    - #### setCropBottom

          public void setCropBottom(int cropBottom)

    - #### getRotation

          public int getRotation()

    - #### setRotation

          public void setRotation(int rotation)

    - #### getTimestamp

          public long getTimestamp()

    - #### setTimestamp

          public void setTimestamp(long timestamp)

    - #### getEglContext

          public java.lang.Object getEglContext()

    - #### setEglContext

          public void setEglContext(java.lang.Object eglContext)

    - #### getEglType

          public int getEglType()

    - #### setEglType

          public void setEglType(int eglType)

    - #### getTextureId

          public int getTextureId()

    - #### setTextureId

          public void setTextureId(int textureId)

    - #### getMatrix

          public float getMatrix()

    - #### setMatrix

          public void setMatrix(float matrix)

    - #### getMetadataBuffer

          public java.nio.ByteBuffer getMetadataBuffer()

    - #### setMetadataBuffer

          public void setMetadataBuffer(java.nio.ByteBuffer metadataBuffer)

    - #### getAlphaBuffer

          public java.nio.ByteBuffer getAlphaBuffer()

    - #### setAlphaBuffer

          public void setAlphaBuffer(java.nio.ByteBuffer buffer)

    - #### getFillAlphaBuffer

          public int getFillAlphaBuffer()

    - #### setFillAlphaBuffer

          public void setFillAlphaBuffer(int fillAlphaBuffer)

    - #### getAlphaMode

          public int getAlphaMode()

    - #### setAlphaMode

          public void setAlphaMode(int alphaMode)

    - #### getColorSpace

          public ColorSpace getColorSpace()

    - #### setColorSpace

          public void setColorSpace(ColorSpace colorSpace)

    - #### toString

          public java.lang.String toString()

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