Agora C++ API Reference for All Platforms
|
Namespaces | |
protocol | |
Typedefs | |
using | PipelineBuilder = std::shared_ptr< webrtc::Call > |
using | WeakPipelineBuilder = std::weak_ptr< webrtc::Call > |
using | SharedSAudioFrame = std::shared_ptr< SAudioFrame > |
template<typename STATE_TYPE , typename REASON_TYPE > | |
using | StateEvent = std::pair< uint64_t, std::pair< STATE_TYPE, REASON_TYPE > > |
template<typename STATE_TYPE , typename REASON_TYPE > | |
using | StateEvents = std::vector< StateEvent< STATE_TYPE, REASON_TYPE > > |
typedef struct agora::rtc::RtcImage | RtcImage |
typedef unsigned int | uid_t |
typedef unsigned int | track_id_t |
typedef unsigned int | conn_id_t |
Functions | |
template<typename T > | |
static T | MinPositive (T a, T b) |
AGORA_API bool AGORA_CALL | decode_sei_layout (const void *data, unsigned size, layout_info *layout) |
Variables | |
static const char * | kAudioStreamTrackId = "audio_stream_track_id" |
static const char * | kVideoMajorStreamTrackId = "video_major_stream_track_id" |
static const char * | kVideoMinorStreamTrackId = "video_minor_stream_track_id" |
const std::string | AUDIO_PIPELINE_POS_RECORD_ORIGIN |
const std::string | AUDIO_PIPELINE_POS_PRE_APM_PROC |
const std::string | AUDIO_PIPELINE_POS_APM |
const std::string | AUDIO_PIPELINE_POS_PRE_SEND_PROC |
const std::string | AUDIO_PIPELINE_POS_FILTER |
const std::string | AUDIO_PIPELINE_POS_ENC |
const std::string | AUDIO_PIPELINE_POS_TX_MIXER |
const std::string | AUDIO_PIPELINE_POS_AT_RECORD |
const std::string | AUDIO_PIPELINE_POS_ATW_RECORD |
const std::string | AUDIO_PIPELINE_POS_DEC |
const std::string | AUDIO_PIPELINE_POS_MIXED |
const std::string | AUDIO_PIPELINE_POS_PLAY |
const std::string | AUDIO_PIPELINE_POS_RX_MIXER |
const std::string | AUDIO_PIPELINE_POS_PLAYBACK_MIXER |
const std::string | AUDIO_PIPELINE_POS_PCM_SOURCE_PLAYBAC_MIXER |
const std::string | AUDIO_PIPELINE_POS_PRE_PLAY_PROC |
const std::string | AUDIO_PIPELINE_POS_AT_PLAYOUT |
const std::string | AUDIO_PIPELINE_POS_ATW_PLAYOUT |
const int64_t | AUDIO_FRAME_DUMP_MIN_DURATION_MS = 0 |
const int64_t | AUDIO_FRAME_DUMP_MAX_DURATION_MS = 150000 |
static const uint8_t | kVideoEngineFlagHasIntraRequest = 0x10 |
static const uint8_t | kVideoEngineFlagStdCodec = 0x8 |
static const uint8_t | kVideoEngineFlagNasa = 0x40 |
static const uint8_t | kVideoEngineFlagScalableDelta = 0x80 |
static const uint8_t | kVideoEngineFlagMajorStreamOnly = 0x01 |
static const uint8_t | kAgoraHeaderLength = 3 |
static const uint8_t | kAgoraAudioExtendLength = 5 |
static const uint8_t | AUDIO_MEDIA_PACKET_PAYLOAD_TYPE = 127 |
static const char *const | BUILT_IN_ADAPTER = "built-in-adapter" |
static const char *const | BUILT_IN_MIRROR_FILTER = "built-in-mirror" |
static const char *const | BUILT_IN_WATERMARK_FILTER = "built-in-watermarker" |
static const char *const | BUILT_IN_ROTATOR = "built-in-rotator" |
static const char *const | BUILT_IN_PREVIEW_TEE = "built-in-preview-tee" |
static const char *const | BUILT_IN_MAJOR_TEE = "built-in-major-tee" |
static const char *const | BUILT_IN_MINOR_TEE = "built-in-minor-tee" |
static const char *const | BUILT_IN_MINOR_ADAPTER = "built-in-minor-adapter" |
static const int | kAdmMaxDeviceNameSize = 128 |
static const int | kAdmMaxGuidSize = 128 |
static const int | kIntervalInMillseconds = 200 |
static const int | kDeviceIdSize = 128 |
OPTIONAL_ENUM_CLASS | VideoFrameMetaDataType |
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 |
static const unsigned int | DEFAULT_CONNECTION_ID = 0 |
static const unsigned int | DUMMY_CONNECTION_ID = (std::numeric_limits<unsigned int>::max)() |
using agora::rtc::PipelineBuilder = typedef std::shared_ptr<webrtc::Call> |
using agora::rtc::WeakPipelineBuilder = typedef std::weak_ptr<webrtc::Call> |
using agora::rtc::SharedSAudioFrame = typedef std::shared_ptr<SAudioFrame> |
using agora::rtc::StateEvent = typedef std::pair<uint64_t, std::pair<STATE_TYPE, REASON_TYPE> > |
using agora::rtc::StateEvents = typedef std::vector<StateEvent<STATE_TYPE, REASON_TYPE> > |
typedef struct agora::rtc::RtcImage agora::rtc::RtcImage |
The definition of the RtcImage struct.
typedef unsigned int agora::rtc::uid_t |
typedef unsigned int agora::rtc::track_id_t |
typedef unsigned int agora::rtc::conn_id_t |
|
strong |
|
strong |
|
strong |
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
|
Reasons for a user being offline.
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. |
Content fit modes.
The rotation information.
Types of the video frame.
Video output orientation modes.
(For future use) Video degradation preferences under limited bandwidth.
audio encoding type of audio encoded frame observer.
Watermark fit mode
Video source types definition.
Audio profile types.
Audio application scenarios.
Video content hints.
States of the local audio.
Reasons for the local audio failure.
Local video state types.
Local video state error codes.
Remote audio states.
Reasons for a remote audio state change.
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 reason for the remote video state change.
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 RTMP streaming.
Error codes of the RTMP streaming.
Enumerator | |
---|---|
RTMP_STREAM_PUBLISH_ERROR_FAILED | -1: The RTMP streaming fails. |
RTMP_STREAM_PUBLISH_ERROR_OK | 0: The RTMP streaming publishes successfully. |
RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT | 1: Invalid argument. If, for example, you did not call |
RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED | 2: The RTMP streaming is encrypted and cannot be published. |
RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT | 3: A timeout occurs with the RTMP streaming. Call |
RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR | 4: An error occurs in the streaming server. Call |
RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR | 5: An error occurs in the RTMP server. |
RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN | 6: The RTMP 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: The Agora server fails to find the RTMP streaming. |
RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED | 10: The format of the RTMP streaming URL is not supported. Check whether the URL format is correct. |
RTMP_STREAM_PUBLISH_ERROR_CDN_ERROR | 11: CDN related errors. Remove the original URL address and add a new one by calling |
RTMP_STREAM_PUBLISH_ERROR_ALREADY_IN_USE | 12: Resources are occupied and cannot be reused. |
Connection state types.
States of the last mile network probe result.
Reasons for a connection state change.
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 | ||||
-----------------— | --------------------------— | |||
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.
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 an uncle.
|
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.
|
Preset local voice changer options.
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. |
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. |
Type of ear monitoring filter.
Audio routes.
The error code of streaming source.
The state machine of Streaming Source.
The media device types.
The states of the local user's audio mixing file.
Enumerator | |
---|---|
AUDIO_MIXING_STATE_PLAYING | 710: The audio mixing file is playing. |
AUDIO_MIXING_STATE_PAUSED | 711: The audio mixing file pauses playing. |
AUDIO_MIXING_STATE_STOPPED | 713: The audio mixing file stops playing. |
AUDIO_MIXING_STATE_FAILED | 714: An exception occurs when playing the audio mixing file. See AUDIO_MIXING_ERROR_TYPE. |
AUDIO_MIXING_STATE_COMPLETED | 715: The audio mixing file is played once. |
AUDIO_MIXING_STATE_ALL_LOOPS_COMPLETED | 716: The audio mixing file is all played out. |
The error codes of the local user's audio mixing file.
The status of importing an external video stream in a live broadcast.
The audio equalization band frequency.
The audio reverberation type.
Enumerator | |
---|---|
STREAM_FALLBACK_OPTION_DISABLED | 0: (Default) 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: 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. |
|
strong |
|
static |
AGORA_API bool AGORA_CALL agora::rtc::decode_sei_layout | ( | const void * | data, |
unsigned | size, | ||
layout_info * | layout | ||
) |
|
static |
|
static |
|
static |
const std::string agora::rtc::AUDIO_PIPELINE_POS_RECORD_ORIGIN |
const std::string agora::rtc::AUDIO_PIPELINE_POS_PRE_APM_PROC |
const std::string agora::rtc::AUDIO_PIPELINE_POS_APM |
const std::string agora::rtc::AUDIO_PIPELINE_POS_PRE_SEND_PROC |
const std::string agora::rtc::AUDIO_PIPELINE_POS_FILTER |
const std::string agora::rtc::AUDIO_PIPELINE_POS_ENC |
const std::string agora::rtc::AUDIO_PIPELINE_POS_TX_MIXER |
const std::string agora::rtc::AUDIO_PIPELINE_POS_AT_RECORD |
const std::string agora::rtc::AUDIO_PIPELINE_POS_ATW_RECORD |
const std::string agora::rtc::AUDIO_PIPELINE_POS_DEC |
const std::string agora::rtc::AUDIO_PIPELINE_POS_MIXED |
const std::string agora::rtc::AUDIO_PIPELINE_POS_PLAY |
const std::string agora::rtc::AUDIO_PIPELINE_POS_RX_MIXER |
const std::string agora::rtc::AUDIO_PIPELINE_POS_PLAYBACK_MIXER |
const std::string agora::rtc::AUDIO_PIPELINE_POS_PCM_SOURCE_PLAYBAC_MIXER |
const std::string agora::rtc::AUDIO_PIPELINE_POS_PRE_PLAY_PROC |
const std::string agora::rtc::AUDIO_PIPELINE_POS_AT_PLAYOUT |
const std::string agora::rtc::AUDIO_PIPELINE_POS_ATW_PLAYOUT |
const int64_t agora::rtc::AUDIO_FRAME_DUMP_MIN_DURATION_MS = 0 |
const int64_t agora::rtc::AUDIO_FRAME_DUMP_MAX_DURATION_MS = 150000 |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
OPTIONAL_ENUM_CLASS agora::rtc::VideoFrameMetaDataType |
const int agora::rtc::STANDARD_BITRATE = 0 |
(Recommended) 0: Standard bitrate mode.
In this mode, the bitrates differ between the live broadcast and communication profiles:
const int agora::rtc::COMPATIBLE_BITRATE = -1 |
-1: Compatible bitrate mode.
In this mode, the bitrate remains the same regardless of the channel profile. If you choose this mode in the live-broadcast profile, the video frame rate may be lower than the set value.
const int agora::rtc::DEFAULT_MIN_BITRATE = -1 |
-1: (For future use) The default minimum bitrate.
const int agora::rtc::DEFAULT_MIN_BITRATE_EQUAL_TO_TARGET_BITRATE = -2 |
-2: (For future use) Set minimum bitrate the same as target bitrate.
|
static |
|
static |