io.agora.rtc

## Class AgoraService

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

-     public class AgoraService
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private AgoraParameter` | `agoraParameter`
    `private long` | `cptr`
    `private boolean` | `isLowDelay`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraService()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AgoraRtcConn` | `agoraRtcConnCreate(RtcConnConfig rtcConnConfig)` Creates an RTC connection.
    `private void` | `checkPlatformArchitecture()`
    `AgoraAudioDeviceManager` | `createAudioDeviceManager()` Creates an audio device manager.
    `AgoraLocalVideoTrack` | `createCameraVideoTrack(AgoraCameraCapturer agoraCameraCapturer)` Creates a camera video track.
    `AgoraLocalAudioTrack` | `createCustomAudioTrackEncoded(AgoraAudioEncodedFrameSender agoraAudioEncodedFrameSender, int mixMode)` Creates a custom audio track with encoded frame sender.
    `AgoraLocalAudioTrack` | `createCustomAudioTrackPacket(AgoraMediaPacketSender agoraMediaPacketSender)` Creates a custom audio track with media packet sender.
    `AgoraLocalAudioTrack` | `createCustomAudioTrackPcm(AgoraAudioPcmDataSender agoraAudioPcmDataSender)` Creates a custom audio track with PCM data sender.
    `AgoraLocalVideoTrack` | `createCustomVideoTrackEncoded(AgoraVideoEncodedImageSender agora_video_encoded_image_sender, SenderOptions options)` Creates a custom video track with encoded image sender.
    `AgoraLocalVideoTrack` | `createCustomVideoTrackFrame(AgoraVideoFrameSender agoraVideoFrameSender)` Creates a custom video track with frame sender.
    `AgoraLocalVideoTrack` | `createCustomVideoTrackPacket(AgoraMediaPacketSender agoraMediaPacketSender)` Creates a custom video track with media packet sender.
    `AgoraLocalAudioTrack` | `createLocalAudioTrack()` Creates a local audio track.
    `AgoraMediaNodeFactory` | `createMediaNodeFactory()` Creates a media node factory.
    `AgoraLocalAudioTrack` | `createMediaPlayerAudioTrack(AgoraMediaPlayerSource agoraMediaPlayerSource)` Creates a media player audio track.
    `AgoraLocalVideoTrack` | `createMediaPlayerVideoTrack(AgoraMediaPlayerSource agoraMediaPlayerSource)` Creates a media player video track.
    `AgoraLocalVideoTrack` | `createMixedVideoTrack(AgoraVideoMixer agoraVideoMixer)` Creates a mixed video track.
    `AgoraLocalAudioTrack` | `createRecordingDeviceAudioTrack(AgoraRecordDevice agoraRecordDevice)` Creates a recording device audio track.
    `AgoraRtmpStreamingService` | `createRtmpStreamingService(AgoraRtcConn agoraRtcConn, java.lang.String appId)` Creates an RTMP streaming service.
    `AgoraRtmService` | `createRtmService()` Creates an RTM service.
    `AgoraLocalVideoTrack` | `createScreenVideoTrack(AgoraScreenCapturer agoraScreenCapturer)` Creates a screen video track.
    `void` | `destroy()` Destroys the Agora service.
    `void` | `destroyAudioSessionConfig(AudioSessionConfig config)` Destroys the audio session configuration.
    `int` | `disableExtension(java.lang.String provider, java.lang.String extension, java.lang.String trackId)` Disables an extension.
    `int` | `enableExtension(java.lang.String provider, java.lang.String extension, java.lang.String trackId, boolean enable)` Enables an extension.
    `AgoraParameter` | `getAgoraParameter()` Gets the Agora parameter.
    `AudioSessionConfig` | `getAudioSessionConfig()` Gets the audio session configuration.
    `static java.lang.String` | `getSdkVersion()` Gets the SDK version
    `private long` | `init()`
    `int` | `initialize(AgoraServiceConfig config)` Initializes the Agora service with the specified configuration.
    `int` | `loadExtensionProvider(java.lang.String path, boolean unloadAfterUse)` Loads an extension provider.
    `private AgoraRtcConn` | `nativeAgoraRtcConnCreate(long cptr, RtcConnConfig rtcConnConfig)`
    `private AgoraAudioDeviceManager` | `nativeCreateAudioDeviceManager(long cptr)`
    `private AgoraLocalVideoTrack` | `nativeCreateCameraVideoTrack(long cptr, AgoraCameraCapturer agoraCameraCapturer)`
    `private AgoraLocalAudioTrack` | `nativeCreateCustomAudioTrackEncoded(long cptr, AgoraAudioEncodedFrameSender agoraAudioEncodedFrameSender, int mixMode)`
    `private AgoraLocalAudioTrack` | `nativeCreateCustomAudioTrackPacket(long cptr, AgoraMediaPacketSender agoraMediaPacketSender)`
    `private AgoraLocalAudioTrack` | `nativeCreateCustomAudioTrackPcm(long cptr, AgoraAudioPcmDataSender agoraAudioPcmDataSender)`
    `private AgoraLocalVideoTrack` | `nativeCreateCustomVideoTrackEncoded(long cptr, AgoraVideoEncodedImageSender agoraVideoEncodedImageSender, SenderOptions options)`
    `private AgoraLocalVideoTrack` | `nativeCreateCustomVideoTrackFrame(long cptr, AgoraVideoFrameSender agoraVideoFrameSender)`
    `private AgoraLocalVideoTrack` | `nativeCreateCustomVideoTrackPacket(long cptr, AgoraMediaPacketSender agoraMediaPacketSender)`
    `private AgoraLocalAudioTrack` | `nativeCreateLocalAudioTrack(long cptr)`
    `private AgoraMediaNodeFactory` | `nativeCreateMediaNodeFactory(long cptr)`
    `private AgoraLocalAudioTrack` | `nativeCreateMediaPlayerAudioTrack(long cptr, AgoraMediaPlayerSource agoraMediaPlayerSource)`
    `private AgoraLocalVideoTrack` | `nativeCreateMediaPlayerVideoTrack(long cptr, AgoraMediaPlayerSource agoraMediaPlayerSource)`
    `private AgoraLocalVideoTrack` | `nativeCreateMixedVideoTrack(long cptr, AgoraVideoMixer agoraVideoMixer)`
    `private AgoraLocalAudioTrack` | `nativeCreateRecordingDeviceAudioTrack(long cptr, AgoraRecordDevice agoraRecordDevice)`
    `private AgoraRtmpStreamingService` | `nativeCreateRtmpStreamingService(long cptr, AgoraRtcConn agoraRtcConn, java.lang.String appId)`
    `private AgoraRtmService` | `nativeCreateRtmService(long cptr)`
    `private AgoraLocalVideoTrack` | `nativeCreateScreenVideoTrack(long cptr, AgoraScreenCapturer agoraScreenCapturer)`
    `private void` | `nativeDestroy(long cptr)`
    `private void` | `nativeDestroyAudioSessionConfig(long cptr, AudioSessionConfig config)`
    `private int` | `nativeDisableExtension(long cptr, java.lang.String provider, java.lang.String extension, java.lang.String trackId)`
    `private int` | `nativeEnableExtension(long cptr, java.lang.String provider, java.lang.String extension, java.lang.String trackId, boolean enable)`
    `private AgoraParameter` | `nativeGetAgoraParameter(long cptr)`
    `private AudioSessionConfig` | `nativeGetAudioSessionConfig(long cptr)`
    `private int` | `nativeInitialize(long cptr, AgoraServiceConfig config)`
    `private int` | `nativeLoadExtensionProvider(long cptr, java.lang.String path, boolean unloadAfterUse)`
    `private int` | `nativeSetAudioSessionConfig(long cptr, AudioSessionConfig config)`
    `private int` | `nativeSetAudioSessionPreset(long cptr, int audioScenario)`
    `private int` | `nativeSetLogFile(long cptr, java.lang.String filePath, int fileSize)`
    `private int` | `nativeSetLogFilter(long cptr, int filters)`
    `int` | `setAudioSessionConfig(AudioSessionConfig config)` Sets the audio session configuration.
    `int` | `setAudioSessionPreset(int audioScenario)` Sets the audio session preset.
    `int` | `setLogFile(java.lang.String filePath, int fileSize)` Sets the log file.
    `int` | `setLogFilter(int filters)` Sets the log filter.

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

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

- - ### Field Detail

    - #### cptr

          private long cptr

    - #### isLowDelay

          private boolean isLowDelay

    - #### agoraParameter

          private AgoraParameter agoraParameter

  - ### Constructor Detail

    - #### AgoraService

          public AgoraService()

  - ### Method Detail

    - #### init

          private long init()

    - #### getSdkVersion

          public static java.lang.String getSdkVersion()

      Gets the SDK version
      Returns:
        SDK version

    - #### checkPlatformArchitecture

          private void checkPlatformArchitecture()

    - #### initialize

          public int initialize(AgoraServiceConfig config)

      Initializes the Agora service with the specified configuration.
      Parameters:
        `config` - The configuration for the Agora service.
      Returns:
        0: Success, < 0: Failure

    - #### destroy

          public void destroy()

      Destroys the Agora service.

    - #### setAudioSessionPreset

          public int setAudioSessionPreset(int audioScenario)

      Sets the audio session preset.
      Parameters:
        `audioScenario` - The audio scenario to set.
      Returns:
        0: Success, < 0: Failure

    - #### setAudioSessionConfig

          public int setAudioSessionConfig(AudioSessionConfig config)

      Sets the audio session configuration.
      Parameters:
        `config` - The audio session configuration to set.
      Returns:
        0: Success, < 0: Failure

    - #### getAudioSessionConfig

          public AudioSessionConfig getAudioSessionConfig()

      Gets the audio session configuration.
      Returns:
        The audio session configuration.

    - #### destroyAudioSessionConfig

          public void destroyAudioSessionConfig(AudioSessionConfig config)

      Destroys the audio session configuration.
      Parameters:
        `config` - The audio session configuration to destroy.

    - #### setLogFile

          public int setLogFile(java.lang.String filePath,
                                int fileSize)

      Sets the log file.
      Parameters:
        `filePath` - The path of the log file.
        `fileSize` - The size of the log file in bytes.
      Returns:
        0: Success, < 0: Failure

    - #### setLogFilter

          public int setLogFilter(int filters)

      Sets the log filter.
      Parameters:
        `filters` - The log filters to set.
      Returns:
        0: Success, < 0: Failure

    - #### createLocalAudioTrack

          public AgoraLocalAudioTrack createLocalAudioTrack()

      Creates a local audio track.
      Returns:
        The local audio track.

    - #### createCustomAudioTrackPcm

          public AgoraLocalAudioTrack createCustomAudioTrackPcm(AgoraAudioPcmDataSender agoraAudioPcmDataSender)

      Creates a custom audio track with PCM data sender.
      Parameters:
        `agoraAudioPcmDataSender` - The PCM data sender.
      Returns:
        The custom audio track.

    - #### createCustomAudioTrackEncoded

          public AgoraLocalAudioTrack createCustomAudioTrackEncoded(AgoraAudioEncodedFrameSender agoraAudioEncodedFrameSender,
                                                                    int mixMode)

      Creates a custom audio track with encoded frame sender.
      Parameters:
        `agoraAudioEncodedFrameSender` - The encoded frame sender.
        `mixMode` - The mix mode.
      Returns:
        The custom audio track.

    - #### createCustomAudioTrackPacket

          public AgoraLocalAudioTrack createCustomAudioTrackPacket(AgoraMediaPacketSender agoraMediaPacketSender)

      Creates a custom audio track with media packet sender.
      Parameters:
        `agoraMediaPacketSender` - The media packet sender.
      Returns:
        The custom audio track.

    - #### createMediaPlayerAudioTrack

          public AgoraLocalAudioTrack createMediaPlayerAudioTrack(AgoraMediaPlayerSource agoraMediaPlayerSource)

      Creates a media player audio track.
      Parameters:
        `agoraMediaPlayerSource` - The media player source.
      Returns:
        The media player audio track.

    - #### createRecordingDeviceAudioTrack

          public AgoraLocalAudioTrack createRecordingDeviceAudioTrack(AgoraRecordDevice agoraRecordDevice)

      Creates a recording device audio track.
      Parameters:
        `agoraRecordDevice` - The recording device.
      Returns:
        The recording device audio track.

    - #### createAudioDeviceManager

          public AgoraAudioDeviceManager createAudioDeviceManager()

      Creates an audio device manager.
      Returns:
        The audio device manager.

    - #### createMediaNodeFactory

          public AgoraMediaNodeFactory createMediaNodeFactory()

      Creates a media node factory.
      Returns:
        The media node factory.

    - #### createCameraVideoTrack

          public AgoraLocalVideoTrack createCameraVideoTrack(AgoraCameraCapturer agoraCameraCapturer)

      Creates a camera video track.
      Parameters:
        `agoraCameraCapturer` - The camera capturer.
      Returns:
        The camera video track.

    - #### createScreenVideoTrack

          public AgoraLocalVideoTrack createScreenVideoTrack(AgoraScreenCapturer agoraScreenCapturer)

      Creates a screen video track.
      Parameters:
        `agoraScreenCapturer` - The screen capturer.
      Returns:
        The screen video track.

    - #### createMixedVideoTrack

          public AgoraLocalVideoTrack createMixedVideoTrack(AgoraVideoMixer agoraVideoMixer)

      Creates a mixed video track.
      Parameters:
        `agoraVideoMixer` - The video mixer.
      Returns:
        The mixed video track.

    - #### createCustomVideoTrackFrame

          public AgoraLocalVideoTrack createCustomVideoTrackFrame(AgoraVideoFrameSender agoraVideoFrameSender)

      Creates a custom video track with frame sender.
      Parameters:
        `agoraVideoFrameSender` - The video frame sender.
      Returns:
        The custom video track.

    - #### createCustomVideoTrackEncoded

          public AgoraLocalVideoTrack createCustomVideoTrackEncoded(AgoraVideoEncodedImageSender agora_video_encoded_image_sender,
                                                                    SenderOptions options)

      Creates a custom video track with encoded image sender.
      Parameters:
        `agora_video_encoded_image_sender` - The encoded image sender.
        `options` - The sender options.
      Returns:
        The custom video track.

    - #### createCustomVideoTrackPacket

          public AgoraLocalVideoTrack createCustomVideoTrackPacket(AgoraMediaPacketSender agoraMediaPacketSender)

      Creates a custom video track with media packet sender.
      Parameters:
        `agoraMediaPacketSender` - The media packet sender.
      Returns:
        The custom video track.

    - #### createMediaPlayerVideoTrack

          public AgoraLocalVideoTrack createMediaPlayerVideoTrack(AgoraMediaPlayerSource agoraMediaPlayerSource)

      Creates a media player video track.
      Parameters:
        `agoraMediaPlayerSource` - The media player source.
      Returns:
        The media player video track.

    - #### createRtmpStreamingService

          public AgoraRtmpStreamingService createRtmpStreamingService(AgoraRtcConn agoraRtcConn,
                                                                      java.lang.String appId)

      Creates an RTMP streaming service.
      Parameters:
        `agoraRtcConn` - The RTC connection.
        `appId` - The application ID.
      Returns:
        The RTMP streaming service.

    - #### createRtmService

          public AgoraRtmService createRtmService()

      Creates an RTM service.
      Returns:
        The RTM service.

    - #### agoraRtcConnCreate

          public AgoraRtcConn agoraRtcConnCreate(RtcConnConfig rtcConnConfig)

      Creates an RTC connection.
      Parameters:
        `rtcConnConfig` - The RTC connection configuration.
      Returns:
        The RTC connection.

    - #### loadExtensionProvider

          public int loadExtensionProvider(java.lang.String path,
                                           boolean unloadAfterUse)

      Loads an extension provider.
      Parameters:
        `path` - The path of the extension provider.
        `unloadAfterUse` - Whether to unload after use.
      Returns:
        0: Success, < 0: Failure

    - #### enableExtension

          public int enableExtension(java.lang.String provider,
                                     java.lang.String extension,
                                     java.lang.String trackId,
                                     boolean enable)

      Enables an extension.
      Parameters:
        `provider` - The provider of the extension.
        `extension` - The extension to enable.
        `trackId` - The track ID.
        `enable` - Whether to enable the extension.
      Returns:
        0: Success, < 0: Failure

    - #### disableExtension

          public int disableExtension(java.lang.String provider,
                                      java.lang.String extension,
                                      java.lang.String trackId)

      Disables an extension.
      Parameters:
        `provider` - The provider of the extension.
        `extension` - The extension to disable.
        `trackId` - The track ID.
      Returns:
        0: Success, < 0: Failure

    - #### getAgoraParameter

          public AgoraParameter getAgoraParameter()

      Gets the Agora parameter.
      Returns:
        The Agora parameter.

    - #### nativeInitialize

          private int nativeInitialize(long cptr,
                                       AgoraServiceConfig config)

    - #### nativeDestroy

          private void nativeDestroy(long cptr)

    - #### nativeSetAudioSessionPreset

          private int nativeSetAudioSessionPreset(long cptr,
                                                  int audioScenario)

    - #### nativeSetAudioSessionConfig

          private int nativeSetAudioSessionConfig(long cptr,
                                                  AudioSessionConfig config)

    - #### nativeGetAudioSessionConfig

          private AudioSessionConfig nativeGetAudioSessionConfig(long cptr)

    - #### nativeDestroyAudioSessionConfig

          private void nativeDestroyAudioSessionConfig(long cptr,
                                                       AudioSessionConfig config)

    - #### nativeSetLogFile

          private int nativeSetLogFile(long cptr,
                                       java.lang.String filePath,
                                       int fileSize)

    - #### nativeSetLogFilter

          private int nativeSetLogFilter(long cptr,
                                         int filters)

    - #### nativeCreateLocalAudioTrack

          private AgoraLocalAudioTrack nativeCreateLocalAudioTrack(long cptr)

    - #### nativeCreateCustomAudioTrackPcm

          private AgoraLocalAudioTrack nativeCreateCustomAudioTrackPcm(long cptr,
                                                                       AgoraAudioPcmDataSender agoraAudioPcmDataSender)

    - #### nativeCreateCustomAudioTrackEncoded

          private AgoraLocalAudioTrack nativeCreateCustomAudioTrackEncoded(long cptr,
                                                                           AgoraAudioEncodedFrameSender agoraAudioEncodedFrameSender,
                                                                           int mixMode)

    - #### nativeCreateCustomAudioTrackPacket

          private AgoraLocalAudioTrack nativeCreateCustomAudioTrackPacket(long cptr,
                                                                          AgoraMediaPacketSender agoraMediaPacketSender)

    - #### nativeCreateMediaPlayerAudioTrack

          private AgoraLocalAudioTrack nativeCreateMediaPlayerAudioTrack(long cptr,
                                                                         AgoraMediaPlayerSource agoraMediaPlayerSource)

    - #### nativeCreateRecordingDeviceAudioTrack

          private AgoraLocalAudioTrack nativeCreateRecordingDeviceAudioTrack(long cptr,
                                                                             AgoraRecordDevice agoraRecordDevice)

    - #### nativeCreateAudioDeviceManager

          private AgoraAudioDeviceManager nativeCreateAudioDeviceManager(long cptr)

    - #### nativeCreateMediaNodeFactory

          private AgoraMediaNodeFactory nativeCreateMediaNodeFactory(long cptr)

    - #### nativeCreateCameraVideoTrack

          private AgoraLocalVideoTrack nativeCreateCameraVideoTrack(long cptr,
                                                                    AgoraCameraCapturer agoraCameraCapturer)

    - #### nativeCreateScreenVideoTrack

          private AgoraLocalVideoTrack nativeCreateScreenVideoTrack(long cptr,
                                                                    AgoraScreenCapturer agoraScreenCapturer)

    - #### nativeCreateMixedVideoTrack

          private AgoraLocalVideoTrack nativeCreateMixedVideoTrack(long cptr,
                                                                   AgoraVideoMixer agoraVideoMixer)

    - #### nativeCreateCustomVideoTrackFrame

          private AgoraLocalVideoTrack nativeCreateCustomVideoTrackFrame(long cptr,
                                                                         AgoraVideoFrameSender agoraVideoFrameSender)

    - #### nativeCreateCustomVideoTrackEncoded

          private AgoraLocalVideoTrack nativeCreateCustomVideoTrackEncoded(long cptr,
                                                                           AgoraVideoEncodedImageSender agoraVideoEncodedImageSender,
                                                                           SenderOptions options)

    - #### nativeCreateCustomVideoTrackPacket

          private AgoraLocalVideoTrack nativeCreateCustomVideoTrackPacket(long cptr,
                                                                          AgoraMediaPacketSender agoraMediaPacketSender)

    - #### nativeCreateMediaPlayerVideoTrack

          private AgoraLocalVideoTrack nativeCreateMediaPlayerVideoTrack(long cptr,
                                                                         AgoraMediaPlayerSource agoraMediaPlayerSource)

    - #### nativeCreateRtmpStreamingService

          private AgoraRtmpStreamingService nativeCreateRtmpStreamingService(long cptr,
                                                                             AgoraRtcConn agoraRtcConn,
                                                                             java.lang.String appId)

    - #### nativeCreateRtmService

          private AgoraRtmService nativeCreateRtmService(long cptr)

    - #### nativeAgoraRtcConnCreate

          private AgoraRtcConn nativeAgoraRtcConnCreate(long cptr,
                                                        RtcConnConfig rtcConnConfig)

    - #### nativeLoadExtensionProvider

          private int nativeLoadExtensionProvider(long cptr,
                                                  java.lang.String path,
                                                  boolean unloadAfterUse)

    - #### nativeEnableExtension

          private int nativeEnableExtension(long cptr,
                                            java.lang.String provider,
                                            java.lang.String extension,
                                            java.lang.String trackId,
                                            boolean enable)

    - #### nativeDisableExtension

          private int nativeDisableExtension(long cptr,
                                             java.lang.String provider,
                                             java.lang.String extension,
                                             java.lang.String trackId)

    - #### nativeGetAgoraParameter

          private AgoraParameter nativeGetAgoraParameter(long cptr)