#include <agora_rtc_api.h>
|
void(* | on_join_channel_success )(connection_id_t conn_id, uint32_t uid, int elapsed_ms) |
|
void(* | on_connection_lost )(connection_id_t conn_id) |
|
void(* | on_rejoin_channel_success )(connection_id_t conn_id, uint32_t uid, int elapsed_ms) |
|
void(* | on_error )(connection_id_t conn_id, int code, const char *msg) |
|
void(* | on_user_joined )(connection_id_t conn_id, uint32_t uid, int elapsed_ms) |
|
void(* | on_user_offline )(connection_id_t conn_id, uint32_t uid, int reason) |
|
void(* | on_user_mute_audio )(connection_id_t conn_id, uint32_t uid, bool muted) |
|
void(* | on_user_mute_video )(connection_id_t conn_id, uint32_t uid, bool muted) |
|
void(* | on_audio_data )(connection_id_t conn_id, uint32_t uid, uint16_t sent_ts, const void *data_ptr, size_t data_len, const audio_frame_info_t *info_ptr) |
|
void(* | on_mixed_audio_data )(connection_id_t conn_id, const void *data_ptr, size_t data_len, const audio_frame_info_t *info_ptr) |
|
void(* | on_video_data )(connection_id_t conn_id, uint32_t uid, uint16_t sent_ts, const void *data_ptr, size_t data_len, const video_frame_info_t *info_ptr) |
|
void(* | on_target_bitrate_changed )(connection_id_t conn_id, uint32_t target_bps) |
|
void(* | on_key_frame_gen_req )(connection_id_t conn_id, uint32_t uid, video_stream_type_e stream_type) |
|
void(* | on_local_user_registered )(const char *uname, uint32_t uid) |
|
void(* | on_remote_user_registered )(const char *uname, uint32_t uid) |
|
void(* | on_token_privilege_will_expire )(connection_id_t conn_id, const char *token) |
|
◆ on_audio_data
Occurs when receiving the audio frame of a remote user in the channel.
- Parameters
-
[in] | conn_id | Connection ID. A connection can correspond to multiple RTC channels. Use agora_rtc_create_connection to create a connection. |
[in] | uid | Remote user ID. |
[in] | sent_ts | Unix timestamp (ms) of the time when the remote user calls agora_rtc_send_audio_data to send data. |
[in] | data_ptr | Audio frame buffer. |
[in] | data_len | Audio frame buffer length (bytes). |
[in] | frame_info | Audio frame information. |
◆ on_connection_lost
Occurs when the local user disconnects from an RTC channel.
- Parameters
-
[in] | conn_id | Connection ID. A connection can correspond to multiple RTC channels. Use agora_rtc_create_connection to create a connection. |
◆ on_error
Occurs when the SDK reports an error.
In most cases, it means the SDK cannot recover from the error and you must take actions accordingly.
- Parameters
-
[in] | conn_id | Connection ID. A connection can correspond to multiple RTC channels. Use agora_rtc_create_connection to create a connection. |
[in] | code | Error code. |
[in] | msg | Error message. |
◆ on_join_channel_success
void(* on_join_channel_success) (connection_id_t conn_id, uint32_t uid, int elapsed_ms) |
Occurs when the local user joins an RTC channel successfully.
- Parameters
-
[in] | conn_id | Connection ID. A connection can correspond to multiple RTC channels. Use agora_rtc_create_connection to create a connection. |
[in] | uid | User ID. |
[in] | elapsed_ms | Time elapsed (ms) since the local user joins an RTC channel. |
◆ on_key_frame_gen_req
Occurs when a remote user requests a keyframe.
This callback notifies the sender to generate a new keyframe.
- Parameters
-
[in] | conn_id | Connection ID. A connection can correspond to multiple RTC channels. Use agora_rtc_create_connection to create a connection. |
[in] | uid | Remote user ID. |
[in] | stream_type | Stream type of the keyframe. |
◆ on_local_user_registered
void(* on_local_user_registered) (const char *uname, uint32_t uid) |
Occurs when initialization completes with a given user name.
- Parameters
-
[in] | uname | Local user name provided on initialization |
[in] | uid | Local user ID allocated by server |
◆ on_mixed_audio_data
Occurs when receiving the mixed audio frame of local and remote users. This callback occurs every 20 ms.
- Parameters
-
[in] | conn_id | Connection ID. A connection can correspond to multiple RTC channels. Use agora_rtc_create_connection to create a connection. |
[in] | data_ptr | Audio frame buffer. |
[in] | data_len | Audio frame buffer length (bytes). |
[in] | frame_info | Audio frame information. |
◆ on_rejoin_channel_success
void(* on_rejoin_channel_success) (connection_id_t conn_id, uint32_t uid, int elapsed_ms) |
Occurs when the local user rejoins an RTC channel successfully.
When the client disconnects from the RTC channel due to network issues, the SDK reconnects to the RTC channel and triggers this callback if successful.
- Parameters
-
[in] | conn_id | Connection ID. A connection can correspond to multiple RTC channels. Use agora_rtc_create_connection to create a connection. |
[in] | uid | User ID. |
[in] | elapsed_ms | Time elapsed (ms) since the local user rejoins an RTC channel. |
◆ on_remote_user_registered
void(* on_remote_user_registered) (const char *uname, uint32_t uid) |
Occurs when remote user registered.
- Parameters
-
[in] | uname | Remote user name. |
[in] | uid | Remote user ID. |
◆ on_target_bitrate_changed
void(* on_target_bitrate_changed) (connection_id_t conn_id, uint32_t target_bps) |
Occurs when network bandwidth change is detected. Use this callback to adjust your bitrate.
- Parameters
-
[in] | conn_id | Connection ID. A connection can correspond to multiple RTC channels. Use agora_rtc_create_connection to create a connection. |
[in] | target_bps | Target value (bps) that you are recommended to set the bitrate to. |
◆ on_token_privilege_will_expire
void(* on_token_privilege_will_expire) (connection_id_t conn_id, const char *token) |
Occurs when the RTC token expires in 30 seconds.
- Parameters
-
[in] | conn_id | Connection ID. A connection can correspond to multiple RTC channels. Use agora_rtc_create_connection to create a connection. |
[in] | token | The RTC token which is about to expire. |
If you specify the RTC token when calling agora_rtc_join_channel, the SDK triggers this callback if the RTC token expires in 30 seconds. You must request a new RTC token from your app server, and call agora_rtc_renew_token to pass the new RTC token to the SDK.
◆ on_user_joined
void(* on_user_joined) (connection_id_t conn_id, uint32_t uid, int elapsed_ms) |
Occurs when a remote user joins an RTC channel successfully.
- Parameters
-
[in] | conn_id | Connection ID. A connection can correspond to multiple RTC channels. Use agora_rtc_create_connection to create a connection. |
[in] | uid | Remote user ID. |
[in] | elapsed_ms | Time elapsed (ms) since the remote user joins the RTC channel. |
◆ on_user_mute_audio
void(* on_user_mute_audio) (connection_id_t conn_id, uint32_t uid, bool muted) |
Occurs when a remote user enables/disables sending audio.
- Parameters
-
[in] | conn_id | Connection ID. A connection can correspond to multiple RTC channels. Use agora_rtc_create_connection to create a connection. |
[in] | uid | Remote user ID. |
[in] | muted | Enables/disables sending audio.
- false: Enables sending audio.
- true: Disables sending audio.
|
◆ on_user_mute_video
void(* on_user_mute_video) (connection_id_t conn_id, uint32_t uid, bool muted) |
Occurs when a remote user enables/disables sending video.
- Parameters
-
[in] | conn_id | Connection ID. A connection can correspond to multiple RTC channels. Use agora_rtc_create_connection to create a connection. |
[in] | uid | Remote user ID. |
[in] | muted | Enables/disables sending video.
- false: Enables sending video.
- true: Disables sending video.
|
◆ on_user_offline
void(* on_user_offline) (connection_id_t conn_id, uint32_t uid, int reason) |
Occurs when a remote user leaves an RTC channel.
- Parameters
-
[in] | conn_id | Connection ID. A connection can correspond to multiple RTC channels. Use agora_rtc_create_connection to create a connection. |
[in] | uid | Remote user ID. |
[in] | reason | Reason why the remote user leaves the RTC channel. See user_offline_reason_e. |
◆ on_video_data
Occurs when receiving the video frame of a remote user in the channel.
- Parameters
-
[in] | conn_id | Connection ID. A connection can correspond to multiple RTC channels. Use agora_rtc_create_connection to create a connection. |
[in] | uid | Remote user ID. |
[in] | sent_ts | Timestamp (ms) for sending data. |
[in] | data_ptr | Video frame buffer. |
[in] | data_len | Video frame buffer length (bytes). |
[in] | frame_info | Video frame info. |
The documentation for this struct was generated from the following file: