|
Agora RTC Objective-C API Reference
Refactor
|
Typedefs | |
| typedef struct agora::rtc::RtcImage | RtcImage |
| using | RtcEngineReleaseCallback = void(*)() |
Variables | |
| static const int | kVdmMaxDeviceSize = 260 |
| 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 |
| typedef int32_t VideoSourceType |
| typedef struct agora::rtc::RtcImage RtcImage |
Image properties.
This class sets the properties of the watermark and background images in the live video.
| typedef unsigned int uid_t |
| typedef unsigned int track_id_t |
| typedef unsigned int conn_id_t |
| typedef unsigned int video_track_id_t |
| using RtcEngineReleaseCallback = void(*)() |
Callback triggered when IRtcEngine is released.
This callback is triggered when the release method is called to asynchronously release the IRtcEngine object. Call timing: This callback is triggered when the release method is called to asynchronously release the IRtcEngine object.
| enum RTMP_CHANNEL_EVENT |
| enum AudioTrackType |
The connection state between the SDK and the RTMP server.
| Enumerator | |
|---|---|
| STATE_DISCONNECTED | 1: The SDK is disconnected from the RTMP server. This is the initial state when an RTMP Connetion is created by the createRtmpConnection method. The RTMP Connection also enters this state if you call the disconnect method when the SDK is in the STATE_CONNECTING(2), STATE_CONNECTED(3), STATE_RECONNECTING(4) or STATE_FAILED(5) state. |
| STATE_CONNECTING | 2: The SDK is connecting to the RTMP server. The SDK goes to this state after you call the connect method, indicating that the SDK is in the process of establishing a connection to the RTMP server. Once successfully connected, it enters the STATE_CONNECTED(3) state. If the SDK fails to connect to RTMP server, the SDK goes to STATE_FAILED(5). |
| STATE_CONNECTED | 3: The SDK is connected to the RTMP server. This state indicates that the SDK has established a connection to the RTMP server, and you can publish media streams through this connection. Once the connection is interrupted, for example, due to network deterioration or network type change, the SDK tries to reconnect to the RTMP server and enters the STATE_RECONNECTING(4) state. |
| STATE_RECONNECTING | 4: The SDK is reconnecting to the RTMP server. This state indicates that the connection is interrupted by some network issue. The SDK keeps trying connecting to the server. If the SDK fails to reconnect, the SDK goes to STATE_FAILED(5). |
| STATE_FAILED | 5: The SDK fails to connect to the RTMP server. In this state, SDK stops connecting to the server. Call the
|
| STATE_RECONNECTED | 6: The SDK is reconnected to the RTMP server. This state indicates that the connection is interrupted by some network issue. The SDK keeps trying connecting to the server. If the SDK reconnected to server, the SDK goes to STATE_RECONNECTED(6). |
| enum PublishAudioError |
| enum PublishVideoError |
| enum ImageType |
| enum VideoTrackType |
Reasons for a user being offline.
| enum INTERFACE_ID_TYPE |
The interface class.
| Enumerator | |
|---|---|
| AGORA_IID_AUDIO_DEVICE_MANAGER | 1: The |
| AGORA_IID_VIDEO_DEVICE_MANAGER | 2: The |
| AGORA_IID_PARAMETER_ENGINE | This interface class is deprecated. |
| AGORA_IID_MEDIA_ENGINE | 4: The |
| AGORA_IID_AUDIO_ENGINE | |
| AGORA_IID_VIDEO_ENGINE | |
| AGORA_IID_RTC_CONNECTION | |
| AGORA_IID_SIGNALING_ENGINE | This interface class is deprecated. |
| AGORA_IID_MEDIA_ENGINE_REGULATOR | |
| AGORA_IID_LOCAL_SPATIAL_AUDIO | |
| AGORA_IID_STATE_SYNC | |
| AGORA_IID_META_SERVICE | |
| AGORA_IID_MUSIC_CONTENT_CENTER | |
| AGORA_IID_H265_TRANSCODER | |
| enum QUALITY_TYPE |
Network quality types.
| Enumerator | |
|---|---|
| QUALITY_UNKNOWN | 0: The network quality is unknown.
|
| QUALITY_EXCELLENT | 1: The network quality is excellent. |
| QUALITY_GOOD | 2: The network quality is quite good, but the bitrate may be slightly lower than excellent. |
| QUALITY_POOR | 3: Users can feel the communication is slightly impaired. |
| QUALITY_BAD | 4: Users cannot communicate smoothly. |
| QUALITY_VBAD | 5: The quality is so bad that users can barely communicate. |
| QUALITY_DOWN | 6: The network is down and users cannot communicate at all. |
| QUALITY_UNSUPPORTED | 7: (For future use) The network quality cannot be detected. |
| QUALITY_DETECTING | 8: The last-mile network probe test is in progress. |
| enum FIT_MODE_TYPE |
Content fit modes.
| enum VIDEO_ORIENTATION |
| enum FRAME_RATE |
| enum FRAME_WIDTH |
| enum FRAME_HEIGHT |
| enum VIDEO_FRAME_TYPE |
| enum ORIENTATION_MODE |
Video output orientation mode.
Video degradation preferences when the bandwidth is a constraint.
The highest frame rate supported by the screen sharing device.
The level of the codec capability.
| enum VIDEO_CODEC_TYPE |
Video codec types.
| Enumerator | |
|---|---|
| VIDEO_CODEC_NONE | 0: (Default) Unspecified codec format. The SDK automatically matches the appropriate codec format based on the current video stream's resolution and device performance. |
| VIDEO_CODEC_VP8 | 1: Standard VP8. |
| VIDEO_CODEC_H264 | 2: Standard H.264. |
| VIDEO_CODEC_H265 | 3: Standard H.265. |
| VIDEO_CODEC_GENERIC | 6: Generic. This type is used for transmitting raw video data, such as encrypted video frames. The SDK returns this type of video frames in callbacks, and you need to decode and render the frames yourself. |
| VIDEO_CODEC_GENERIC_H264 | 7: Generic H264.
|
| VIDEO_CODEC_AV1 | 12: AV1. @technical preview |
| VIDEO_CODEC_VP9 | 13: VP9. |
| VIDEO_CODEC_GENERIC_JPEG | 20: Generic JPEG. This type consumes minimum computing resources and applies to IoT devices. |
The camera focal length types.
| enum TCcMode |
| enum AUDIO_CODEC_TYPE |
The codec type of audio.
| enum AUDIO_ENCODING_TYPE |
Audio encoding type.
| enum WATERMARK_FIT_MODE |
The adaptation mode of the watermark.
| Enumerator | |
|---|---|
| FIT_MODE_COVER_POSITION | 0: Use the |
| FIT_MODE_USE_IMAGE_RATIO | 1: Use the value you set in |
| enum H264PacketizeMode |
| enum VIDEO_STREAM_TYPE |
The type of video streams.
Compression preference for video encoding.
| enum ENCODING_PREFERENCE |
Video encoder preference.
Video mirror mode.
| enum VIDEO_MODULE_TYPE |
| enum HDR_CAPABILITY |
| enum CODEC_CAP_MASK |
The bit mask of the codec type.
The mode in which the video stream is sent.
Type of watermark source.
| enum MultipathMode |
The transmission mode of data over multiple network paths.
| enum MultipathType |
| enum CLIENT_ROLE_TYPE |
Quality change of the local video in terms of target frame rate and target bit rate since last count.
Reasons why the QoE of the local user when receiving a remote audio stream is poor.
| enum AUDIO_AINS_MODE |
AI noise suppression modes.
| enum AUDIO_PROFILE_TYPE |
The audio profile.
| Enumerator | |
|---|---|
| AUDIO_PROFILE_DEFAULT | 0: The default audio profile.
|
| AUDIO_PROFILE_SPEECH_STANDARD | 1: A sample rate of 32 kHz, audio encoding, mono, and a bitrate of up to 18 Kbps. |
| AUDIO_PROFILE_MUSIC_STANDARD | 2: A sample rate of 48 kHz, music encoding, mono, and a bitrate of up to 64 Kbps. |
| AUDIO_PROFILE_MUSIC_STANDARD_STEREO | 3: A sample rate of 48 kHz, music encoding, stereo, and a bitrate of up to 80 Kbps. To implement stereo audio, you also need to call |
| AUDIO_PROFILE_MUSIC_HIGH_QUALITY | 4: A sample rate of 48 kHz, music encoding, mono, and a bitrate of up to 96 Kbps. |
| AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO | 5: A sample rate of 48 kHz, music encoding, stereo, and a bitrate of up to 128 Kbps. To implement stereo audio, you also need to call |
| AUDIO_PROFILE_IOT | 6: A sample rate of 16 kHz, audio encoding, mono, and Acoustic Echo Cancellation (AEC) enabled. |
| AUDIO_PROFILE_NUM | Enumerator boundary. |
| enum AUDIO_SCENARIO_TYPE |
The audio scenarios.
| enum VIDEO_CONTENT_HINT |
The content hint for screen sharing.
| enum SCREEN_SCENARIO_TYPE |
The screen sharing scenario.
The video application scenarios.
| Enumerator | |
|---|---|
| APPLICATION_SCENARIO_GENERAL | 0: (Default) The general scenario. |
| APPLICATION_SCENARIO_MEETING | 1: The meeting scenario.
|
| APPLICATION_SCENARIO_1V1 | 2: 1v1 video call scenario.
|
| APPLICATION_SCENARIO_LIVESHOW |
|
The video QoE preference type.
The brightness level of the video image captured by the local camera.
Camera stabilization modes.
The camera stabilization effect increases in the order of 1 < 2 < 3, and the latency will also increase accordingly.
The state of the local audio.
Reasons for local audio state changes.
Local video state types.
The local video event type.
Reasons for local video state changes.
| enum REMOTE_AUDIO_STATE |
Remote audio states.
The reason for the remote audio state change.
| enum REMOTE_VIDEO_STATE |
The state of the remote video stream.
The reason for the remote video state change.
| enum REMOTE_USER_STATE |
The remote user state information.
The downscale level of the remote video stream . The higher the downscale level, the more the video downscales.
Video codec profile types.
States of the Media Push.
Reasons for changes in the status of RTMP or RTMPS streaming.
| enum RTMP_STREAMING_EVENT |
Events during the Media Push.
The error code of the local video mixing failure.
The status of the last-mile probe test.
Reasons causing the change of the connection state.
| Enumerator | |
|---|---|
| CONNECTION_CHANGED_CONNECTING | 0: The SDK is connecting to the Agora edge server. |
| CONNECTION_CHANGED_JOIN_SUCCESS | 1: The SDK has joined the channel successfully. |
| CONNECTION_CHANGED_INTERRUPTED | 2: The connection between the SDK and the Agora edge server is interrupted. |
| CONNECTION_CHANGED_BANNED_BY_SERVER | 3: The connection between the SDK and the Agora edge server is banned by the Agora edge server. For example, when a user is kicked out of the channel, this status will be returned. |
| CONNECTION_CHANGED_JOIN_FAILED | 4: The SDK fails to join the channel. When the SDK fails to join the channel for more than 20 minutes, this code will be returned and the SDK stops reconnecting to the channel. You need to prompt the user to try to switch to another network and rejoin the channel. |
| CONNECTION_CHANGED_LEAVE_CHANNEL | 5: The SDK has left the channel. |
| CONNECTION_CHANGED_INVALID_APP_ID | 6: The App ID is invalid. You need to rejoin the channel with a valid APP ID and make sure the App ID you are using is consistent with the one generated in the Agora Console. |
| CONNECTION_CHANGED_INVALID_CHANNEL_NAME | 7: Invalid channel name. Rejoin the channel with a valid channel name. A valid channel name is a string of up to 64 bytes in length. Supported characters (89 characters in total):
|
| CONNECTION_CHANGED_INVALID_TOKEN | 8: Invalid token. Possible reasons are as follows:
|
| CONNECTION_CHANGED_TOKEN_EXPIRED | 9: The token currently being used has expired. You need to generate a new token on your server and rejoin the channel with the new token. |
| CONNECTION_CHANGED_REJECTED_BY_SERVER | 10: The connection is rejected by server. Possible reasons are as follows:
|
| CONNECTION_CHANGED_SETTING_PROXY_SERVER | 11: The connection state changed to reconnecting because the SDK has set a proxy server. |
| CONNECTION_CHANGED_RENEW_TOKEN | 12: The connection state changed because the token is renewed. |
| CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED | 13: Client IP address changed. If you receive this code multiple times, You need to prompt the user to switch networks and try joining the channel again. |
| CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT | 14: Timeout for the keep-alive of the connection between the SDK and the Agora edge server. The SDK tries to reconnect to the server automatically. |
| CONNECTION_CHANGED_REJOIN_SUCCESS | 15: The user has rejoined the channel successfully. |
| CONNECTION_CHANGED_LOST | 16: The connection between the SDK and the server is lost. |
| CONNECTION_CHANGED_ECHO_TEST | 17: The connection state changes due to the echo test. |
| CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED_BY_USER | 18: The local IP address was changed by the user. |
| CONNECTION_CHANGED_SAME_UID_LOGIN | 19: The user joined the same channel from different devices with the same UID. |
| CONNECTION_CHANGED_TOO_MANY_BROADCASTERS | 20: The number of hosts in the channel has reached the upper limit. |
| CONNECTION_CHANGED_LICENSE_VALIDATION_FAILURE | 21: The connection is failed due to license validation failure. |
| CONNECTION_CHANGED_CERTIFICATION_VERYFY_FAILURE | |
| CONNECTION_CHANGED_STREAM_CHANNEL_NOT_AVAILABLE | 23: The connection is failed due to the lack of granting permission to the stream channel. |
| CONNECTION_CHANGED_INCONSISTENT_APPID | 24: The connection is failed due to join channel with an inconsistent appid. |
The reason for a user role switch failure.
| Enumerator | |
|---|---|
| CLIENT_ROLE_CHANGE_FAILED_TOO_MANY_BROADCASTERS | 1: The number of hosts in the channel exceeds the limit.
|
| CLIENT_ROLE_CHANGE_FAILED_NOT_AUTHORIZED | 2: The request is rejected by the Agora server. Agora recommends you prompt the user to try to switch their user role again. |
| CLIENT_ROLE_CHANGE_FAILED_REQUEST_TIME_OUT | 3: The request is timed out. Agora recommends you prompt the user to check the network connection and try to switch their user role again.
|
| CLIENT_ROLE_CHANGE_FAILED_CONNECTION_FAILED | 4: The SDK is disconnected from the Agora edge server. You can troubleshoot the failure through the
|
| enum NETWORK_TYPE |
Network type.
Setting mode of the view.
| enum AUDIO_TRACK_TYPE |
The type of the audio track.
| Enumerator | |
|---|---|
| AUDIO_TRACK_INVALID | -1: Invalid audio track |
| AUDIO_TRACK_MIXABLE | 0: Mixable audio tracks. This type of audio track supports mixing with other audio streams (such as audio streams captured by microphone) and playing locally or publishing to channels after mixing. The latency of mixable audio tracks is higher than that of direct audio tracks. |
| AUDIO_TRACK_DIRECT | 1: Direct audio tracks. This type of audio track will replace the audio streams captured by the microphone and does not support mixing with other audio streams. The latency of direct audio tracks is lower than that of mixable audio tracks.
|
The options for SDK preset voice beautifier effects.
Preset local voice reverberation options. bitmap allocation:
| bit31 | bit30 - bit24 | bit23 - bit16 | bit15 - bit8 | bit7 - bit0 |
|---|---|---|---|---|
| reserved | 0x1: voice beauty | 0x1: chat beautification | effect types | effect settings |
| 0x2: singing beautification | ||||
| 0x3: timbre transform | ||||
| 0x4: ultra high_quality | ||||
| -----------------— | --------------------------— | |||
| 0x2: audio effect | 0x1: space construction | |||
| 0x2: voice changer effect | ||||
| 0x3: style transform | ||||
| 0x4: electronic sound | ||||
| 0x5: magic tone | ||||
| -----------------— | --------------------------— | |||
| 0x3: voice changer | 0x1: voice transform |
| enum AUDIO_EFFECT_PRESET |
Preset audio effects.
To get better audio effects, Agora recommends calling setAudioProfile(AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario) and setting the profile parameter as recommended below before using the preset audio effects.
| Preset audio effects | profile |
|---|---|
| - ROOM_ACOUSTICS_VIRTUAL_STEREO - ROOM_ACOUSTICS_3D_VOICE - ROOM_ACOUSTICS_VIRTUAL_SURROUND_SOUND | AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO or AUDIO_PROFILE_MUSIC_STANDARD_STEREO |
Other preset audio effects (except for AUDIO_EFFECT_OFF ) | AUDIO_PROFILE_MUSIC_HIGH_QUALITY or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO |
The options for SDK preset voice conversion effects.
| enum VOICE_AI_TUNER_TYPE |
Voice AI tuner sound types.
Recording quality.
Audio profile.
| enum AREA_CODE |
| enum AREA_CODE_EX |
The error code of the channel media relay.
The state code of the channel media relay.
| enum ENCRYPTION_MODE |
The built-in encryption mode.
Agora recommends using AES_128_GCM2 or AES_256_GCM2 encrypted mode. These two modes support the use of salt for higher security.
Encryption error type.
| enum UPLOAD_ERROR_REASON |
Represents the error codes after calling renewToken.
| enum PERMISSION_TYPE |
The subscribing state.
| enum STREAM_PUBLISH_STATE |
The publishing state.
The audio filter types of in-ear monitoring.
| enum THREAD_PRIORITY_TYPE |
| enum MEDIA_TRACE_EVENT |
| enum CONFIG_FETCH_TYPE |
| enum LOCAL_PROXY_MODE |
| enum RecorderStreamType |
| enum RdtStreamType |
Reliable Data Transmission Tunnel message stream type.
@technical preview
| enum RdtState |
Reliable Data Transmission tunnel state.
@technical preview
| enum VIDEO_SOURCE_TYPE |
The type of the video source.
| enum AUDIO_SOURCE_TYPE |
The audio source type.
| enum AudioRoute |
The type of the audio route.
| enum BYTES_PER_SAMPLE |
The use mode of the audio data.
| enum STREAMING_SRC_ERR |
The error code of streaming source.
| enum STREAMING_SRC_STATE |
The state machine of Streaming Source.
The result of IH265Transcoder interface invoking.
| enum MEDIA_DEVICE_TYPE |
Media device types.
The playback state of the music file.
The reason why the playback state of the music file changes. Reported in the onAudioMixingStateChanged callback.
| enum INJECT_STREAM_STATUS |
The status of importing an external video stream in a live broadcast.
The midrange frequency for audio equalization.
| enum AUDIO_REVERB_TYPE |
Audio reverberation types.
Options for handling audio and video stream fallback when network conditions are weak.
| Enumerator | |
|---|---|
| STREAM_FALLBACK_OPTION_DISABLED | 0: No fallback processing is performed on audio and video streams, the quality of the audio and video streams cannot be guaranteed. |
| STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW | 1: Only receive low-quality (low resolution, low bitrate) video stream. |
| STREAM_FALLBACK_OPTION_AUDIO_ONLY | 2: When the network conditions are weak, try to receive the low-quality video stream first. If the video cannot be displayed due to extremely weak network environment, then fall back to receiving audio-only stream. |
| STREAM_FALLBACK_OPTION_VIDEO_STREAM_LAYER_1 | 3~8: If the receiver SDK uses RtcEngineParameters::setRemoteSubscribeFallbackOption,it will receive one of the streams from agora::rtc::VIDEO_STREAM_LAYER_1 to agora::rtc::VIDEO_STREAM_LAYER_6 if the related layer exists when the network condition is poor. The lower bound of fallback depends on the STREAM_FALLBACK_OPTION_VIDEO_STREAM_LAYER_X. |
| STREAM_FALLBACK_OPTION_VIDEO_STREAM_LAYER_2 | |
| STREAM_FALLBACK_OPTION_VIDEO_STREAM_LAYER_3 | |
| STREAM_FALLBACK_OPTION_VIDEO_STREAM_LAYER_4 | |
| STREAM_FALLBACK_OPTION_VIDEO_STREAM_LAYER_5 | |
| STREAM_FALLBACK_OPTION_VIDEO_STREAM_LAYER_6 | |
| enum PRIORITY_TYPE |
Lifecycle of the CDN live video stream.
| enum CAMERA_DIRECTION |
| enum CLOUD_PROXY_TYPE |
The cloud proxy type.
| enum PROXY_TYPE |
The cloud proxy type.
| enum FeatureType |
Reasons for the changes in CDN streaming status.
The current CDN streaming state.
Media device states.
| enum VIDEO_PROFILE_TYPE |
|
static |
|
static |
|
static |
|
static |
|
static |
The maximum size of the device name and ID.
| OPTIONAL_ENUM_CLASS VideoFrameMetaDataType |
| OPTIONAL_ENUM_CLASS VideoFrameGravityRotation |
| const int STANDARD_BITRATE = 0 |
(Recommended) 0: Standard bitrate mode.
In this mode, the video bitrate is twice the base bitrate.
| const int COMPATIBLE_BITRATE = -1 |
-1: Compatible bitrate mode.
In this mode, the video bitrate is the same as the base bitrate.. If you choose this mode in the live-broadcast profile, the video frame rate may be lower than the set value.
| const int DEFAULT_MIN_BITRATE = -1 |
-1: (For future use) The default minimum bitrate.
| const int DEFAULT_MIN_BITRATE_EQUAL_TO_TARGET_BITRATE = -2 |
-2: (For future use) Set minimum bitrate the same as target bitrate.
|
static |
|
static |
|
static |