9#ifndef __AGORA_RTC_API_H__
10#define __AGORA_RTC_API_H__
22#if defined(__BUILDING_AGORA_SDK__)
23#define __agora_api__ __declspec(dllexport)
25#define __agora_api__ __declspec(dllimport)
31#define AGORA_RTC_CHANNEL_NAME_MAX_LEN (64)
32#define AGORA_RTC_USER_ID_MAX_LEN (255)
33#define AGORA_RTC_PRODUCT_ID_MAX_LEN (63)
34#define AGORA_RTM_UID_MAX_LEN 64
35#define AGORA_RTM_DATA_MAX_LEN (32 * 1024)
36#define AGORA_CREDENTIAL_MAX_LEN 256
37#define AGORA_CERTIFICATE_MAX_LEN 1024
38#define AGORA_LICENSE_VALUE_LEN 32
597#define CONNECTION_ID_ALL ((connection_id_t)0)
601#define CONNECTION_ID_INVALID ((connection_id_t)-1)
628 void (*on_join_channel_success)(
connection_id_t conn_id, uint32_t uid,
int elapsed_ms);
646 void (*on_rejoin_channel_success)(
connection_id_t conn_id, uint32_t uid,
int elapsed_ms);
688#ifndef CONFIG_AUDIO_ONLY
711 void (*on_audio_data)(
connection_id_t conn_id, uint32_t uid, uint16_t sent_ts,
const void *data_ptr,
size_t data_len,
722 void (*on_mixed_audio_data)(
connection_id_t conn_id,
const void *data_ptr,
size_t data_len,
725#ifndef CONFIG_AUDIO_ONLY
736 void (*on_video_data)(
connection_id_t conn_id, uint32_t uid, uint16_t sent_ts,
const void *data_ptr,
size_t data_len,
760#ifdef CONFIG_RTC_STRING_UID
767 void (*on_local_user_registered)(
const char *uname, uint32_t uid);
775 void (*on_remote_user_registered)(
const char *uname, uint32_t uid);
798 void (*on_media_ctrl_receive)(
connection_id_t conn_id, uint32_t uid,
const void *payload,
size_t length);
837 extern __agora_api__ int agora_rtc_init(const char *app_id, const agora_rtc_event_handler_t *event_handler,
962#ifndef CONFIG_AUDIO_ONLY
990#ifndef CONFIG_AUDIO_ONLY
1032#ifndef CONFIG_AUDIO_ONLY
1059 uint32_t start_bps);
1063#ifdef CONFIG_RTC_PROXY
1108 const void *payload,
size_t length);
1169 void (*on_rtm_data)(
const char *rtm_uid,
const void *msg,
size_t msg_len);
__agora_api__ int agora_rtc_send_video_data(connection_id_t conn_id, const void *data_ptr, size_t data_len, video_frame_info_t *info_ptr)
__agora_api__ int agora_rtc_fini(void)
__agora_api__ int agora_rtc_send_audio_data(connection_id_t conn_id, const void *data_ptr, size_t data_len, audio_frame_info_t *info_ptr)
cloud_proxy_type_e
Definition: agora_rtc_api.h:551
@ CLOUD_PROXY_AUTO
Definition: agora_rtc_api.h:567
@ CLOUD_PROXY_NONE
Definition: agora_rtc_api.h:555
@ CLOUD_PROXY_TCP
Definition: agora_rtc_api.h:563
@ CLOUD_PROXY_UDP
Definition: agora_rtc_api.h:559
area_code_e
Definition: agora_rtc_api.h:393
@ AREA_CODE_JP
Definition: agora_rtc_api.h:407
@ AREA_CODE_GLOB
Definition: agora_rtc_api.h:421
@ AREA_CODE_EU
Definition: agora_rtc_api.h:403
@ AREA_CODE_CN
Definition: agora_rtc_api.h:399
@ AREA_CODE_KR
Definition: agora_rtc_api.h:417
@ AREA_CODE_IN
Definition: agora_rtc_api.h:409
@ AREA_CODE_AS
Definition: agora_rtc_api.h:405
@ AREA_CODE_SA
Definition: agora_rtc_api.h:413
@ AREA_CODE_OVS
Definition: agora_rtc_api.h:419
@ AREA_CODE_OC
Definition: agora_rtc_api.h:411
@ AREA_CODE_NA
Definition: agora_rtc_api.h:401
@ AREA_CODE_AF
Definition: agora_rtc_api.h:415
@ AREA_CODE_DEFAULT
Definition: agora_rtc_api.h:397
video_data_type_e
Definition: agora_rtc_api.h:164
@ VIDEO_DATA_TYPE_YUV420
Definition: agora_rtc_api.h:168
@ VIDEO_DATA_TYPE_H264
Definition: agora_rtc_api.h:172
@ VIDEO_DATA_TYPE_H265
Definition: agora_rtc_api.h:176
@ VIDEO_DATA_TYPE_GENERIC_JPEG
Definition: agora_rtc_api.h:184
@ VIDEO_DATA_TYPE_GENERIC
Definition: agora_rtc_api.h:180
__agora_api__ int agora_rtc_mute_local_audio(connection_id_t conn_id, bool mute)
audio_codec_type_e
Definition: agora_rtc_api.h:269
@ AUDIO_CODEC_TYPE_G722
Definition: agora_rtc_api.h:281
@ AUDIO_CODEC_TYPE_OPUS
Definition: agora_rtc_api.h:277
@ AUDIO_CODEC_TYPE_G711U
Definition: agora_rtc_api.h:289
@ AUDIO_CODEC_DISABLED
Definition: agora_rtc_api.h:273
@ AUDIO_CODEC_TYPE_G711A
Definition: agora_rtc_api.h:285
#define AGORA_RTC_PRODUCT_ID_MAX_LEN
Definition: agora_rtc_api.h:33
__agora_api__ int agora_rtc_config_log(int size_per_file, int max_file_count)
network_event_type_e
Definition: agora_rtc_api.h:574
@ NETWORK_EVENT_DOWN
Definition: agora_rtc_api.h:578
@ NETWORK_EVENT_UP
Definition: agora_rtc_api.h:582
@ NETWORK_EVENT_CHANGE
Definition: agora_rtc_api.h:586
__agora_api__ int agora_rtc_mute_local_video(connection_id_t conn_id, bool mute)
__agora_api__ const char * agora_rtc_err_2_str(int err)
__agora_api__ int agora_rtc_set_cloud_proxy(cloud_proxy_type_e type)
__agora_api__ int agora_rtc_login_rtm(const char *rtm_uid, const char *rtm_token, const agora_rtm_handler_t *handler)
audio_data_type_e
Definition: agora_rtc_api.h:296
@ AUDIO_DATA_TYPE_OPUS
Definition: agora_rtc_api.h:300
@ AUDIO_DATA_TYPE_PCMA
Definition: agora_rtc_api.h:308
@ AUDIO_DATA_TYPE_GENERIC
Definition: agora_rtc_api.h:332
@ AUDIO_DATA_TYPE_PCM
Definition: agora_rtc_api.h:328
@ AUDIO_DATA_TYPE_HEAAC
Definition: agora_rtc_api.h:324
@ AUDIO_DATA_TYPE_G722
Definition: agora_rtc_api.h:316
@ AUDIO_DATA_TYPE_PCMU
Definition: agora_rtc_api.h:312
@ AUDIO_DATA_TYPE_AACLC
Definition: agora_rtc_api.h:320
@ AUDIO_DATA_TYPE_OPUSFB
Definition: agora_rtc_api.h:304
video_frame_type_e
Definition: agora_rtc_api.h:191
@ VIDEO_FRAME_KEY
Definition: agora_rtc_api.h:199
@ VIDEO_FRAME_AUTO_DETECT
Definition: agora_rtc_api.h:195
@ VIDEO_FRAME_DELTA
Definition: agora_rtc_api.h:203
video_stream_type_e
Definition: agora_rtc_api.h:231
@ VIDEO_STREAM_HIGH
Definition: agora_rtc_api.h:235
@ VIDEO_STREAM_LOW
Definition: agora_rtc_api.h:239
__agora_api__ int agora_rtc_set_log_level(rtc_log_level_e level)
rtm_err_code_e
Definition: agora_rtc_api.h:1134
@ ERR_RTM_INVALID_RTM_UID
Definition: agora_rtc_api.h:1142
@ ERR_RTM_TOKEN_EXPIRED
Definition: agora_rtc_api.h:1152
@ ERR_RTM_LOGIN_INVALID_TOKEN
Definition: agora_rtc_api.h:1144
@ ERR_RTM_INVALID_APP_ID
Definition: agora_rtc_api.h:1148
@ ERR_RTM_INVALID_TOKEN
Definition: agora_rtc_api.h:1154
@ ERR_RTM_LOGIN_REJECTED
Definition: agora_rtc_api.h:1140
@ ERR_RTM_FAILED
Definition: agora_rtc_api.h:1138
@ WARN_RTM_LOOKUP_CHANNEL_REJECTED
Definition: agora_rtc_api.h:1150
@ ERR_RTM_LOGIN_NOT_AUTHORIZED
Definition: agora_rtc_api.h:1146
@ ERR_RTM_OK
Definition: agora_rtc_api.h:1136
#define AGORA_LICENSE_VALUE_LEN
Definition: agora_rtc_api.h:38
__agora_api__ int agora_rtc_join_channel(connection_id_t conn_id, const char *channel_name, uint32_t uid, const char *token, rtc_channel_options_t *options)
__agora_api__ int agora_rtc_send_rtm_data(const char *rtm_uid, uint32_t msg_id, const void *msg, size_t msg_len)
__agora_api__ int agora_rtc_license_gen_credential(char *credential, unsigned int *credential_len)
__agora_api__ int agora_rtc_request_video_key_frame(connection_id_t conn_id, uint32_t remote_uid, video_stream_type_e stream_type)
__agora_api__ int agora_rtc_renew_token(connection_id_t conn_id, const char *token)
__agora_api__ int agora_rtc_mute_remote_video(connection_id_t conn_id, uint32_t remote_uid, bool mute)
#define AGORA_RTC_CHANNEL_NAME_MAX_LEN
Definition: agora_rtc_api.h:31
__agora_api__ int agora_rtc_mute_remote_audio(connection_id_t conn_id, uint32_t remote_uid, bool mute)
__agora_api__ int agora_rtc_license_verify(const char *certificate, int certificate_len, const char *credential, int credential_len)
__agora_api__ int agora_rtc_leave_channel(connection_id_t conn_id)
__agora_api__ int agora_rtc_notify_network_event(network_event_type_e event)
__agora_api__ int agora_rtc_get_connection_info(connection_id_t conn_id, connection_info_t *conn_info)
user_offline_reason_e
Definition: agora_rtc_api.h:149
@ USER_OFFLINE_DROPPED
Definition: agora_rtc_api.h:157
@ USER_OFFLINE_QUIT
Definition: agora_rtc_api.h:153
rtm_event_type_e
Definition: agora_rtc_api.h:1118
@ RTM_EVENT_TYPE_KICKOFF
Definition: agora_rtc_api.h:1126
@ RTM_EVENT_TYPE_EXIT
Definition: agora_rtc_api.h:1130
@ RTM_EVENT_TYPE_LOGIN
Definition: agora_rtc_api.h:1122
__agora_api__ int agora_rtc_logout_rtm(void)
rtc_log_level_e
Definition: agora_rtc_api.h:350
@ RTC_LOG_DEFAULT
Definition: agora_rtc_api.h:354
@ RTC_LOG_ALERT
Definition: agora_rtc_api.h:362
@ RTC_LOG_WARNING
Definition: agora_rtc_api.h:374
@ RTC_LOG_EMERG
Definition: agora_rtc_api.h:358
@ RTC_LOG_DEBUG
Definition: agora_rtc_api.h:386
@ RTC_LOG_ERROR
Definition: agora_rtc_api.h:370
@ RTC_LOG_INFO
Definition: agora_rtc_api.h:382
@ RTC_LOG_NOTICE
Definition: agora_rtc_api.h:378
@ RTC_LOG_CRIT
Definition: agora_rtc_api.h:366
__agora_api__ int agora_rtc_destroy_connection(connection_id_t conn_id)
const char * agora_rtc_get_version(void)
#define __agora_api__
Definition: agora_rtc_api.h:28
uint32_t connection_id_t
Definition: agora_rtc_api.h:592
__agora_api__ int agora_rtc_create_connection(connection_id_t *conn_id)
__agora_api__ int agora_rtc_set_params(const char *params)
__agora_api__ int agora_rtc_set_bwe_param(connection_id_t conn_id, uint32_t min_bps, uint32_t max_bps, uint32_t start_bps)
video_frame_rate_e
Definition: agora_rtc_api.h:210
@ VIDEO_FRAME_RATE_FPS_24
Definition: agora_rtc_api.h:220
@ VIDEO_FRAME_RATE_FPS_10
Definition: agora_rtc_api.h:216
@ VIDEO_FRAME_RATE_FPS_15
Definition: agora_rtc_api.h:218
@ VIDEO_FRAME_RATE_FPS_7
Definition: agora_rtc_api.h:214
@ VIDEO_FRAME_RATE_FPS_30
Definition: agora_rtc_api.h:222
@ VIDEO_FRAME_RATE_FPS_60
Definition: agora_rtc_api.h:224
@ VIDEO_FRAME_RATE_FPS_1
Definition: agora_rtc_api.h:212
agora_err_code_e
Definition: agora_rtc_api.h:42
@ ERR_SEND_VIDEO_OVER_BANDWIDTH_LIMIT
Definition: agora_rtc_api.h:132
@ ERR_OPEN_CHANNEL_TRY_NEXT_VOS
Definition: agora_rtc_api.h:122
@ ERR_INVALID_TOKEN
Definition: agora_rtc_api.h:97
@ ERR_INVALID_APP_ID
Definition: agora_rtc_api.h:67
@ ERR_JOIN_CHANNEL_REJECTED
Definition: agora_rtc_api.h:62
@ ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED
Definition: agora_rtc_api.h:107
@ ERR_FAILED
Definition: agora_rtc_api.h:51
@ ERR_DECRYPTION_FAILED
Definition: agora_rtc_api.h:112
@ ERR_TOKEN_EXPIRED
Definition: agora_rtc_api.h:92
@ ERR_OPEN_CHANNEL_REJECTED
Definition: agora_rtc_api.h:87
@ ERR_AUDIO_DECODER_NOT_MATCH_AUDIO_FRAME
Definition: agora_rtc_api.h:137
@ ERR_OKAY
Definition: agora_rtc_api.h:46
@ ERR_OPEN_CHANNEL_INVALID_TICKET
Definition: agora_rtc_api.h:117
@ ERR_INVALID_CHANNEL_NAME
Definition: agora_rtc_api.h:72
@ ERR_NO_SERVER_RESOURCES
Definition: agora_rtc_api.h:77
@ ERR_DYNAMIC_TOKEN_BUT_USE_STATIC_KEY
Definition: agora_rtc_api.h:102
@ ERR_LOOKUP_CHANNEL_REJECTED
Definition: agora_rtc_api.h:82
@ ERR_NET_DOWN
Definition: agora_rtc_api.h:56
@ ERR_NO_AUDIO_DECODER_TO_HANDLE_AUDIO_FRAME
Definition: agora_rtc_api.h:142
@ ERR_CLIENT_IS_BANNED_BY_SERVER
Definition: agora_rtc_api.h:127
Definition: agora_rtc_api.h:620
Definition: agora_rtc_api.h:1161
Definition: agora_rtc_api.h:480
int pcm_channel_num
Definition: agora_rtc_api.h:497
int pcm_sample_rate
Definition: agora_rtc_api.h:491
audio_codec_type_e audio_codec_type
Definition: agora_rtc_api.h:484
Definition: agora_rtc_api.h:339
audio_data_type_e data_type
Definition: agora_rtc_api.h:343
Definition: agora_rtc_api.h:607
connection_id_t conn_id
Definition: agora_rtc_api.h:609
uint32_t uid
Definition: agora_rtc_api.h:611
Definition: agora_rtc_api.h:428
bool log_disable_desensitize
Definition: agora_rtc_api.h:440
const char * log_path
Definition: agora_rtc_api.h:448
bool log_disable
Definition: agora_rtc_api.h:434
rtc_log_level_e log_level
Definition: agora_rtc_api.h:444
Definition: agora_rtc_api.h:504
bool auto_subscribe_video
Definition: agora_rtc_api.h:516
bool auto_subscribe_audio
Definition: agora_rtc_api.h:510
audio_codec_option_t audio_codec_opt
Definition: agora_rtc_api.h:538
bool enable_audio_mixer
Definition: agora_rtc_api.h:534
bool enable_aut_encryption
Definition: agora_rtc_api.h:544
bool enable_audio_jitter_buffer
Definition: agora_rtc_api.h:528
bool subscribe_local_user
Definition: agora_rtc_api.h:522
Definition: agora_rtc_api.h:455
uint32_t area_code
Definition: agora_rtc_api.h:460
log_config_t log_cfg
Definition: agora_rtc_api.h:468
Definition: agora_rtc_api.h:246
video_frame_type_e frame_type
Definition: agora_rtc_api.h:258
video_frame_rate_e frame_rate
Definition: agora_rtc_api.h:262
video_stream_type_e stream_type
Definition: agora_rtc_api.h:254
video_data_type_e data_type
Definition: agora_rtc_api.h:250