io.agora.rtc

## Class AgoraRemoteVideoTrack

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

-     public class AgoraRemoteVideoTrack
      extends java.lang.Object

  Represents a remote video track received from other users in a channel.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private long` | `cptr` Native pointer to the remote video track resource.
    `private IMediaPacketReceiver` | `mediaPacketReceiver` Media packet receiver for this track

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Destroys the remote video track.
    `(package private) void` | `destroyStatistics(RemoteVideoTrackStats stats)` Destroys the provided RemoteVideoTrackStats object.
    `(package private) void` | `destroyTrackInfo(VideoTrackInfo info)` Destroys the provided VideoTrackInfo object.
    `long` | `getNativeHandle()` Gets the native handle of the remote video track.
    `int` | `getState()` Gets the current state of the remote video track.
    `RemoteVideoTrackStats` | `getStatistics()` Retrieves the statistics of the remote video track.
    `VideoTrackInfo` | `getTrackInfo()` Gets information about the video track.
    `private void` | `nativeDestroy(long cptr)` Releases the native remote video track handle.
    `private void` | `nativeDestroyStatistics(long cptr, RemoteVideoTrackStats stats)` Releases a statistics object that was created natively.
    `private void` | `nativeDestroyTrackInfo(long cptr, VideoTrackInfo info)` Releases a track info object that was created natively.
    `private int` | `nativeGetState(long cptr)` Retrieves the native state value of the video track.
    `private RemoteVideoTrackStats` | `nativeGetStatistics(long cptr)` Obtains statistics for the remote video track from the native layer.
    `private VideoTrackInfo` | `nativeGetTrackInfo(long cptr)` Gets video track information from the native layer.
    `private int` | `nativeRegisterMediaPacketReceiver(long cptr, IMediaPacketReceiver agoraMediaPacketReceiver)` Registers a media packet receiver natively.
    `private int` | `nativeRegisterVideoEncodedImageReceiver(long cptr, AgoraVideoEncodedImageReceiver agoraVideoEncodedImageReceiver)` Registers a video encoded image receiver natively.
    `private int` | `nativeUnregisterMediaPacketReceiver(long cptr, IMediaPacketReceiver agoraMediaPacketReceiver)` Unregisters a media packet receiver natively.
    `private int` | `nativeUnregisterVideoEncodedImageReceiver(long cptr, AgoraVideoEncodedImageReceiver agoraVideoEncodedImageReceiver)` Unregisters a video encoded image receiver natively.
    `int` | `registerMediaPacketReceiver(IMediaPacketReceiver agoraMediaPacketReceiver)` Registers a media packet receiver for this track.
    `int` | `registerVideoEncodedImageReceiver(AgoraVideoEncodedImageReceiver agoraVideoEncodedImageReceiver)` Registers a video encoded image receiver for this track.
    `int` | `unregisterMediaPacketReceiver(IMediaPacketReceiver agoraMediaPacketReceiver)` Unregisters a media packet receiver from this track.
    `int` | `unregisterVideoEncodedImageReceiver(AgoraVideoEncodedImageReceiver agoraVideoEncodedImageReceiver)` Unregisters a video encoded image receiver from this 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 remote video track resource.

    - #### mediaPacketReceiver

          private IMediaPacketReceiver mediaPacketReceiver

      Media packet receiver for this track

  - ### Constructor Detail

    - #### AgoraRemoteVideoTrack

          AgoraRemoteVideoTrack(long cptr)

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

  - ### Method Detail

    - #### getNativeHandle

          public long getNativeHandle()

      Gets the native handle of the remote video track.
      Returns:
        The native handle of the remote video track.

    - #### destroy

          public void destroy()

      Destroys the remote video track. Ensures that the native resources are released.

    - #### getStatistics

          public RemoteVideoTrackStats getStatistics()

      Retrieves the statistics of the remote video track.
      Returns:
        Statistics object for the remote video track

    - #### destroyStatistics

          void destroyStatistics(RemoteVideoTrackStats stats)

      Destroys the provided RemoteVideoTrackStats object.
      Parameters:
        `stats` - The RemoteVideoTrackStats object to be destroyed

    - #### getState

          public int getState()

      Gets the current state of the remote video track.
      Returns:
        The state of the video track

    - #### getTrackInfo

          public VideoTrackInfo getTrackInfo()

      Gets information about the video track.
      Returns:
        Video track information

    - #### destroyTrackInfo

          void destroyTrackInfo(VideoTrackInfo info)

      Destroys the provided VideoTrackInfo object.
      Parameters:
        `info` - The VideoTrackInfo object to be destroyed

    - #### registerVideoEncodedImageReceiver

          public int registerVideoEncodedImageReceiver(AgoraVideoEncodedImageReceiver agoraVideoEncodedImageReceiver)

      Registers a video encoded image receiver for this track.
      Parameters:
        `agoraVideoEncodedImageReceiver` - Video encoded image receiver instance
      Returns:
        0 on success, <0 on failure

    - #### unregisterVideoEncodedImageReceiver

          public int unregisterVideoEncodedImageReceiver(AgoraVideoEncodedImageReceiver agoraVideoEncodedImageReceiver)

      Unregisters a video encoded image receiver from this track.
      Parameters:
        `agoraVideoEncodedImageReceiver` - Video encoded image receiver instance
      Returns:
        0 on success, <0 on failure

    - #### registerMediaPacketReceiver

          public int registerMediaPacketReceiver(IMediaPacketReceiver agoraMediaPacketReceiver)

      Registers a media packet receiver for this track.
      Parameters:
        `agoraMediaPacketReceiver` - Media packet receiver instance
      Returns:
        0 on success, <0 on failure

    - #### unregisterMediaPacketReceiver

          public int unregisterMediaPacketReceiver(IMediaPacketReceiver agoraMediaPacketReceiver)

      Unregisters a media packet receiver from this track.
      Parameters:
        `agoraMediaPacketReceiver` - Media packet receiver instance
      Returns:
        0 on success, <0 on failure

    - #### nativeDestroy

          private void nativeDestroy(long cptr)

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

    - #### nativeGetStatistics

          private RemoteVideoTrackStats nativeGetStatistics(long cptr)

      Obtains statistics for the remote video track from the native layer.
      Parameters:
        `cptr` - Native pointer to the video track
      Returns:
        Statistics object for the video track

    - #### nativeDestroyStatistics

          private void nativeDestroyStatistics(long cptr,
                                               RemoteVideoTrackStats stats)

      Releases a statistics object that was created natively.
      Parameters:
        `cptr` - Native pointer to the video track
        `stats` - Statistics object to destroy

    - #### nativeGetState

          private int nativeGetState(long cptr)

      Retrieves the native state value of the video track.
      Parameters:
        `cptr` - Native pointer to the video track
      Returns:
        The state of the video track

    - #### nativeGetTrackInfo

          private VideoTrackInfo nativeGetTrackInfo(long cptr)

      Gets video track information from the native layer.
      Parameters:
        `cptr` - Native pointer to the video track
      Returns:
        Video track information

    - #### nativeDestroyTrackInfo

          private void nativeDestroyTrackInfo(long cptr,
                                              VideoTrackInfo info)

      Releases a track info object that was created natively.
      Parameters:
        `cptr` - Native pointer to the video track
        `info` - Track info object to destroy

    - #### nativeRegisterVideoEncodedImageReceiver

          private int nativeRegisterVideoEncodedImageReceiver(long cptr,
                                                              AgoraVideoEncodedImageReceiver agoraVideoEncodedImageReceiver)

      Registers a video encoded image receiver natively.
      Parameters:
        `cptr` - Native pointer to the video track
        `agoraVideoEncodedImageReceiver` - Video encoded image receiver instance
      Returns:
        0 on success, <0 on failure

    - #### nativeUnregisterVideoEncodedImageReceiver

          private int nativeUnregisterVideoEncodedImageReceiver(long cptr,
                                                                AgoraVideoEncodedImageReceiver agoraVideoEncodedImageReceiver)

      Unregisters a video encoded image receiver natively.
      Parameters:
        `cptr` - Native pointer to the video track
        `agoraVideoEncodedImageReceiver` - Video encoded image receiver instance
      Returns:
        0 on success, <0 on failure

    - #### nativeRegisterMediaPacketReceiver

          private int nativeRegisterMediaPacketReceiver(long cptr,
                                                        IMediaPacketReceiver agoraMediaPacketReceiver)

      Registers a media packet receiver natively.
      Parameters:
        `cptr` - Native pointer to the video track
        `agoraMediaPacketReceiver` - Media packet receiver instance
      Returns:
        0 on success, <0 on failure

    - #### nativeUnregisterMediaPacketReceiver

          private int nativeUnregisterMediaPacketReceiver(long cptr,
                                                          IMediaPacketReceiver agoraMediaPacketReceiver)

      Unregisters a media packet receiver natively.
      Parameters:
        `cptr` - Native pointer to the video track
        `agoraMediaPacketReceiver` - Media packet receiver instance
      Returns:
        0 on success, <0 on failure