Agora Java API Reference for Android
|
#include <IAgoraService.h>
The IAgoraService class.
IAgoraService
is the entry point of Agora low-level APIs. Use this interface to create access points to Agora interfaces, including RTC connections and media tracks.
You can create an IAgoraService
object by calling createAgoraService.
You can configure the IAgoraService
object for different user scenarios on the global level by using AgoraServiceConfiguration
.
|
pure virtual |
Initializes the AgoraService object.
config | The configuration of the initialization. For details, see AgoraServiceConfiguration. |
ERR_INVALID_ARGUMENT
, if context
in AgoraServiceConfiguration
is not provided for Android.ERR_INIT_NET_ENGINE
, if the network engine cannot be initialized. On Windows, the error occurs mostly because the connection to the local port is disabled by the firewall. In this case, turn off the firewall and then turn it on again.
|
pure virtual |
Flush log & cache before exit
|
pure virtual |
Releases the AgoraService object.
|
pure virtual |
Configures the preset audio scenario.
scenario | The preset audio scenario: AUDIO_SCENARIO_TYPE. |
|
pure virtual |
Customizes the audio session configuration.
config | The reference to the audio session configuration: AudioSessionConfiguration. |
|
pure virtual |
Gets the audio session configuration.
[out] | config | The pointer to the audio session configuration: AudioSessionConfiguration. |
|
pure virtual |
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 fileSize
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.
filePath | The pointer to the log file. Ensure that the directory of the log file exists and is writable. |
fileSize | The size of the SDK log file size (KB). |
|
pure virtual |
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.
filters | The log output filter.
|
|
pure virtual |
Creates an RtcConnection object and returns the pointer.
cfg | The reference to the RTC connection configuration: RtcConnectionConfiguration. |
|
pure virtual |
Creates a local audio track object and returns the pointer.
By default, the audio track is created from the selected audio input device, such as the built-in microphone on a mobile device.
INVALID_STATE
, if enableAudioProcessor
in AgoraServiceConfiguration is set as false
.
|
pure virtual |
Creates a local audio track object with a PCM data sender and returns the pointer.
Once created, this track can be used to send PCM audio data.
audioSource | The pointer to the PCM audio data sender: IAudioPcmDataSender. |
INVALID_STATE
, if enableAudioProcessor
in AgoraServiceConfiguration is set as false
.
|
pure virtual |
Creates a local audio track object with a audio mixer source and returns the pointer.
Once created, this track can be used to send PCM audio data.
audioSource | The pointer to the audio mixer source : IRemoteAudioMixerSource. |
INVALID_STATE
, if enableAudioProcessor
in AgoraServiceConfiguration
is set as false
.
|
pure virtual |
Creates a local audio track object with an encoded audio frame sender and returns the pointer.
Once created, this track can be used to send encoded audio frames, such as Opus frames.
audioSource | The pointer to the encoded audio frame sender: IAudioEncoderFrameSender. |
mixMode | The mixing mode of the encoded audio in the channel: #TMixMode. |
INVALID_STATE
, if enableAudioProcessor
is set as false
in AgoraServiceConfiguration.
|
pure virtual |
Creates a local audio track object with a media packet sender and returns the pointer.
Once created, this track can be used to send audio packets, such as customized UDP/RTP packets.
source | The pointer to the media packet sender: IMediaPacketSender. |
INVALID_STATE
, if enableAudioProcessor
is set as false
in AgoraServiceConfiguration.
|
pure virtual |
Creates a local audio track object with an IMediaPlayerSource object and returns the pointer.
Once created, this track can be used to send PCM audio data decoded from a media player.
audioSource | The pointer to the player source. See IMediaPlayerSource. |
INVALID_STATE
, if enableAudioProcessor
is set as false
in AgoraServiceConfiguration.
|
pure virtual |
Creates a local audio track object with the recording device source and returns the pointer.
Once created, this track can be used to send audio data got from a recording device.
audioSource | The pointer to the recording device source. See IRecordingDeviceSource. |
enableAec | Whether enable audio echo cancellation for loopback recording. If loopback recording device is a virtual sound card, it should be false, or it should be true. |
|
pure virtual |
Creates an audio device manager object and returns the pointer.
|
pure virtual |
Creates a media node factory object and returns the pointer.
|
pure virtual |
Creates a local video track object with a camera capturer and returns the pointer.
Once created, this track can be used to send video data captured by the camera.
videoSource | The pointer to the camera capturer: ICameraCapturer. |
|
pure virtual |
Creates a local video track object with a screen capturer and returns the pointer.
Once created, this track can be used to send video data for screen sharing.
videoSource | The pointer to the screen capturer: IScreenCapturer. |
|
pure virtual |
Creates a local video track object with a video mixer and returns the pointer.
Once created, this track can be used to send video data processed by the video mixer.
videoSource | The pointer to the video mixer. See IVideoMixerSource. |
|
pure virtual |
Creates a local video track object with a video frame transceiver and returns the pointer.
Once created, this track can be used to send video data processed by the transceiver.
transceiver | The pointer to the video transceiver. See IVideoFrameTransceiver. |
|
pure virtual |
Creates a local video track object with a customized video source and returns the pointer.
Once created, this track can be used to send video data from a customized source.
videoSource | The pointer to the customized video frame sender: IVideoFrameSender. |
|
pure virtual |
Creates a local video track object with an encoded video image sender and returns the pointer.
Once created, this track can be used to send encoded video images, such as H.264 or VP8 frames.
videoSource | The pointer to the encoded video frame sender. See IVideoEncodedImageSender. |
options | The configuration for creating video encoded image track. |
|
pure virtual |
Creates a local video track object with a media packet sender and returns the pointer.
Once created, this track can be used to send video packets, such as customized UDP/RTP packets.
source | The pointer to the media packet sender: IMediaPacketSender. |
|
pure virtual |
Creates a local video track object with an IMediaPlayerSource object and returns the pointer.
Once created, this track can be used to send YUV frames decoded from a player.
videoSource | The pointer to the player source. See IMediaPlayerSource. |
|
pure virtual |
Creates an RTMP streaming service object and returns the pointer.
rtcConnection | The pointer to IRtcConnection. |
appId | The App ID of the live streaming service. |
|
pure virtual |
Creates an Media Relay service object and returns the pointer.
rtcConnection | The pointer to IRtcConnection. |
appId | The App ID of the media relay service. |
|
pure virtual |
Creates an RTM servive object and returns the pointer.