Server Gateway SDK v3.7.200.21 for Linux Java
Public Member Functions | List of all members
io.agora.rtc.AgoraService Class Reference

Public Member Functions

 AgoraService ()
 
native int initialize (AgoraServiceConfig config)
 
void destroy ()
 
native int setAudioSessionPreset (int audio_scenario)
 
native int setAudioSessionConfig (AudioSessionConfig config)
 
native AudioSessionConfig getAudioSessionConfig ()
 
native void destroyAudioSessionConfig (AudioSessionConfig config)
 
native int setLogFile (String file_path, int file_size)
 
native int setLogFilter (int filters)
 
native AgoraLocalAudioTrack createLocalAudioTrack ()
 
native AgoraLocalAudioTrack createCustomAudioTrackPcm (AgoraAudioPcmDataSender agora_audio_pcm_data_sender)
 
native AgoraLocalAudioTrack createCustomAudioTrackEncoded (AgoraAudioEncodedFrameSender agora_audio_encoded_frame_sender, int mix_mode)
 
native AgoraMediaNodeFactory createMediaNodeFactory ()
 
native AgoraLocalVideoTrack createCustomVideoTrackFrame (AgoraVideoFrameSender agora_video_frame_sender)
 
native AgoraLocalVideoTrack createCustomVideoTrackEncoded (AgoraVideoEncodedImageSender agora_video_encoded_image_sender, SenderOptions options)
 
native AgoraRtcConn agoraRtcConnCreate (RtcConnConfig rtc_conn_config)
 

Detailed Description

The AgoraService class.

AgoraService is the entry point of the Agora Server Gateway SDK. Use this interface to create access points to Agora interfaces, including RTC connections and media tracks.

You can create an AgoraService object by calling AgoraService.

You can configure the AgoraService object for different user scenarios on the global level by using AgoraServiceConfiguration.

Constructor & Destructor Documentation

◆ AgoraService()

io.agora.rtc.AgoraService.AgoraService ( )

Constructor.

Member Function Documentation

◆ agoraRtcConnCreate()

native AgoraRtcConn io.agora.rtc.AgoraService.agoraRtcConnCreate ( RtcConnConfig  rtc_conn_config)

Creates an AgoraRtcConn object.

Parameters
rtc_conn_configThe RTC connection configuration.
Returns
An AgoraRtcConn object.

◆ createCustomAudioTrackEncoded()

native AgoraLocalAudioTrack io.agora.rtc.AgoraService.createCustomAudioTrackEncoded ( AgoraAudioEncodedFrameSender  agora_audio_encoded_frame_sender,
int  mix_mode 
)

Creates a local audio track object with an encoded audio frame sender.

Once created, this track can be used to send encoded audio frames, such as Opus frames.

Parameters
agora_audio_encoded_frame_senderThe encoded audio frame sender: AgoraAudioEncodedFrameSender.
mix_modeThe mixing mode of the encoded audio in the channel.
Returns
An AgoraLocalAudioTrack object.

◆ createCustomAudioTrackPcm()

native AgoraLocalAudioTrack io.agora.rtc.AgoraService.createCustomAudioTrackPcm ( AgoraAudioPcmDataSender  agora_audio_pcm_data_sender)

Creates a local audio track object with a PCM data sender.

Once created, this track can be used to send PCM audio data.

Parameters
agora_audio_pcm_data_senderThe PCM audio data sender.
Returns
An AgoraLocalAudioTrack object.

◆ createCustomVideoTrackEncoded()

native AgoraLocalVideoTrack io.agora.rtc.AgoraService.createCustomVideoTrackEncoded ( AgoraVideoEncodedImageSender  agora_video_encoded_image_sender,
SenderOptions  options 
)

Creates a local video track object with an encoded video image sender.

Once created, this track can be used to send encoded video images, such as H.264 or VP8 frames.

Parameters
agora_video_encoded_image_senderThe encoded video frame sender.
optionsThe configuration for creating video encoded image track.
Returns
An AgoraVideoEncodedImageSender object.

◆ createCustomVideoTrackFrame()

native AgoraLocalVideoTrack io.agora.rtc.AgoraService.createCustomVideoTrackFrame ( AgoraVideoFrameSender  agora_video_frame_sender)

Creates a local video track object with a customized YUV video source.

Once created, this track can be used to send YUV video data from a customized source.

Parameters
agora_video_frame_senderThe customized YUV video frame sender.
Returns
An AgoraLocalVideoTrack object.

◆ createLocalAudioTrack()

native AgoraLocalAudioTrack io.agora.rtc.AgoraService.createLocalAudioTrack ( )

Creates a local audio track object.

By default, the audio track is created from the selected audio input device, such as the built-in microphone on a mobile device.

Returns
An AgoraLocalAudioTrack object.

◆ createMediaNodeFactory()

native AgoraMediaNodeFactory io.agora.rtc.AgoraService.createMediaNodeFactory ( )

Creates a media node factory object.

Returns
An AgoraMediaNodeFactory object.

◆ destroy()

void io.agora.rtc.AgoraService.destroy ( )

Destructor.

◆ destroyAudioSessionConfig()

native void io.agora.rtc.AgoraService.destroyAudioSessionConfig ( AudioSessionConfig  config)

◆ getAudioSessionConfig()

native AudioSessionConfig io.agora.rtc.AgoraService.getAudioSessionConfig ( )

Gets the audio session configuration.

Returns
The audio session configuration.

◆ initialize()

native int io.agora.rtc.AgoraService.initialize ( AgoraServiceConfig  config)

Initializes the AgoraService object.

Parameters
configThe configuration of the initialization. For details, see AgoraServiceConfig.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setAudioSessionConfig()

native int io.agora.rtc.AgoraService.setAudioSessionConfig ( AudioSessionConfig  config)

Customizes the audio session configuration.

Parameters
configThe audio session configuration.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setAudioSessionPreset()

native int io.agora.rtc.AgoraService.setAudioSessionPreset ( int  audio_scenario)

Configures the preset audio scenario.

Parameters
audio_scenarioThe preset audio scenario.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setLogFile()

native int io.agora.rtc.AgoraService.setLogFile ( String  file_path,
int  file_size 
)

Sets the path and size of the SDK log files.

The SDK records all the log data during the SDK runtime in two log files, each with a default size of 512 KB. If you set file_size as 1024 KB, the SDK outputs log files with a maximum size of 2 MB. If the total size of the log files exceeds the set value, the new output log overwrites the old output log.

Note
To ensure that the output log is complete, call this method immediately after calling initialize.
Parameters
file_pathThe pointer to the log file. Ensure that the directory of the log file exists and is writable.
file_sizeThe size of the SDK log file size (KB).
Returns
  • 0: Success.
  • < 0: Failure.

◆ setLogFilter()

native int io.agora.rtc.AgoraService.setLogFilter ( int  filters)

Sets the SDK log output filter.

The log level follows the sequence of OFF, CRITICAL, ERROR, WARNING, INFO, and DEBUG.

Select a level to output the logs in and above the selected level. For example, if you set the log level to WARNING, you can see the logs in the levels of CRITICAL, ERROR, and WARNING.

Parameters
filtersThe log output filter.
  • LOG_LEVEL_NONE (0x0000): Do not output any log file.
  • LOG_LEVEL_INFO (0x0001): (Recommended) Output log files of the INFO level.
  • LOG_LEVEL_WARN (0x0002): Output log files of the WARN level.
  • LOG_LEVEL_ERROR (0x0004): Output log files of the ERROR level.
  • LOG_LEVEL_FATAL (0x0008): Output log files of the FATAL level.
Returns
  • 0: Success.
  • < 0: Failure.

The documentation for this class was generated from the following file: