io.agora.rtc

## Class AgoraVideoTrack

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

-     public class AgoraVideoTrack
      extends java.lang.Object

  Wrapper for video track functionality.

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraVideoTrack(long cptr)` Constructs a video track.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `addRenderer(AgoraVideoRenderer agora_video_renderer, int position)` Adds a renderer to the video track.
    `void` | `destroy()` Destroys the video track and releases native resources.
    `private int` | `nativeAddRenderer(long cptr, AgoraVideoRenderer agora_video_renderer, int position)` Adds a renderer natively.
    `private void` | `nativeDestroy(long cptr)` Releases the native video track handle.
    `private int` | `nativeRemoveRenderer(long cptr, AgoraVideoRenderer agora_video_renderer, int position)` Removes a renderer natively.
    `int` | `removeRenderer(AgoraVideoRenderer agora_video_renderer, int position)` Removes a renderer from the video track.

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

  - ### Constructor Detail

    - #### AgoraVideoTrack

          public AgoraVideoTrack(long cptr)

      Constructs a video track.
      Parameters:
        `cptr` - Native pointer to the video track instance

  - ### Method Detail

    - #### destroy

          public void destroy()

      Destroys the video track and releases native resources.

    - #### addRenderer

          public int addRenderer(AgoraVideoRenderer agora_video_renderer,
                                 int position)

      Adds a renderer to the video track.
      Parameters:
        `agora_video_renderer` - Video renderer instance
        `position` - Renderer position
      Returns:
        0 on success, <0 on failure

    - #### removeRenderer

          public int removeRenderer(AgoraVideoRenderer agora_video_renderer,
                                    int position)

      Removes a renderer from the video track.
      Parameters:
        `agora_video_renderer` - Video renderer instance
        `position` - Renderer position
      Returns:
        0 on success, <0 on failure

    - #### nativeDestroy

          private void nativeDestroy(long cptr)

      Releases the native video track handle.
      Parameters:
        `cptr` - Native pointer to the video track

    - #### nativeAddRenderer

          private int nativeAddRenderer(long cptr,
                                        AgoraVideoRenderer agora_video_renderer,
                                        int position)

      Adds a renderer natively.
      Parameters:
        `cptr` - Native pointer to the video track
        `agora_video_renderer` - Video renderer instance
        `position` - Renderer position
      Returns:
        0 on success, <0 on failure

    - #### nativeRemoveRenderer

          private int nativeRemoveRenderer(long cptr,
                                           AgoraVideoRenderer agora_video_renderer,
                                           int position)

      Removes a renderer natively.
      Parameters:
        `cptr` - Native pointer to the video track
        `agora_video_renderer` - Video renderer instance
        `position` - Renderer position
      Returns:
        0 on success, <0 on failure