#include <IAgoraService.h>
|
virtual int | initialize (const AgoraServiceConfiguration &config)=0 |
|
virtual int | release ()=0 |
|
virtual int | setAudioSessionPreset (agora::rtc::AUDIO_SCENARIO_TYPE scenario, aosl_ref_t ares=AOSL_REF_INVALID)=0 |
|
virtual int | setLogFile (const char *filePath, unsigned int fileSize, aosl_ref_t ares=AOSL_REF_INVALID)=0 |
|
virtual int | setLogFilter (unsigned int filters, aosl_ref_t ares=AOSL_REF_INVALID)=0 |
|
virtual agora_refptr< rtc::IRtcConnection > | createRtcConnection (const rtc::RtcConnectionConfiguration &cfg)=0 |
|
virtual agora_refptr< rtc::IRtmpConnection > | createRtmpConnection (const rtc::RtmpConnectionConfiguration &cfg)=0 |
|
virtual agora_refptr< rtc::ILocalAudioTrack > | createLocalAudioTrack ()=0 |
|
virtual agora_refptr< rtc::ILocalAudioTrack > | createCustomAudioTrack (agora_refptr< rtc::IAudioPcmDataSender > audioSource)=0 |
|
virtual agora_refptr< rtc::ILocalAudioTrack > | createDirectCustomAudioTrack (agora_refptr< rtc::IAudioPcmDataSender > audioSource)=0 |
|
virtual agora_refptr< rtc::ILocalAudioTrack > | createCustomAudioTrack (agora_refptr< rtc::IAudioEncodedFrameSender > audioSource, TMixMode mixMode, aosl_ref_t ares=AOSL_REF_INVALID)=0 |
|
virtual agora_refptr< rtc::IMediaNodeFactory > | createMediaNodeFactory ()=0 |
|
virtual agora_refptr< rtc::ILocalVideoTrack > | createMixedVideoTrack (agora_refptr< rtc::IVideoMixerSource > videoSource, const char *id=OPTIONAL_NULLPTR)=0 |
|
virtual agora_refptr< rtc::ILocalVideoTrack > | createCustomVideoTrack (agora_refptr< rtc::IVideoFrameSender > videoSource, const char *id=OPTIONAL_NULLPTR)=0 |
|
virtual agora_refptr< rtc::ILocalVideoTrack > | createCustomVideoTrack (agora_refptr< rtc::IVideoEncodedImageSender > videoSource, const rtc::SenderOptions &options, const char *id=OPTIONAL_NULLPTR)=0 |
|
virtual agora_refptr< base::IAgoraParameter > | getAgoraParameter ()=0 |
|
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
.
◆ ~IAgoraService()
virtual agora::base::IAgoraService::~IAgoraService |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ createCustomAudioTrack() [1/2]
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.
- Parameters
-
audioSource | The pointer to the encoded audio frame sender: IAudioEncoderFrameSender. |
mixMode | The mixing mode of the encoded audio in the channel: TMixMode. |
ares | This parameter is used for the SDK lifecycle protection. Fill in the default value. |
- Returns
-
◆ createCustomAudioTrack() [2/2]
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.
- Parameters
-
- Returns
-
◆ createCustomVideoTrack() [1/2]
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.
- Parameters
-
videoSource | The pointer to the encoded video frame sender. See IVideoEncodedImageSender. |
options | The configuration for creating video encoded image track. |
id | The stream ID. |
- Returns
-
◆ createCustomVideoTrack() [2/2]
Creates a local video track object with a customized YUV video source and returns the pointer.
Once created, this track can be used to send YUV video data from a customized source.
- Parameters
-
videoSource | The pointer to the customized video frame sender: IVideoFrameSender. |
id | The stream ID. |
- Returns
-
◆ createDirectCustomAudioTrack()
Creates a local audio track object with a PCM data sender and returns the pointer. The source is not intended to be mixed with other source.
Once created, this track can be used to send PCM audio data.
- Parameters
-
- Returns
-
◆ createLocalAudioTrack()
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.
- Returns
-
◆ createMediaNodeFactory()
Creates a media node factory object and returns the pointer.
- Returns
-
◆ createMixedVideoTrack()
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.
- Parameters
-
- Returns
-
◆ createRtcConnection()
Creates an RtcConnection object and returns the pointer.
- Parameters
-
- Returns
-
◆ createRtmpConnection()
Creates an IRtmpConnection object.
- Parameters
-
- Returns
- A pointer to an
IRtmpConnection
object: Success.
- A null pointer: Failure.
◆ getAgoraParameter()
◆ initialize()
Initializes the AgoraService object.
- Parameters
-
- Returns
- 0: Success.
- < 0: Failure.
◆ release()
virtual int agora::base::IAgoraService::release |
( |
| ) |
|
|
pure virtual |
Releases the AgoraService object.
- Returns
- 0: Success.
- < 0: Failure.
◆ setAudioSessionPreset()
Configures the preset audio scenario.
- Parameters
-
scenario | The preset audio scenario: AUDIO_SCENARIO_TYPE. |
ares | This parameter is used for the SDK lifecycle protection. Fill in the default value. |
- Returns
- 0: Success.
- < 0: Failure.
◆ setLogFile()
virtual int agora::base::IAgoraService::setLogFile |
( |
const char * |
filePath, |
|
|
unsigned int |
fileSize, |
|
|
aosl_ref_t |
ares = AOSL_REF_INVALID |
|
) |
| |
|
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.
- Note
- To ensure that the output log is complete, call this method immediately after calling initialize.
- Parameters
-
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). |
ares | This parameter is used for the SDK lifecycle protection. Fill in the default value. |
- Returns
- 0: Success.
- < 0: Failure.
◆ setLogFilter()
virtual int agora::base::IAgoraService::setLogFilter |
( |
unsigned int |
filters, |
|
|
aosl_ref_t |
ares = AOSL_REF_INVALID |
|
) |
| |
|
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.
- Parameters
-
filters | The 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.
|
ares | This parameter is used for the SDK lifecycle protection. Fill in the default value. |
- Returns
- 0: Success.
- < 0: Failure.
The documentation for this class was generated from the following file: