Agora RTC Objective-C API Reference
Refactor
|
Typedefs | |
typedef struct agora::rtc::RtcImage | RtcImage |
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 |
typedef int32_t VideoSourceType |
typedef struct agora::rtc::RtcImage RtcImage |
Image properties.
typedef unsigned int uid_t |
typedef unsigned int track_id_t |
typedef unsigned int conn_id_t |
typedef unsigned int video_track_id_t |
enum RTMP_CHANNEL_EVENT |
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 |
enum QUALITY_TYPE |
The network quality types.
Enumerator | |
---|---|
QUALITY_UNKNOWN | 0: The network quality is unknown.
|
QUALITY_EXCELLENT | 1: The quality is excellent. |
QUALITY_GOOD | 2: The quality is quite good, but the bitrate may be slightly lower than excellent. |
QUALITY_POOR | 3: Users can feel the communication slightly impaired. |
QUALITY_BAD | 4: Users cannot communicate smoothly. |
QUALITY_VBAD | 5: Users can barely communicate. |
QUALITY_DOWN | 6: Users cannot communicate at all. |
QUALITY_UNSUPPORTED | 7: (For future use) The network quality cannot be detected. |
QUALITY_DETECTING | 8: Detecting the network quality. |
enum FIT_MODE_TYPE |
Content fit modes.
enum VIDEO_ORIENTATION |
The rotation information.
enum FRAME_RATE |
enum FRAME_WIDTH |
enum FRAME_HEIGHT |
enum VIDEO_FRAME_TYPE |
Types of the video frame.
enum ORIENTATION_MODE |
Video output orientation modes.
(For future use) Video degradation preferences under limited bandwidth.
enum VIDEO_CODEC_TYPE |
The video codec types.
enum TCcMode |
enum AUDIO_CODEC_TYPE |
enum AUDIO_ENCODING_TYPE |
Audio encoding types of the audio encoded frame observer.
enum WATERMARK_FIT_MODE |
The adaptation mode of the watermark.
Enumerator | |
---|---|
FIT_MODE_COVER_POSITION | Use the |
FIT_MODE_USE_IMAGE_RATIO | Use the value you set in |
enum H264PacketizeMode |
enum VIDEO_STREAM_TYPE |
enum ENCODING_PREFERENCE |
enum VIDEO_SOURCE_TYPE |
The capture type of the custom video source.
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_PROFILE_TYPE |
Audio profile types.
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 (AES) enabled. |
AUDIO_PROFILE_NUM |
enum AUDIO_SCENARIO_TYPE |
The audio scenario.
enum VIDEO_CONTENT_HINT |
Video content hints.
enum SCREEN_SCENARIO_TYPE |
The screen sharing scenario.
The brightness level of the video image captured by the local camera.
Local audio states.
Local audio state error codes.
Local video state types.
Local video state error codes.
enum REMOTE_AUDIO_STATE |
Remote audio states.
Reasons for the remote audio state change.
enum REMOTE_VIDEO_STATE |
The state of the remote video.
Enumerator | |
---|---|
REMOTE_VIDEO_STATE_STOPPED | 0: The remote video is in the default state. The SDK reports this state in the case of |
REMOTE_VIDEO_STATE_STARTING | 1: The first remote video packet is received. |
REMOTE_VIDEO_STATE_DECODING | 2: The remote video stream is decoded and plays normally. The SDK reports this state in the case of |
REMOTE_VIDEO_STATE_FROZEN | 3: The remote video is frozen, probably due to REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION (1). |
REMOTE_VIDEO_STATE_FAILED | 4: The remote video fails to start. The SDK reports this state in the case of |
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.
Enumerator | |
---|---|
RTMP_STREAM_PUBLISH_STATE_IDLE | 0: The Media Push has not started or has ended. This state is also triggered after you remove a RTMP or RTMPS stream from the CDN by calling |
RTMP_STREAM_PUBLISH_STATE_CONNECTING | 1: The SDK is connecting to Agora's streaming server and the CDN server. This state is triggered after you call the |
RTMP_STREAM_PUBLISH_STATE_RUNNING | 2: The RTMP or RTMPS streaming publishes. The SDK successfully publishes the RTMP or RTMPS streaming and returns this state. |
RTMP_STREAM_PUBLISH_STATE_RECOVERING | 3: The RTMP or RTMPS streaming is recovering. When exceptions occur to the CDN, or the streaming is interrupted, the SDK tries to resume RTMP or RTMPS streaming and returns this state.
|
RTMP_STREAM_PUBLISH_STATE_FAILURE | 4: The RTMP or RTMPS streaming fails. See the |
RTMP_STREAM_PUBLISH_STATE_DISCONNECTING | 5: The SDK is disconnecting to Agora's streaming server and the CDN server. This state is triggered after you call the |
Error codes of the RTMP or RTMPS streaming.
Enumerator | |
---|---|
RTMP_STREAM_PUBLISH_ERROR_OK | 0: The RTMP or RTMPS streaming publishes successfully. |
RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT | 1: Invalid argument used. If, for example, you do not call the |
RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED | 2: The RTMP or RTMPS streaming is encrypted and cannot be published. |
RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT | 3: Timeout for the RTMP or RTMPS streaming. Call the |
RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR | 4: An error occurs in Agora's streaming server. Call the |
RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR | 5: An error occurs in the CDN server. |
RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN | 6: The RTMP or RTMPS streaming publishes too frequently. |
RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT | 7: The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones. |
RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED | 8: The host manipulates other hosts' URLs. Check your app logic. |
RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND | 9: Agora's server fails to find the RTMP or RTMPS streaming. |
RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED | 10: The format of the RTMP or RTMPS streaming URL is not supported. Check whether the URL format is correct. |
RTMP_STREAM_PUBLISH_ERROR_NOT_BROADCASTER | 11: The user role is not host, so the user cannot use the CDN live streaming function. Check your application code logic. |
RTMP_STREAM_PUBLISH_ERROR_TRANSCODING_NO_MIX_STREAM | 13: The |
RTMP_STREAM_PUBLISH_ERROR_NET_DOWN | 14: Errors occurred in the host's network. |
RTMP_STREAM_PUBLISH_ERROR_INVALID_APPID | 15: Your App ID does not have permission to use the CDN live streaming function. |
RTMP_STREAM_PUBLISH_ERROR_INVALID_PRIVILEGE | invalid privilege. |
RTMP_STREAM_UNPUBLISH_ERROR_OK | 100: The streaming has been stopped normally. After you call |
enum RTMP_STREAMING_EVENT |
Events during the RTMP or RTMPS streaming.
The status of the last-mile network tests.
Reasons causing the change of the connection state.
The reason of changing role's failure.
enum WLACC_MESSAGE_REASON |
enum WLACC_SUGGEST_ACTION |
Suggest an action for the user.
enum NETWORK_TYPE |
The network type.
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 |
The options for SDK preset voice beautifier effects.
enum AUDIO_EFFECT_PRESET |
Preset voice effects.
For better voice effects, Agora recommends setting the profile
parameter of setAudioProfile
to AUDIO_PROFILE_MUSIC_HIGH_QUALITY
or AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO
before using the following presets:
ROOM_ACOUSTICS_KTV
ROOM_ACOUSTICS_VOCAL_CONCERT
ROOM_ACOUSTICS_STUDIO
ROOM_ACOUSTICS_PHONOGRAPH
ROOM_ACOUSTICS_SPACIAL
ROOM_ACOUSTICS_ETHEREAL
VOICE_CHANGER_EFFECT_UNCLE
VOICE_CHANGER_EFFECT_OLDMAN
VOICE_CHANGER_EFFECT_BOY
VOICE_CHANGER_EFFECT_SISTER
VOICE_CHANGER_EFFECT_GIRL
VOICE_CHANGER_EFFECT_PIGKING
VOICE_CHANGER_EFFECT_HULK
PITCH_CORRECTION
Enumerator | |
---|---|
AUDIO_EFFECT_OFF | Turn off voice effects, that is, use the original voice. |
ROOM_ACOUSTICS_KTV | The voice effect typical of a KTV venue. |
ROOM_ACOUSTICS_VOCAL_CONCERT | The voice effect typical of a concert hall. |
ROOM_ACOUSTICS_STUDIO | The voice effect typical of a recording studio. |
ROOM_ACOUSTICS_PHONOGRAPH | The voice effect typical of a vintage phonograph. |
ROOM_ACOUSTICS_VIRTUAL_STEREO | The virtual stereo effect, which renders monophonic audio as stereo audio.
|
ROOM_ACOUSTICS_SPACIAL | A more spatial voice effect. |
ROOM_ACOUSTICS_ETHEREAL | A more ethereal voice effect. |
ROOM_ACOUSTICS_3D_VOICE | A 3D voice effect that makes the voice appear to be moving around the user. The default cycle period of the 3D voice effect is 10 seconds. To change the cycle period, call
|
ROOM_ACOUSTICS_VIRTUAL_SURROUND_SOUND | virtual suround sound.
|
VOICE_CHANGER_EFFECT_UNCLE | A middle-aged man's voice.
|
VOICE_CHANGER_EFFECT_OLDMAN | A senior man's voice.
|
VOICE_CHANGER_EFFECT_BOY | A boy's voice.
|
VOICE_CHANGER_EFFECT_SISTER | A young woman's voice.
|
VOICE_CHANGER_EFFECT_GIRL | A girl's voice.
|
VOICE_CHANGER_EFFECT_PIGKING | The voice of Pig King, a character in Journey to the West who has a voice like a growling bear. |
VOICE_CHANGER_EFFECT_HULK | The Hulk's voice. |
STYLE_TRANSFORMATION_RNB | An audio effect typical of R&B music.
|
STYLE_TRANSFORMATION_POPULAR | The voice effect typical of popular music.
|
PITCH_CORRECTION | A pitch correction effect that corrects the user's pitch based on the pitch of the natural C major scale. After setting this voice effect, you can call |
The options for SDK preset voice conversion.
Audio recording quality.
Audio encoded frame observer position.
enum AREA_CODE |
The region for connection, which is the region where the server the SDK connects to is located.
enum AREA_CODE_EX |
The error code of the channel media replay.
The event code of 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.
enum UPLOAD_ERROR_REASON |
enum PERMISSION_TYPE |
The subscribing state.
enum STREAM_PUBLISH_STATE |
The publishing state.
The audio filter of in-ear monitoring.
enum THREAD_PRIORITY_TYPE |
enum MEDIA_TRACE_EVENT |
enum AudioRoute |
Audio routes.
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.
enum MEDIA_DEVICE_TYPE |
The media device types.
The playback state of the music file.
The reson codes of the local user's audio mixing file.
enum INJECT_STREAM_STATUS |
The status of importing an external video stream in a live broadcast.
The audio equalization band frequency.
enum AUDIO_REVERB_TYPE |
The audio reverberation type.
Enumerator | |
---|---|
STREAM_FALLBACK_OPTION_DISABLED | 0: No fallback operation for the stream when the network condition is poor. The stream quality cannot be guaranteed. |
STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW | 1: (Default) Under poor network conditions, the SDK will send or receive agora::rtc::VIDEO_STREAM_LOW. You can only set this option in RtcEngineParameters::setRemoteSubscribeFallbackOption. Nothing happens when you set this in RtcEngineParameters::setLocalPublishFallbackOption. |
STREAM_FALLBACK_OPTION_AUDIO_ONLY | 2: Under poor network conditions, the SDK may receive agora::rtc::VIDEO_STREAM_LOW first, but if the network still does not allow displaying the video, the SDK will send or receive audio only. |
enum PRIORITY_TYPE |
enum CAMERA_DIRECTION |
enum CLOUD_PROXY_TYPE |
enum LOCAL_PROXY_MODE |
enum PROXY_TYPE |
Media device states.
enum VIDEO_PROFILE_TYPE |
|
static |
|
static |
|
static |
|
static |
OPTIONAL_ENUM_CLASS VideoFrameMetaDataType |
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 |