io.agora.rtc

## Class AgoraLocalVideoTrack

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

-     public class AgoraLocalVideoTrack
      extends java.lang.Object

  Represents a local video track for publishing video to a channel.

- - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraLocalVideoTrack(long cptr)` Constructor for AgoraLocalVideoTrack.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) void` | `destroy()` Destroys the local video track.
    `(package private) void` | `destroyStatistics(LocalVideoTrackStats stats)` Destroys the provided LocalVideoTrackStats object.
    `(package private) int` | `enableSimulcastStream(int enabled, SimulcastStreamConfig config)` Enables or disables the simulcast stream.
    `(package private) long` | `getNativeHandle()` Gets the native handle of the local video track.
    `(package private) int` | `getState()` Gets the current state of the local video track.
    `(package private) LocalVideoTrackStats` | `getStatistics()` Retrieves the statistics of the local video track.
    `private void` | `nativeDestroy(long cptr)` Releases the native video track handle.
    `private void` | `nativeDestroyStatistics(long cptr, LocalVideoTrackStats stats)` Releases a statistics object that was created natively.
    `private int` | `nativeEnableSimulcastStream(long cptr, int enabled, SimulcastStreamConfig config)` Enables or disables simulcast stream natively.
    `private int` | `nativeGetState(long cptr)` Retrieves the native state value of the video track.
    `private LocalVideoTrackStats` | `nativeGetStatistics(long cptr)` Obtains statistics for the video track from the native layer.
    `private void` | `nativeSetEnabled(long cptr, int enable)` Enables or disables the video track at the native layer.
    `private int` | `nativeSetVideoEncoderConfig(long cptr, VideoEncoderConfig config)` Sets the video encoder configuration natively.
    `(package private) void` | `setEnabled(int enable)` Enables or disables the local video track.
    `(package private) int` | `setVideoEncoderConfig(VideoEncoderConfig config)` Sets the video encoder configuration.

    - ### 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 local video track resource.

  - ### Constructor Detail

    - #### AgoraLocalVideoTrack

          AgoraLocalVideoTrack(long cptr)

      Constructor for AgoraLocalVideoTrack.
      Parameters:
        `cptr` - Pointer to the native video track object.

  - ### Method Detail

    - #### getNativeHandle

          long getNativeHandle()

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

    - #### destroy

          void destroy()

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

    - #### setEnabled

          void setEnabled(int enable)

      Enables or disables the local video track.
      Parameters:
        `enable` - 1 to enable, 0 to disable.

    - #### setVideoEncoderConfig

          int setVideoEncoderConfig(VideoEncoderConfig config)

      Sets the video encoder configuration.
      Parameters:
        `config` - The video encoder configuration to set.
      Returns:
        0 on success, <0 on failure.

    - #### enableSimulcastStream

          int enableSimulcastStream(int enabled,
                                    SimulcastStreamConfig config)

      Enables or disables the simulcast stream.
      Parameters:
        `enabled` - 1 to enable, 0 to disable.
        `config` - The simulcast stream configuration.
      Returns:
        0 on success, <0 on failure.

    - #### getState

          int getState()

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

    - #### getStatistics

          LocalVideoTrackStats getStatistics()

      Retrieves the statistics of the local video track.
      Returns:
        An instance of LocalVideoTrackStats containing the statistics.

    - #### destroyStatistics

          void destroyStatistics(LocalVideoTrackStats stats)

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

    - #### nativeDestroy

          private void nativeDestroy(long cptr)

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

    - #### nativeSetEnabled

          private void nativeSetEnabled(long cptr,
                                        int enable)

      Enables or disables the video track at the native layer.
      Parameters:
        `cptr` - Native pointer to the video track
        `enable` - 1 to enable, 0 to disable

    - #### nativeSetVideoEncoderConfig

          private int nativeSetVideoEncoderConfig(long cptr,
                                                  VideoEncoderConfig config)

      Sets the video encoder configuration natively.
      Parameters:
        `cptr` - Native pointer to the video track
        `config` - Video encoder configuration
      Returns:
        0 on success, <0 on failure

    - #### nativeEnableSimulcastStream

          private int nativeEnableSimulcastStream(long cptr,
                                                  int enabled,
                                                  SimulcastStreamConfig config)

      Enables or disables simulcast stream natively.
      Parameters:
        `cptr` - Native pointer to the video track
        `enabled` - 1 to enable, 0 to disable
        `config` - Simulcast stream configuration
      Returns:
        0 on success, <0 on failure

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

    - #### nativeGetStatistics

          private LocalVideoTrackStats nativeGetStatistics(long cptr)

      Obtains statistics for the 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,
                                               LocalVideoTrackStats stats)

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