Agora RTC Objective-C API Reference Refactor

Data Structures | Namespaces | Typedefs | Enumerations | Functions | Variables
AgoraBase.h File Reference

Go to the source code of this file.

## Data Structures
class | AutoPtr< T >
class | CopyableAutoPtr< T >
class | IString
class | IIterator
class | IContainer
class | AOutputIterator< T >
class | AList< T >
struct | UserInfo
struct | VideoDimensions
struct | SenderOptions
struct | EncodedAudioFrameAdvancedSettings
struct | EncodedAudioFrameInfo
struct | AudioPcmDataInfo
struct | VideoSubscriptionOptions
struct | EncodedVideoFrameInfo
struct | AdvanceOptions
struct | CodecCapLevels
struct | CodecCapInfo
struct | FocalLengthInfo
struct | VideoEncoderConfiguration
struct | DataStreamConfig
struct | SimulcastStreamConfig
struct | SimulcastConfig
struct | SimulcastConfig::StreamLayerConfig
struct | Rectangle
struct | WatermarkRatio
struct | WatermarkOptions
struct | WatermarkTimestamp
struct | WatermarkLiteral
struct | WatermarkBuffer
struct | WatermarkConfig
struct | PathStats
struct | MultipathStats
struct | RtcStats
struct | ClientRoleOptions
struct | VideoFormat
struct | VideoTrackInfo
struct | AudioVolumeInfo
struct | DeviceInfo
class | IPacketObserver
struct | IPacketObserver::Packet
struct | LocalAudioStats
struct | RtcImage
struct | LiveStreamAdvancedFeature
struct | TranscodingUser
struct | LiveTranscoding
struct | TranscodingVideoStream
struct | LocalTranscoderConfiguration
struct | MixedAudioStream
struct | LocalAudioMixerConfiguration
struct | LastmileProbeConfig
struct | LastmileProbeOneWayResult
struct | LastmileProbeResult
struct | VideoCanvas
struct | BeautyOptions
struct | FaceShapeAreaOptions
struct | FaceShapeBeautyOptions
struct | LowlightEnhanceOptions
struct | VideoDenoiserOptions
struct | ColorEnhanceOptions
struct | VirtualBackgroundSource
struct | SegmentationProperty
struct | AudioTrackConfig
struct | ScreenAudioParameters
struct | ScreenCaptureParameters
struct | AudioRecordingConfiguration
struct | AudioEncodedFrameObserverConfig
class | IAudioEncodedFrameObserver
struct | ChannelMediaInfo
struct | ChannelMediaRelayConfiguration
struct | UplinkNetworkInfo
struct | DownlinkNetworkInfo
struct | DownlinkNetworkInfo::PeerDownlinkInfo
struct | EncryptionConfig
struct | EchoTestConfiguration
struct | UserInfo
struct | VideoRenderingTracingInfo
struct | LogUploadServerInfo
struct | AdvancedConfigInfo
struct | LocalAccessPointConfiguration
struct | RecorderStreamInfo
class | IEngineBase
class | AParameter
class | LicenseCallback
struct | VideoLayout

## Namespaces
| agora
| agora::util
| agora::rtc
| agora::base

## Typedefs
typedef struct agora::rtc::RtcImage | RtcImage

## Enumerations
enum | WARN_CODE_TYPE { WARN_INVALID_VIEW = 8, WARN_INIT_VIDEO = 16, WARN_PENDING = 20, WARN_NO_AVAILABLE_CHANNEL = 103, WARN_LOOKUP_CHANNEL_TIMEOUT = 104, WARN_LOOKUP_CHANNEL_REJECTED = 105, WARN_OPEN_CHANNEL_TIMEOUT = 106, WARN_OPEN_CHANNEL_REJECTED = 107, WARN_SWITCH_LIVE_VIDEO_TIMEOUT = 111, WARN_SET_CLIENT_ROLE_TIMEOUT = 118, WARN_OPEN_CHANNEL_INVALID_TICKET = 121, WARN_OPEN_CHANNEL_TRY_NEXT_VOS = 122, WARN_CHANNEL_CONNECTION_UNRECOVERABLE = 131, WARN_CHANNEL_CONNECTION_IP_CHANGED = 132, WARN_CHANNEL_CONNECTION_PORT_CHANGED = 133, WARN_CHANNEL_SOCKET_ERROR = 134, WARN_AUDIO_MIXING_OPEN_ERROR = 701, WARN_ADM_RUNTIME_PLAYOUT_WARNING = 1014, WARN_ADM_RUNTIME_RECORDING_WARNING = 1016, WARN_ADM_RECORD_AUDIO_SILENCE = 1019, WARN_ADM_PLAYOUT_MALFUNCTION = 1020, WARN_ADM_RECORD_MALFUNCTION = 1021, WARN_ADM_RECORD_AUDIO_LOWLEVEL = 1031, WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL = 1032, WARN_ADM_WINDOWS_NO_DATA_READY_EVENT = 1040, WARN_APM_HOWLING = 1051, WARN_ADM_GLITCH_STATE = 1052, WARN_ADM_IMPROPER_SETTINGS = 1053, WARN_ADM_POP_STATE = 1055, WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322, WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE = 1323, WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE = 1324 }
enum | ERROR_CODE_TYPE { ERR_OK = 0, ERR_FAILED = 1, ERR_INVALID_ARGUMENT = 2, ERR_NOT_READY = 3, ERR_NOT_SUPPORTED = 4, ERR_REFUSED = 5, ERR_BUFFER_TOO_SMALL = 6, ERR_NOT_INITIALIZED = 7, ERR_INVALID_STATE = 8, ERR_NO_PERMISSION = 9, ERR_TIMEDOUT = 10, ERR_CANCELED = 11, ERR_TOO_OFTEN = 12, ERR_BIND_SOCKET = 13, ERR_NET_DOWN = 14, ERR_JOIN_CHANNEL_REJECTED = 17, ERR_LEAVE_CHANNEL_REJECTED = 18, ERR_ALREADY_IN_USE = 19, ERR_ABORTED = 20, ERR_INIT_NET_ENGINE = 21, ERR_RESOURCE_LIMITED = 22, ERR_FUNC_IS_PROHIBITED = 23, ERR_INVALID_APP_ID = 101, ERR_INVALID_CHANNEL_NAME = 102, ERR_NO_SERVER_RESOURCES = 103, ERR_TOKEN_EXPIRED = 109, ERR_INVALID_TOKEN = 110, ERR_CONNECTION_INTERRUPTED = 111, ERR_CONNECTION_LOST = 112, ERR_NOT_IN_CHANNEL = 113, ERR_SIZE_TOO_LARGE = 114, ERR_BITRATE_LIMIT = 115, ERR_TOO_MANY_DATA_STREAMS = 116, ERR_STREAM_MESSAGE_TIMEOUT = 117, ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED = 119, ERR_DECRYPTION_FAILED = 120, ERR_INVALID_USER_ID = 121, ERR_DATASTREAM_DECRYPTION_FAILED = 122, ERR_CLIENT_IS_BANNED_BY_SERVER = 123, ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH = 130, ERR_LICENSE_CREDENTIAL_INVALID = 131, ERR_INVALID_USER_ACCOUNT = 134, ERR_MODULE_NOT_FOUND = 157 , ERR_PCMSEND_FORMAT = 200, ERR_PCMSEND_BUFFEROVERFLOW = 201, ERR_LOAD_MEDIA_ENGINE = 1001, ERR_ADM_GENERAL_ERROR = 1005, ERR_ADM_INIT_PLAYOUT = 1008, ERR_ADM_START_PLAYOUT = 1009, ERR_ADM_STOP_PLAYOUT = 1010, ERR_ADM_INIT_RECORDING = 1011, ERR_ADM_START_RECORDING = 1012, ERR_ADM_STOP_RECORDING = 1013, ERR_VDM_CAMERA_NOT_AUTHORIZED = 1501 }
enum | FIT_MODE_TYPE { MODE_COVER = 1, MODE_CONTAIN = 2 }
enum | CAMERA_FOCAL_LENGTH_TYPE { CAMERA_FOCAL_LENGTH_DEFAULT = 0, CAMERA_FOCAL_LENGTH_WIDE_ANGLE = 1, CAMERA_FOCAL_LENGTH_ULTRA_WIDE = 2, CAMERA_FOCAL_LENGTH_TELEPHOTO = 3 }
enum | TCcMode { CC_ENABLED, CC_DISABLED }
enum | H264PacketizeMode { NonInterleaved = 0, SingleNalUnit }
enum | WATERMARK_SOURCE_TYPE { IMAGE = 0, BUFFER = 1, LITERAL = 2, TIMESTAMPS = 3 }
enum | MultipathMode { Duplicate = 0, Dynamic }
enum | MultipathType { LAN = 0, WIFI, Mobile, Unknown = 99 }
enum | VIDEO_QOE_PREFERENCE_TYPE { VIDEO_QOE_PREFERENCE_BALANCE = 1, VIDEO_QOE_PREFERENCE_DELAY_FIRST = 2, VIDEO_QOE_PREFERENCE_PICTURE_QUALITY_FIRST = 3, VIDEO_QOE_PREFERENCE_FLUENCY_FIRST = 4 }
enum | CAMERA_STABILIZATION_MODE { CAMERA_STABILIZATION_MODE_OFF = -1, CAMERA_STABILIZATION_MODE_AUTO = 0, CAMERA_STABILIZATION_MODE_LEVEL_1 = 1, CAMERA_STABILIZATION_MODE_LEVEL_2 = 2, CAMERA_STABILIZATION_MODE_LEVEL_3 = 3, CAMERA_STABILIZATION_MODE_MAX_LEVEL = CAMERA_STABILIZATION_MODE_LEVEL_3 }
enum | LOCAL_VIDEO_EVENT_TYPE { LOCAL_VIDEO_EVENT_TYPE_SCREEN_CAPTURE_WINDOW_HIDDEN = 1, LOCAL_VIDEO_EVENT_TYPE_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_HIDDEN = 2, LOCAL_VIDEO_EVENT_TYPE_SCREEN_CAPTURE_STOPPED_BY_USER = 3, LOCAL_VIDEO_EVENT_TYPE_SCREEN_CAPTURE_SYSTEM_INTERNAL_ERROR = 4 }
enum | REMOTE_USER_STATE { USER_STATE_MUTE_AUDIO = (1 << 0), USER_STATE_MUTE_VIDEO = (1 << 1), USER_STATE_ENABLE_VIDEO = (1 << 4), USER_STATE_ENABLE_LOCAL_VIDEO = (1 << 8) }
enum | REMOTE_VIDEO_DOWNSCALE_LEVEL { REMOTE_VIDEO_DOWNSCALE_LEVEL_NONE, REMOTE_VIDEO_DOWNSCALE_LEVEL_1, REMOTE_VIDEO_DOWNSCALE_LEVEL_2, REMOTE_VIDEO_DOWNSCALE_LEVEL_3, REMOTE_VIDEO_DOWNSCALE_LEVEL_4 }
enum | VOICE_BEAUTIFIER_PRESET { VOICE_BEAUTIFIER_OFF = 0x00000000, CHAT_BEAUTIFIER_MAGNETIC = 0x01010100, CHAT_BEAUTIFIER_FRESH = 0x01010200, CHAT_BEAUTIFIER_VITALITY = 0x01010300, SINGING_BEAUTIFIER = 0x01020100, TIMBRE_TRANSFORMATION_VIGOROUS = 0x01030100, TIMBRE_TRANSFORMATION_DEEP = 0x01030200, TIMBRE_TRANSFORMATION_MELLOW = 0x01030300, TIMBRE_TRANSFORMATION_FALSETTO = 0x01030400, TIMBRE_TRANSFORMATION_FULL = 0x01030500, TIMBRE_TRANSFORMATION_CLEAR = 0x01030600, TIMBRE_TRANSFORMATION_RESOUNDING = 0x01030700, TIMBRE_TRANSFORMATION_RINGING = 0x01030800, ULTRA_HIGH_QUALITY_VOICE = 0x01040100 }
enum | AUDIO_EFFECT_PRESET { AUDIO_EFFECT_OFF = 0x00000000, ROOM_ACOUSTICS_KTV = 0x02010100, ROOM_ACOUSTICS_VOCAL_CONCERT = 0x02010200, ROOM_ACOUSTICS_STUDIO = 0x02010300, ROOM_ACOUSTICS_PHONOGRAPH = 0x02010400, ROOM_ACOUSTICS_VIRTUAL_STEREO = 0x02010500, ROOM_ACOUSTICS_SPACIAL = 0x02010600, ROOM_ACOUSTICS_ETHEREAL = 0x02010700, ROOM_ACOUSTICS_3D_VOICE = 0x02010800, ROOM_ACOUSTICS_VIRTUAL_SURROUND_SOUND = 0x02010900, ROOM_ACOUSTICS_CHORUS = 0x02010D00, VOICE_CHANGER_EFFECT_UNCLE = 0x02020100, VOICE_CHANGER_EFFECT_OLDMAN = 0x02020200, VOICE_CHANGER_EFFECT_BOY = 0x02020300, VOICE_CHANGER_EFFECT_SISTER = 0x02020400, VOICE_CHANGER_EFFECT_GIRL = 0x02020500, VOICE_CHANGER_EFFECT_PIGKING = 0x02020600, VOICE_CHANGER_EFFECT_HULK = 0x02020700, STYLE_TRANSFORMATION_RNB = 0x02030100, STYLE_TRANSFORMATION_POPULAR = 0x02030200, PITCH_CORRECTION = 0x02040100 }
enum | AREA_CODE_EX { AREA_CODE_OC = 0x00000040, AREA_CODE_SA = 0x00000080, AREA_CODE_AF = 0x00000100, AREA_CODE_KR = 0x00000200, AREA_CODE_HKMC = 0x00000400, AREA_CODE_US = 0x00000800, AREA_CODE_RU = 0x00001000, AREA_CODE_OVS = 0xFFFFFFFE }
enum | ENCRYPTION_MODE { AES_128_XTS = 1, AES_128_ECB = 2, AES_256_XTS = 3, SM4_128_ECB = 4, AES_128_GCM = 5, AES_256_GCM = 6, AES_128_GCM2 = 7, AES_256_GCM2 = 8, MODE_END }
enum | RENEW_TOKEN_ERROR_CODE { RENEW_TOKEN_SUCCESS = 0, RENEW_TOKEN_FAILURE = 1, RENEW_TOKEN_TOKEN_EXPIRED = 2, RENEW_TOKEN_INVALID_TOKEN = 3, RENEW_TOKEN_INVALID_CHANNEL_NAME = 4, RENEW_TOKEN_INCONSISTENT_APPID = 5, RENEW_TOKEN_CANCELED_BY_NEW_REQUEST = 6 }
enum | THREAD_PRIORITY_TYPE { LOWEST = 0, LOW = 1, NORMAL = 2, HIGH = 3, HIGHEST = 4, CRITICAL = 5 }
enum | RdtStreamType { RDT_STREAM_CMD, RDT_STREAM_DATA, RDT_STREAM_COUNT }
enum | RdtState { RDT_STATE_CLOSED, RDT_STATE_OPENED, RDT_STATE_BLOCKED, RDT_STATE_PENDING, RDT_STATE_BROKEN }

## Functions
AGORA_API const char *AGORA_CALL | getAgoraSdkVersion (int *build)
AGORA_API const char *AGORA_CALL | getAgoraSdkErrorDescription (int err)
AGORA_API int AGORA_CALL | createAgoraCredential (agora::util::AString &credential)
AGORA_API int AGORA_CALL | getAgoraCertificateVerifyResult (const char *credential_buf, int credential_len, const char *certificate_buf, int certificate_len)
AGORA_API void | setAgoraLicenseCallback (agora::base::LicenseCallback *callback)
AGORA_API agora::base::LicenseCallback * | getAgoraLicenseCallback ()

## Variables
const int | STANDARD_BITRATE = 0
const int | COMPATIBLE_BITRATE = -1
const int | DEFAULT_MIN_BITRATE = -1
const int | DEFAULT_MIN_BITRATE_EQUAL_TO_TARGET_BITRATE = -2

## Macro Definition Documentation

## ◆ MAX_PATH_260

#define MAX_PATH_260 (260)

## ◆ AGORA_API

#define AGORA_API extern "C"

## ◆ AGORA_CPP_API

#define AGORA_CPP_API

## ◆ AGORA_CALL

#define AGORA_CALL

## ◆ __deprecated

#define __deprecated

## ◆ OPTIONAL_NULLPTR

#define OPTIONAL_NULLPTR NULL

## ◆ INVALID_DISPLAY_ID

#define INVALID_DISPLAY_ID (-2)

## Function Documentation

## ◆ getAgoraSdkVersion()

AGORA_API const char* AGORA_CALL getAgoraSdkVersion | ( | int * | build | ) |

Gets the version of the SDK.

Parameters

  [out] | build | The build number of Agora SDK.

Returns
  The string of the version of the SDK.

## ◆ getAgoraSdkErrorDescription()

AGORA_API const char* AGORA_CALL getAgoraSdkErrorDescription | ( | int | err | ) |

Gets error description of an error code.

Parameters

  [in] | err | The error code.

Returns
  The description of the error code.

## ◆ setAgoraSdkExternalSymbolLoader()

AGORA_API int AGORA_CALL setAgoraSdkExternalSymbolLoader | ( | void *(*)(const char *symname) | func | ) |

## ◆ createAgoraCredential()

AGORA_API int AGORA_CALL createAgoraCredential | ( | agora::util::AString & | credential | ) |

Generate credential

Parameters

  [in,out] | credential | The content of the credential.

Returns
  The description of the error code.

Note
  For license only, everytime will generate a different credential. So, just need to call once for a device, and then save the credential

## ◆ getAgoraCertificateVerifyResult()

AGORA_API int AGORA_CALL getAgoraCertificateVerifyResult | ( | const char * | credential_buf,
|  | int | credential_len,
|  | const char * | certificate_buf,
|  | int | certificate_len
| ) |  |

Verify given certificate and return the result When you receive onCertificateRequired event, you must validate the certificate by calling this function. This is sync call, and if validation is success, it will return ERR_OK. And if failed to pass validation, you won't be able to joinChannel and ERR_CERT_FAIL will be returned.

Parameters

  [in] | credential_buf | pointer to the credential's content.
  [in] | credential_len | the length of the credential's content.
  [in] | certificate_buf | pointer to the certificate's content.
  [in] | certificate_len | the length of the certificate's content.

Returns
  The description of the error code.

Note
  For license only.

## ◆ setAgoraLicenseCallback()

AGORA_API void setAgoraLicenseCallback | ( | agora::base::LicenseCallback * | callback | ) |

Implement the agora::base::LicenseCallback, create a LicenseCallback object to receive callbacks of license.

Parameters

  [in] | callback | The object of agora::LiceseCallback, set the callback to null before delete it.

## ◆ getAgoraLicenseCallback()

AGORA_API agora::base::LicenseCallback* getAgoraLicenseCallback | ( |  | ) |

Gets the LicenseCallback pointer if already setup, otherwise, return null.

Returns
  a pointer of agora::base::LicenseCallback

## ◆ getAgoraCurrentMonotonicTimeInMs()

AGORA_API int64_t AGORA_CALL getAgoraCurrentMonotonicTimeInMs | ( |  | ) |