io.agora.rtc

## Class AgoraVideoFrame

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

-     public class AgoraVideoFrame
      extends java.lang.Object

  Represents a video frame for processing and rendering.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private long` | `cptr` Native pointer to the video frame instance.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraVideoFrame(long cptr)` Constructs a video frame.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Destroys the video frame.
    `(package private) void` | `destroyTextureId(TextureId id)` Destroys a texture ID.
    `int` | `fillTexture(int format, int width, int height, int rotation, TextureId id)` Fills texture with video frame data.
    `int` | `format()` Gets the video frame format.
    `int` | `height()` Gets the video frame height.
    `private void` | `nativeDestroyTextureId(long cptr, TextureId id)` Destroys a texture ID natively.
    `private int` | `nativeFillTexture(long cptr, int format, int width, int height, int rotation, TextureId id)` Fills texture with video frame data natively.
    `private int` | `nativeFormat(long cptr)` Gets the video frame format natively.
    `private int` | `nativeHeight(long cptr)` Gets the video frame height natively.
    `private int` | `nativeResize(long cptr, int width, int height)` Resizes the video frame natively.
    `private int` | `nativeRotation(long cptr)` Gets the video frame rotation natively.
    `private void` | `nativeSetRotation(long cptr, int rotation)` Sets the video frame rotation natively.
    `private void` | `nativeSetTimestampUs(long cptr, long timestamp_us)` Sets the video frame timestamp natively.
    `private int` | `nativeSize(long cptr)` Gets the video frame size natively.
    `private TextureId` | `nativeTextureId(long cptr)` Gets the texture ID natively.
    `private long` | `nativeTimestampUs(long cptr)` Gets the video frame timestamp natively.
    `private int` | `nativeType(long cptr)` Gets the video frame type natively.
    `private int` | `nativeWidth(long cptr)` Gets the video frame width natively.
    `int` | `resize(int width, int height)` Resizes the video frame.
    `int` | `rotation()` Gets the video frame rotation.
    `void` | `setRotation(int rotation)` Sets the video frame rotation.
    `void` | `setTimestampUs(long timestamp_us)` Sets the video frame timestamp.
    `int` | `size()` Gets the video frame size in bytes.
    `TextureId` | `textureId()` Gets the texture ID of the video frame.
    `long` | `timestampUs()` Gets the video frame timestamp in microseconds.
    `int` | `type()` Gets the video frame type.
    `int` | `width()` Gets the video frame width.

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

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

- - ### Field Detail

    - #### cptr

          private long cptr

      Native pointer to the video frame instance.

  - ### Constructor Detail

    - #### AgoraVideoFrame

          public AgoraVideoFrame(long cptr)

      Constructs a video frame.
      Parameters:
        `cptr` - Native pointer to the video frame object

  - ### Method Detail

    - #### destroy

          public void destroy()

      Destroys the video frame.

    - #### type

          public int type()

      Gets the video frame type.
      Returns:
        Frame type

    - #### format

          public int format()

      Gets the video frame format.
      Returns:
        Frame format

    - #### width

          public int width()

      Gets the video frame width.
      Returns:
        Frame width in pixels

    - #### height

          public int height()

      Gets the video frame height.
      Returns:
        Frame height in pixels

    - #### size

          public int size()

      Gets the video frame size in bytes.
      Returns:
        Frame size in bytes

    - #### rotation

          public int rotation()

      Gets the video frame rotation.
      Returns:
        Rotation value

    - #### setRotation

          public void setRotation(int rotation)

      Sets the video frame rotation.
      Parameters:
        `rotation` - Rotation value

    - #### timestampUs

          public long timestampUs()

      Gets the video frame timestamp in microseconds.
      Returns:
        Timestamp in microseconds

    - #### setTimestampUs

          public void setTimestampUs(long timestamp_us)

      Sets the video frame timestamp.
      Parameters:
        `timestamp_us` - Timestamp in microseconds

    - #### resize

          public int resize(int width,
                            int height)

      Resizes the video frame.
      Parameters:
        `width` - New width in pixels
        `height` - New height in pixels
      Returns:
        0 on success, <0 on failure

    - #### textureId

          public TextureId textureId()

      Gets the texture ID of the video frame.
      Returns:
        Texture ID

    - #### destroyTextureId

          void destroyTextureId(TextureId id)

      Destroys a texture ID.
      Parameters:
        `id` - Texture ID to destroy

    - #### fillTexture

          public int fillTexture(int format,
                                 int width,
                                 int height,
                                 int rotation,
                                 TextureId id)

      Fills texture with video frame data.
      Parameters:
        `format` - Video format
        `width` - Frame width
        `height` - Frame height
        `rotation` - Frame rotation
        `id` - Texture ID
      Returns:
        0 on success, <0 on failure

    - #### nativeType

          private int nativeType(long cptr)

      Gets the video frame type natively.
      Parameters:
        `cptr` - Native pointer to the video frame
      Returns:
        Frame type

    - #### nativeFormat

          private int nativeFormat(long cptr)

      Gets the video frame format natively.
      Parameters:
        `cptr` - Native pointer to the video frame
      Returns:
        Frame format

    - #### nativeWidth

          private int nativeWidth(long cptr)

      Gets the video frame width natively.
      Parameters:
        `cptr` - Native pointer to the video frame
      Returns:
        Frame width in pixels

    - #### nativeHeight

          private int nativeHeight(long cptr)

      Gets the video frame height natively.
      Parameters:
        `cptr` - Native pointer to the video frame
      Returns:
        Frame height in pixels

    - #### nativeSize

          private int nativeSize(long cptr)

      Gets the video frame size natively.
      Parameters:
        `cptr` - Native pointer to the video frame
      Returns:
        Frame size in bytes

    - #### nativeRotation

          private int nativeRotation(long cptr)

      Gets the video frame rotation natively.
      Parameters:
        `cptr` - Native pointer to the video frame
      Returns:
        Rotation value

    - #### nativeSetRotation

          private void nativeSetRotation(long cptr,
                                         int rotation)

      Sets the video frame rotation natively.
      Parameters:
        `cptr` - Native pointer to the video frame
        `rotation` - Rotation value

    - #### nativeTimestampUs

          private long nativeTimestampUs(long cptr)

      Gets the video frame timestamp natively.
      Parameters:
        `cptr` - Native pointer to the video frame
      Returns:
        Timestamp in microseconds

    - #### nativeSetTimestampUs

          private void nativeSetTimestampUs(long cptr,
                                            long timestamp_us)

      Sets the video frame timestamp natively.
      Parameters:
        `cptr` - Native pointer to the video frame
        `timestamp_us` - Timestamp in microseconds

    - #### nativeResize

          private int nativeResize(long cptr,
                                   int width,
                                   int height)

      Resizes the video frame natively.
      Parameters:
        `cptr` - Native pointer to the video frame
        `width` - New width in pixels
        `height` - New height in pixels
      Returns:
        0 on success, <0 on failure

    - #### nativeTextureId

          private TextureId nativeTextureId(long cptr)

      Gets the texture ID natively.
      Parameters:
        `cptr` - Native pointer to the video frame
      Returns:
        Texture ID

    - #### nativeDestroyTextureId

          private void nativeDestroyTextureId(long cptr,
                                              TextureId id)

      Destroys a texture ID natively.
      Parameters:
        `cptr` - Native pointer to the video frame
        `id` - Texture ID to destroy

    - #### nativeFillTexture

          private int nativeFillTexture(long cptr,
                                        int format,
                                        int width,
                                        int height,
                                        int rotation,
                                        TextureId id)

      Fills texture with video frame data natively.
      Parameters:
        `cptr` - Native pointer to the video frame
        `format` - Video format
        `width` - Frame width
        `height` - Frame height
        `rotation` - Frame rotation
        `id` - Texture ID
      Returns:
        0 on success, <0 on failure