Video SDK v3.7.1 API Reference for All Platforms (C++)
|
Typedefs | |
typedef unsigned int | uid_t |
typedef void * | view_t |
typedef struct agora::rtc::TranscodingUser | TranscodingUser |
typedef struct agora::rtc::RtcImage | RtcImage |
typedef struct agora::rtc::LiveStreamAdvancedFeature | LiveStreamAdvancedFeature |
typedef struct agora::rtc::LiveTranscoding | LiveTranscoding |
typedef struct agora::rtc::Rect | Rect |
typedef struct agora::rtc::WatermarkOptions | WatermarkOptions |
Variables | |
const int | STANDARD_BITRATE = 0 |
const int | COMPATIBLE_BITRATE = -1 |
const int | DEFAULT_MIN_BITRATE = -1 |
typedef unsigned int agora::rtc::uid_t |
typedef void* agora::rtc::view_t |
typedef struct agora::rtc::TranscodingUser agora::rtc::TranscodingUser |
The video and audio properties of the user displaying the video in the CDN live. Agora supports a maximum of 17 transcoding users in a CDN streaming channel.
typedef struct agora::rtc::RtcImage agora::rtc::RtcImage |
Image properties.
The properties of the watermark and background images.
The configuration for the advanced feature of the RTMP or RTMPS streaming with transcoding.
typedef struct agora::rtc::LiveTranscoding agora::rtc::LiveTranscoding |
A struct for managing CDN live audio/video transcoding settings.
typedef struct agora::rtc::Rect agora::rtc::Rect |
typedef struct agora::rtc::WatermarkOptions agora::rtc::WatermarkOptions |
The options of the watermark image to be added.
The current music file playback state.
Reports in the onAudioMixingStateChanged callback.
Enumerator | |
---|---|
AUDIO_MIXING_STATE_PLAYING | 710: The music file is playing. This state comes with one of the following associated reasons: |
AUDIO_MIXING_STATE_PAUSED | 711: The music file pauses playing. This state comes with AUDIO_MIXING_REASON_PAUSED_BY_USER (725). |
AUDIO_MIXING_STATE_STOPPED | 713: The music file stops playing. This state comes with one of the following associated reasons: |
AUDIO_MIXING_STATE_FAILED | 714: An exception occurs during the playback of the music file. This state comes with one of the following associated reasons: |
The error codes of the local user's audio mixing file.
The reason for the change of the music file playback state.
Reports in the onAudioMixingStateChanged callback.
Enumerator | |
---|---|
AUDIO_MIXING_REASON_CAN_NOT_OPEN | 701: The SDK cannot open the music file. Possible causes include the local music file does not exist, the SDK does not support the file format, or the SDK cannot access the music file URL. |
AUDIO_MIXING_REASON_TOO_FREQUENT_CALL | 702: The SDK opens the music file too frequently. If you need to call startAudioMixing multiple times, ensure that the call interval is longer than 500 ms. |
AUDIO_MIXING_REASON_INTERRUPTED_EOF | 703: The music file playback is interrupted. |
AUDIO_MIXING_REASON_STARTED_BY_USER | 720: Successfully calls startAudioMixing to play a music file. |
AUDIO_MIXING_REASON_ONE_LOOP_COMPLETED | 721: The music file completes a loop playback. |
AUDIO_MIXING_REASON_START_NEW_LOOP | 722: The music file starts a new loop playback. |
AUDIO_MIXING_REASON_ALL_LOOPS_COMPLETED | 723: The music file completes all loop playback. |
AUDIO_MIXING_REASON_STOPPED_BY_USER | 724: Successfully calls stopAudioMixing to stop playing the music file. |
AUDIO_MIXING_REASON_PAUSED_BY_USER | 725: Successfully calls pauseAudioMixing to pause playing the music file. |
AUDIO_MIXING_REASON_RESUMED_BY_USER | 726: Successfully calls resumeAudioMixing to resume playing the music file. |
Media device states.
Media device types.
Local video state types.
Enumerator | |
---|---|
LOCAL_VIDEO_STREAM_STATE_STOPPED | 0: Initial state. |
LOCAL_VIDEO_STREAM_STATE_CAPTURING | 1: The local video capturing device starts successfully. The SDK also reports this state when you share a maximized window by calling startScreenCaptureByWindowId. |
LOCAL_VIDEO_STREAM_STATE_ENCODING | 2: The first video frame is successfully encoded. |
LOCAL_VIDEO_STREAM_STATE_FAILED | 3: The local video fails to start. |
Local video state error codes.
Enumerator | |
---|---|
LOCAL_VIDEO_STREAM_ERROR_OK | 0: The local video is normal. |
LOCAL_VIDEO_STREAM_ERROR_FAILURE | 1: No specified reason for the local video failure. |
LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION | 2: The application does not have permission to start the local video capture device. Remind your user to grant permission and rejoin the channel. |
LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY | 3: The local video capture device is in use. Remind your user to check whether another application occupies the camera. |
LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE | 4: The local video capture failed. Remind your user to check whether the video capture device is working properly, check whether the camera is occupied by another application, or try to rejoin the channel. |
LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE | 5: The local video encoding fails. |
LOCAL_VIDEO_STREAM_ERROR_CAPTURE_INBACKGROUND | 6: (iOS only) The application is in the background. Remind your user that the application cannot capture video properly when the application is in the background.
|
LOCAL_VIDEO_STREAM_ERROR_CAPTURE_MULTIPLE_FOREGROUND_APPS | 7: (iOS only) This error code is reported when the current app is running in Slide Over, Split View, or Picture in Picture mode and another app is occupying the camera. Remind your user that the application cannot capture video properly when the app is running in Slide Over, Split View, or Picture in Picture mode and another app is occupying the camera.
|
LOCAL_VIDEO_STREAM_ERROR_DEVICE_NOT_FOUND | 8: The SDK cannot find the local video capture device. Remind your user to check whether the camera is connected to the device properly, check whether the camera is working properly, or try to rejoin the channel.
|
LOCAL_VIDEO_STREAM_ERROR_DEVICE_DISCONNECTED | 9: (macOS only) The external camera currently in use is disconnected (such as being unplugged).
|
LOCAL_VIDEO_STREAM_ERROR_DEVICE_INVALID_ID | 10: (macOS and Windows only) The SDK cannot find the video device in the video device list. Check whether the ID of the video device is valid.
|
LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_MINIMIZED | 11: The shared window is minimized when you call startScreenCaptureByWindowId to share a window. The SDK cannot share a minimized window. You can cancel the minimization of this window at the application layer, such as maximizing this window. |
LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_CLOSED | 12: (macOS and Windows only) The error code indicates that a window shared by the window ID has been closed, or a full-screen window shared by the window ID has exited full-screen mode. After exiting full-screen mode, remote users cannot see the shared window. To prevent remote users from seeing a black screen, Agora recommends that you immediately stop screen sharing. Common scenarios for reporting this error code:
|
LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_OCCLUDED | 13: (Windows only) The window being shared is overlapped by another window, so the overlapped area is blacked out by the SDK during window sharing.
|
AGORA_DEPRECATED_ATTRIBUTE |
20: (Windows only) The SDK does not support sharing this type of window. Remind your user that the current type of window is not supported for sharing and use screen sharing instead.
|
Local audio state types.
Local audio state error codes.
Audio recording quality, which is set in startAudioRecording.
Network quality types.
Video display modes.
Enumerator | |
---|---|
RENDER_MODE_HIDDEN | 1: Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents. |
RENDER_MODE_FIT | 2: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to disparity in the aspect ratio are filled with black. |
RENDER_MODE_ADAPTIVE |
|
RENDER_MODE_FILL | 4: The fill mode. In this mode, the SDK stretches or zooms the video to fill the display window. |
enum agora::rtc::SR_MODE |
Audio profiles.
Sets the sample rate, bitrate, encoding mode, and the number of channels:
Audio application scenarios.
The channel profile.
The reason why super resolution is not successfully enabled or the message that confirms success.
The reason why the virtual background is not successfully enabled or the message that confirms success.
Enumerator | |
---|---|
VIRTUAL_BACKGROUND_SOURCE_STATE_REASON_SUCCESS | 0: The virtual background is successfully enabled. |
VIRTUAL_BACKGROUND_SOURCE_STATE_REASON_IMAGE_NOT_EXIST | 1: The custom background image does not exist. Please check the value of |
VIRTUAL_BACKGROUND_SOURCE_STATE_REASON_COLOR_FORMAT_NOT_SUPPORTED | 2: The color format of the custom background image is invalid. Please check the value of |
VIRTUAL_BACKGROUND_SOURCE_STATE_REASON_DEVICE_NOT_SUPPORTED | 3: The device does not support using the virtual background. |
VIRTUAL_BACKGROUND_SOURCE_STATE_REASON_INSUFFICIENT_PERFORMANCE | 4: When the virtual background feature is enabled or is running, the SDK detects that device performance is not qualified. When you receive this reason code, Agora recommends that the user disable virtual background.
|
Reasons for a user being offline.
States of the RTMP or RTMPS streaming.
Enumerator | |
---|---|
RTMP_STREAM_PUBLISH_STATE_IDLE | The RTMP or RTMPS streaming has not started or has ended. This state is also triggered after you remove an RTMP or RTMPS stream from the CDN by calling |
RTMP_STREAM_PUBLISH_STATE_CONNECTING | The SDK is connecting to Agora's streaming server and the CDN server. This state is triggered after you call the addPublishStreamUrl method. |
RTMP_STREAM_PUBLISH_STATE_RUNNING | The RTMP or RTMPS streaming publishes. The SDK successfully publishes the RTMP or RTMPS streaming and returns this state. |
RTMP_STREAM_PUBLISH_STATE_RECOVERING | 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 | The RTMP or RTMPS streaming fails. See the errCode parameter for the detailed error information. You can also call the addPublishStreamUrl method to publish the RTMP or RTMPS streaming again. |
RTMP_STREAM_PUBLISH_STATE_DISCONNECTING | The SDK is disconnecting from the Agora streaming server and CDN. When you call remove or stop to stop the streaming normally, the SDK reports the streaming state as
|
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 setLiveTranscoding method to configure the LiveTranscoding parameters before calling the addPublishStreamUrl method, the SDK returns this error. Check whether you set the parameters in the setLiveTranscoding method properly. |
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 addPublishStreamUrl method to publish the streaming again. |
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: Reserved. |
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. Refer to Prerequisites to enable the CDN live streaming permission.
|
RTMP_STREAM_UNPUBLISH_ERROR_OK | 100: The streaming has been stopped normally. After you call removePublishStreamUrl to stop streaming, the SDK returns this value.
|
Events during the RTMP or RTMPS streaming.
States of importing an external video stream in the interactive live streaming.
The brightness level of the video image captured by the local camera.
The use mode of the audio data in the onRecordAudioFrame or onPlaybackAudioFrame callback.
Enumerator | |
---|---|
RAW_AUDIO_FRAME_OP_MODE_READ_ONLY | 0: Read-only mode: Users only read the AudioFrame data without modifying anything. For example, when users acquire the data with the Agora SDK, then push the RTMP or RTMPS streams. |
RAW_AUDIO_FRAME_OP_MODE_WRITE_ONLY | 1: Write-only mode: Users replace the AudioFrame data with their own data and pass the data to the SDK for encoding. For example, when users acquire the data. |
RAW_AUDIO_FRAME_OP_MODE_READ_WRITE | 2: Read and write mode: Users read the data from AudioFrame, modify it, and then play it. For example, when users have their own sound-effect processing module and perform some voice pre-processing, such as a voice change. |
Video codec profile types.
Audio equalization band frequencies.
Audio reverberation types.
Local voice changer options.
Gender-based beatification effect works best only when assigned a proper gender:
Failure to do so can lead to voice distortion.
Local voice reverberation presets.
The options for SDK preset voice beautifier effects.
Enumerator | |
---|---|
VOICE_BEAUTIFIER_OFF | Turn off voice beautifier effects and use the original voice. |
CHAT_BEAUTIFIER_MAGNETIC | A more magnetic voice.
|
CHAT_BEAUTIFIER_FRESH | A fresher voice.
|
CHAT_BEAUTIFIER_VITALITY | A more vital voice.
|
SINGING_BEAUTIFIER |
Singing beautifier effect.
|
TIMBRE_TRANSFORMATION_VIGOROUS | A more vigorous voice. |
TIMBRE_TRANSFORMATION_DEEP | A deeper voice. |
TIMBRE_TRANSFORMATION_MELLOW | A mellower voice. |
TIMBRE_TRANSFORMATION_FALSETTO | A falsetto voice. |
TIMBRE_TRANSFORMATION_FULL | A fuller voice. |
TIMBRE_TRANSFORMATION_CLEAR | A clearer voice. |
TIMBRE_TRANSFORMATION_RESOUNDING | A more resounding voice. |
TIMBRE_TRANSFORMATION_RINGING | A more ringing voice. |
The options for SDK preset audio effects.
Enumerator | |
---|---|
AUDIO_EFFECT_OFF | Turn off audio effects and use the original voice. |
ROOM_ACOUSTICS_KTV | An audio effect typical of a KTV venue.
|
ROOM_ACOUSTICS_VOCAL_CONCERT | An audio effect typical of a concert hall.
|
ROOM_ACOUSTICS_STUDIO | An audio effect typical of a recording studio.
|
ROOM_ACOUSTICS_PHONOGRAPH | An audio effect typical of a vintage phonograph.
|
ROOM_ACOUSTICS_VIRTUAL_STEREO | A virtual stereo effect that renders monophonic audio as stereo audio.
|
ROOM_ACOUSTICS_SPACIAL | A more spatial audio effect.
|
ROOM_ACOUSTICS_ETHEREAL | A more ethereal audio 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 setAudioEffectParameters after this method.
|
VOICE_CHANGER_EFFECT_UNCLE | The voice of a middle-aged man.
|
VOICE_CHANGER_EFFECT_OLDMAN | The voice of an old man.
|
VOICE_CHANGER_EFFECT_BOY | The voice of a boy.
|
VOICE_CHANGER_EFFECT_SISTER | The voice of a young woman.
|
VOICE_CHANGER_EFFECT_GIRL | The voice of a girl.
|
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 voice of Hulk.
|
STYLE_TRANSFORMATION_RNB | An audio effect typical of R&B music.
|
STYLE_TRANSFORMATION_POPULAR | An audio 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. To change the basic mode and tonic pitch, call setAudioEffectParameters after this method.
|
The options for SDK preset voice conversion effects.
Remote audio states.
Enumerator | |
---|---|
REMOTE_AUDIO_STATE_STOPPED | 0: The remote audio is in the default state, probably due to REMOTE_AUDIO_REASON_LOCAL_MUTED (3), REMOTE_AUDIO_REASON_REMOTE_MUTED (5), or REMOTE_AUDIO_REASON_REMOTE_OFFLINE (7). |
REMOTE_AUDIO_STATE_STARTING | 1: The first remote audio packet is received. |
REMOTE_AUDIO_STATE_DECODING | 2: The remote audio stream is decoded and plays normally, probably due to REMOTE_AUDIO_REASON_NETWORK_RECOVERY (2), REMOTE_AUDIO_REASON_LOCAL_UNMUTED (4), or REMOTE_AUDIO_REASON_REMOTE_UNMUTED (6). |
REMOTE_AUDIO_STATE_FROZEN | 3: The remote audio is frozen, probably due to REMOTE_AUDIO_REASON_NETWORK_CONGESTION (1). |
REMOTE_AUDIO_STATE_FAILED | 4: The remote audio fails to start, probably due to REMOTE_AUDIO_REASON_INTERNAL (0). |
Remote audio state reasons.
Remote video states. 1: The remote video is playing. 2: The remote video is frozen. The state of the remote video.
Enumerator | |
---|---|
REMOTE_VIDEO_STATE_STOPPED | 0: The remote video is in the default state, probably due to REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED (3), REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED (5), or REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE (7). |
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, probably due to REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY (2), REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED (4), REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED (6), or REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY (9). |
REMOTE_VIDEO_STATE_FROZEN | 3: The remote video is frozen, probably due to REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION (1) or REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK (8). |
REMOTE_VIDEO_STATE_FAILED | 4: The remote video fails to start, probably due to REMOTE_VIDEO_STATE_REASON_INTERNAL (0). |
The publishing state.
Enumerator | |
---|---|
PUB_STATE_IDLE | 0: The initial publishing state after joining the channel. |
PUB_STATE_NO_PUBLISHED | 1: Fails to publish the local stream. Possible reasons:
|
PUB_STATE_PUBLISHING | 2: Publishing. |
PUB_STATE_PUBLISHED | 3: Publishes successfully. |
The subscribing state.
Enumerator | |
---|---|
SUB_STATE_IDLE | 0: The initial subscribing state after joining the channel. |
SUB_STATE_NO_SUBSCRIBED | 1: Fails to subscribe to the remote stream. Possible reasons:
|
SUB_STATE_SUBSCRIBING | 2: Subscribing. |
SUB_STATE_SUBSCRIBED | 3: Subscribes to and receives the remote stream successfully. |
The reason for the remote video state change.
Video output orientation modes.
Video degradation preferences under limited bandwidth.
Enumerator | |
---|---|
MAINTAIN_QUALITY | 0: (Default) Prefers to reduce the video frame rate while maintaining video quality during video encoding under limited bandwidth. This degradation preference is suitable for scenarios where video quality is prioritized.
|
MAINTAIN_FRAMERATE | 1: Prefers to reduce the video quality while maintaining the video frame rate during video encoding under limited bandwidth. This degradation preference is suitable for scenarios where smoothness is prioritized and video quality is allowed to be reduced. |
MAINTAIN_BALANCED | 2: Reduces the video frame rate and video quality simultaneously during video encoding under limited bandwidth.
|
Stream fallback options.
Enumerator | |
---|---|
STREAM_FALLBACK_OPTION_DISABLED | 0: No fallback behavior for the local/remote video stream when the uplink/downlink network conditions are poor. The quality of the stream is not guaranteed. |
STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW | 1: Under poor downlink network conditions, the remote video stream, to which you subscribe, falls back to the low-stream (low resolution and low bitrate) video. You can set this option only in the setRemoteSubscribeFallbackOption method. Nothing happens when you set this in the setLocalPublishFallbackOption method. |
STREAM_FALLBACK_OPTION_AUDIO_ONLY | 2: Under poor uplink network conditions, the published video stream falls back to audio only. Under poor downlink network conditions, the remote video stream, to which you subscribe, first falls back to the low-stream (low resolution and low bitrate) video; and then to an audio-only stream if the network conditions worsen. |
Camera capture preference.
Enumerator | |
---|---|
CAPTURER_OUTPUT_PREFERENCE_AUTO | 0: (Default) self-adapts the camera output parameters to the system performance and network conditions to balance CPU consumption and video preview quality. |
CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE | 1: Prioritizes the system performance. The SDK chooses the dimension and frame rate of the local camera capture closest to those set by setVideoEncoderConfiguration. |
CAPTURER_OUTPUT_PREFERENCE_PREVIEW | 2: Prioritizes the local preview quality. The SDK chooses higher camera output parameters to improve the local video preview quality. This option requires extra CPU and RAM usage for video pre-processing. |
CAPTURER_OUTPUT_PREFERENCE_MANUAL | 3: Allows you to customize the width and height of the video image captured by the local camera.
|
Connection states.
Enumerator | |
---|---|
CONNECTION_STATE_DISCONNECTED | 1: The SDK is disconnected from Agora's edge server.
|
CONNECTION_STATE_CONNECTING | 2: The SDK is connecting to Agora's edge server.
|
CONNECTION_STATE_CONNECTED | 3: The SDK is connected to Agora's edge server and has joined a channel. You can now publish or subscribe to a media stream in the channel. If the connection to the channel is lost because, for example, if the network is down or switched, the SDK automatically tries to reconnect and triggers:
|
CONNECTION_STATE_RECONNECTING | 4: The SDK keeps rejoining the channel after being disconnected from a joined channel because of network issues.
|
CONNECTION_STATE_FAILED | 5: The SDK fails to connect to Agora's edge server or join the channel. You must call the leaveChannel method to leave this state, and call the joinChannel method again to rejoin the channel. If the SDK is banned from joining the channel by Agora's edge server (through the RESTful API), the SDK triggers the onConnectionBanned (deprecated) and onConnectionStateChanged callbacks. |
Reasons for a connection state change.
Enumerator | |
---|---|
CONNECTION_CHANGED_CONNECTING | 0: The SDK is connecting to Agora's edge server. |
CONNECTION_CHANGED_JOIN_SUCCESS | 1: The SDK has joined the channel successfully. |
CONNECTION_CHANGED_INTERRUPTED | 2: The connection between the SDK and Agora's edge server is interrupted. |
CONNECTION_CHANGED_BANNED_BY_SERVER | 3: The connection is banned by the server. This occurs when the server calls the Banning user privileges API to kick the user out of the channel. You can display a pop-up box in the application that says: "The user has been banned from this channel." |
CONNECTION_CHANGED_JOIN_FAILED | 4: The SDK fails to join the channel. This occurs when the SDK fails to rejoin the channel within 20 minutes after receiving the onConnectionStateChanged(CONNECTION_STATE_RECONNECTING, CONNECTION_CHANGED_INTERRUPTED) callback and stops trying. You can display a pop-up box in the application that says: "Failed to join the channel due to network issues. Please try to rejoin the channel after switching to a different network." |
CONNECTION_CHANGED_LEAVE_CHANNEL | 5: The SDK has left the channel. |
CONNECTION_CHANGED_INVALID_APP_ID | 6: The specified App ID is invalid. Check whether the App ID used by the user is the same as the App ID obtained from the Agora Console, and then try to rejoin the channel with a valid App ID. |
CONNECTION_CHANGED_INVALID_CHANNEL_NAME | 7: The specified channel name is invalid. The channel name cannot be empty nor longer than 64 bytes in length. For supported characters, see the |
CONNECTION_CHANGED_INVALID_TOKEN | 8: The token is invalid, probably due to the following reasons:
Check whether the token used by the user is the same as the token generated at your app server, and then try to rejoin the channel with a valid token. |
CONNECTION_CHANGED_TOKEN_EXPIRED | 9: The token has expired. The user using the expired token is forced to leave the channel. The app client needs to request a new token from the app server and then try to rejoin the channel with the new token. |
CONNECTION_CHANGED_REJECTED_BY_SERVER | 10: The user is banned by the server. This error usually occurs in the following situations:
|
CONNECTION_CHANGED_SETTING_PROXY_SERVER | 11: The SDK tries to reconnect after setting a proxy server. |
CONNECTION_CHANGED_RENEW_TOKEN | 12: The token renews. |
CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED | 13: Due to a change of the network type, IP address, or network port, the client IP address has changed, and the SDK tries to reconnect. If this state occurs multiple times, you can display a pop-up box in the application that says: "The network connection is not stable. Please switch to another network." |
CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT | 14: Timeout for the keep-alive of the connection between the SDK and Agora's edge server. The connection state changes to CONNECTION_STATE_RECONNECTING(4). |
CONNECTION_CHANGED_SAME_UID_LOGIN | 19: Join the same channel from different devices using the same user ID.
|
CONNECTION_CHANGED_TOO_MANY_BROADCASTERS | 20: The number of hosts in the channel is already at the upper limit.
|
Network type.
States of the last-mile network probe test.
The current audio route.
Reports in the onAudioRouteChanged callback.
The cloud proxy type.
The proxy type.
The operational permission of the SDK on the audio session.
Recording content, which is set in startAudioRecording.
The information acquisition state. This enum is reported in onRequestAudioFileInfo.
Enumerator | |
---|---|
AUDIO_FILE_INFO_ERROR_OK | 0: Successfully get the information of an audio file. |
AUDIO_FILE_INFO_ERROR_FAILURE | 1: Fail to get the information of an audio file. |
The reason for a user role switch failure.
Quality change of the local video in terms of target frame rate and target bit rate since last count.
The reason for poor QoE of the local user when receiving a remote audio stream.
The error code in CHANNEL_MEDIA_RELAY_ERROR.
Enumerator | |
---|---|
RELAY_OK | 0: The state is normal. |
RELAY_ERROR_SERVER_ERROR_RESPONSE | 1: An error occurs in the server response. |
RELAY_ERROR_SERVER_NO_RESPONSE | 2: No server response. You can call the leaveChannel method to leave the channel. This error can also occur if the channel media relay service is not enabled in the project. You can contact technical support to enable the service. |
RELAY_ERROR_NO_RESOURCE_AVAILABLE | 3: The SDK fails to access the service, probably due to limited resources of the server. |
RELAY_ERROR_FAILED_JOIN_SRC | 4: Fails to send the relay request. |
RELAY_ERROR_FAILED_JOIN_DEST | 5: Fails to accept the relay request. |
RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC | 6: The server fails to receive the media stream. |
RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST | 7: The server fails to send the media stream. |
RELAY_ERROR_SERVER_CONNECTION_LOST | 8: The SDK disconnects from the server due to poor network connections. You can call the leaveChannel method to leave the channel. |
RELAY_ERROR_INTERNAL_ERROR | 9: An internal error occurs in the server. |
RELAY_ERROR_SRC_TOKEN_EXPIRED | 10: The token of the source channel has expired. |
RELAY_ERROR_DEST_TOKEN_EXPIRED | 11: The token of the destination channel has expired. |
The event code in CHANNEL_MEDIA_RELAY_EVENT.
The state code in CHANNEL_MEDIA_RELAY_STATE.
Enumerator | |
---|---|
RELAY_STATE_IDLE | 0: The initial state. After you successfully stop the channel media relay by calling stopChannelMediaRelay, the onChannelMediaRelayStateChanged callback returns this state. |
RELAY_STATE_CONNECTING | 1: The SDK tries to relay the media stream to the destination channel. |
RELAY_STATE_RUNNING | 2: The SDK successfully relays the media stream to the destination channel. |
RELAY_STATE_FAILURE | 3: A failure occurs. See the details in code. |
Content hints for screen sharing.
The screen sharing scenario.
The type of the shared target.
Encryption mode. Agora recommends using either the AES_128_GCM2
or AES_256_GCM2
encryption mode, both of which support adding a salt and are more secure.
The reason for the state change
const int agora::rtc::STANDARD_BITRATE = 0 |
(Recommended) The standard bitrate set in the setVideoEncoderConfiguration method.
In this mode, the bitrates differ between the interactive live streaming and communication profiles:
COMMUNICATION
profile: The video bitrate is the same as the base bitrate.LIVE_BROADCASTING
profile: The video bitrate is twice the base bitrate. const int agora::rtc::COMPATIBLE_BITRATE = -1 |
The compatible bitrate set in the setVideoEncoderConfiguration method.
The bitrate remains the same regardless of the channel profile. If you choose this mode in the LIVE_BROADCASTING
profile, the video frame rate may be lower than the set value.
const int agora::rtc::DEFAULT_MIN_BITRATE = -1 |
Use the default minimum bitrate.