NERtc Linux SDK  V5.4.10
nertc_channel_event_handler.h
浏览该文件的文档.
1 
8 #ifndef NERTC_CHANNEL_EVENT_HANDLER_H
9 #define NERTC_CHANNEL_EVENT_HANDLER_H
10 
11 #include "nertc_base_types.h"
12 #include "nertc_error_code.h"
13 #include "nertc_warn_code.h"
14 #include "nertc_engine_defines.h"
15 
20 namespace nertc
21 {
34 {
35 public:
36  virtual ~IRtcChannelEventHandler() {}
37 
53  virtual void onError(int error_code, const char* msg) {
54  (void)error_code;
55  (void)msg;
56  }
57 
73  virtual void onWarning(int warn_code, const char* msg) {
74  (void)warn_code;
75  (void)msg;
76  }
77 
94  virtual void onApiCallExecuted(const char* api_name, NERtcErrorCode error, const char* message) {
95  (void)api_name;
96  (void)error;
97  (void)message;
98  }
99 
117  virtual void onJoinChannel(channel_id_t cid, uid_t uid, NERtcErrorCode result, uint64_t elapsed) {
118  (void)cid;
119  (void)uid;
120  (void)result;
121  (void)elapsed;
122  }
123 
139  virtual void onReconnectingStart(channel_id_t cid, uid_t uid) {
140  (void)cid;
141  (void)uid;
142  }
143 
161  (void)state;
162  (void)reason;
163  }
164 
184  virtual void onRejoinChannel(channel_id_t cid, uid_t uid, NERtcErrorCode result, uint64_t elapsed) {
185  (void)cid;
186  (void)uid;
187  (void)result;
188  }
189 
203  virtual void onLeaveChannel(NERtcErrorCode result) {
204  (void)result;
205  }
206 
224  virtual void onDisconnect(NERtcErrorCode reason) {
225  (void)reason;
226  }
227 
249  virtual void onClientRoleChanged(NERtcClientRole oldRole, NERtcClientRole newRole) {
250  (void)oldRole;
251  (void)newRole;
252  }
253 
279  virtual void onUserJoined(uid_t uid, const char * user_name) {
280  (void)uid;
281  (void)user_name;
282  }
283 
323  virtual void onUserJoined(uid_t uid, const char* user_name, NERtcUserJoinExtraInfo join_extra_info) {
324  (void)uid;
325  (void)user_name;
326  (void)join_extra_info;
327  }
328 
353  virtual void onUserLeft(uid_t uid, NERtcSessionLeaveReason reason) {
354  (void)uid;
355  (void)reason;
356  }
357 
404  virtual void onUserLeft(uid_t uid, NERtcSessionLeaveReason reason, NERtcUserJoinExtraInfo leave_extra_info) {
405  (void)uid;
406  (void)reason;
407  (void)leave_extra_info;
408  }
409 
422  virtual void onUserAudioStart(uid_t uid) {
423  (void)uid;
424  }
437  virtual void onUserAudioStop(uid_t uid) {
438  (void)uid;
439  }
454  virtual void onUserAudioMute(uid_t uid, bool mute) {
455  (void)uid;
456  (void)mute;
457  }
458 
471  virtual void onUserSubStreamAudioStart(uid_t uid) { (void)uid; }
484  virtual void onUserSubStreamAudioStop(uid_t uid) { (void)uid; }
485 
504  virtual void onUserSubStreamAudioMute(uid_t uid, bool mute) {
505  (void)uid;
506  (void)mute;
507  }
522  virtual void onUserVideoStart(uid_t uid, NERtcVideoProfileType max_profile) {
523  (void)uid;
524  (void)max_profile;
525  }
538  virtual void onUserVideoStop(uid_t uid) {
539  (void)uid;
540  }
558  virtual void onUserVideoMute(uid_t uid, bool mute) {
559  (void)uid;
560  (void)mute;
561  }
562 
593  virtual void onUserVideoMute(NERtcVideoStreamType videoStreamType, uid_t uid, bool mute) {
594  (void)videoStreamType;
595  (void)uid;
596  (void)mute;
597  }
598 
613  virtual void onUserSubStreamVideoStart(uid_t uid, NERtcVideoProfileType max_profile) {
614  (void)uid;
615  (void)max_profile;
616  }
629  virtual void onUserSubStreamVideoStop(uid_t uid) {
630  (void)uid;
631  }
632 
647  (void)status;
648  }
649 
666 
678  virtual void onFirstAudioDataReceived(uid_t uid) {
679  (void)uid;
680  }
681 
696  virtual void onFirstVideoDataReceived(uid_t uid) {
697  (void)uid;
698  }
699 
726  (void)uid;
727  (void)type;
728  }
729 
768  virtual void onRemoteVideoReceiveSizeChanged(uid_t uid, NERtcVideoStreamType type, uint32_t width, uint32_t height) {
769  (void)uid;
770  (void)type;
771  (void)width;
772  (void)height;
773  }
774 
808  virtual void onLocalVideoRenderSizeChanged(NERtcVideoStreamType type, uint32_t width, uint32_t height) {
809  (void)type;
810  (void)width;
811  (void)height;
812  }
813 
825  virtual void onFirstAudioFrameDecoded(uid_t uid) {
826  (void)uid;
827  }
828 
847  virtual void onFirstVideoFrameDecoded(uid_t uid, uint32_t width, uint32_t height) {
848  (void)uid;
849  (void)width;
850  (void)height;
851  }
852 
888  virtual void onFirstVideoFrameDecoded(NERtcVideoStreamType type, uid_t uid, uint32_t width, uint32_t height) {
889  (void)uid;
890  (void)width;
891  (void)height;
892  (void)type;
893  }
913  virtual void onLocalAudioVolumeIndication(int volume) { (void)volume; }
914 
935  virtual void onLocalAudioVolumeIndication(int volume, bool enable_vad) {
936  (void)volume;
937  (void)enable_vad;
938  }
939 
965  virtual void onRemoteAudioVolumeIndication(const NERtcAudioVolumeInfo* speakers, unsigned int speaker_number,
966  int total_volume) {
967  (void)speakers;
968  (void)speaker_number;
969  (void)total_volume;
970  }
971 
993  virtual void onAddLiveStreamTask(const char* task_id, const char* url, int error_code) {
994  (void)task_id;
995  (void)url;
996  (void)error_code;
997  }
998 
1020  virtual void onUpdateLiveStreamTask(const char* task_id, const char* url, int error_code) {
1021  (void)task_id;
1022  (void)url;
1023  (void)error_code;
1024  }
1025 
1045  virtual void onRemoveLiveStreamTask(const char* task_id, int error_code) {
1046  (void)task_id;
1047  (void)error_code;
1048  }
1049 
1073  virtual void onLiveStreamState(const char* task_id, const char* url, NERtcLiveStreamStateCode state) {
1074  (void)task_id;
1075  (void)url;
1076  (void)state;
1077  }
1078 
1096  virtual void onRecvSEIMsg(uid_t uid, const char* data, uint32_t dataSize) {
1097  (void)uid;
1098  (void)data;
1099  (void)dataSize;
1100  }
1101 
1116  virtual void onMediaRelayStateChanged(NERtcChannelMediaRelayState state, const char* channel_name) {
1117  (void)state;
1118  (void)channel_name;
1119  }
1120 
1137  virtual void onMediaRelayEvent(NERtcChannelMediaRelayEvent event, const char* channel_name, NERtcErrorCode error) {
1138  (void)event;
1139  (void)channel_name;
1140  (void)error;
1141  }
1142 
1164  virtual void onLocalPublishFallbackToAudioOnly(bool is_fallback, NERtcVideoStreamType stream_type) {
1165  (void)is_fallback;
1166  }
1167 
1191  virtual void onRemoteSubscribeFallbackToAudioOnly(uid_t uid, bool is_fallback, NERtcVideoStreamType stream_type) {
1192  (void)uid;
1193  (void)is_fallback;
1194  }
1195 
1218  virtual void onMediaRightChange(bool is_audio_banned, bool is_video_banned) {
1219  (void)is_audio_banned;
1220  (void)is_video_banned;
1221  }
1222 
1234  virtual void onPermissionKeyWillExpire() {}
1235 
1268  virtual void onUpdatePermissionKey(const char* key, NERtcErrorCode error, int timeout) {
1269  (void)key;
1270  (void)error;
1271  (void)timeout;
1272  }
1273 };
1274 } // namespace nertc
1275 
1276 #endif
Definition: nertc_channel_event_handler.h:34
virtual void onUserAudioStop(uid_t uid)
Definition: nertc_channel_event_handler.h:437
virtual void onFirstVideoFrameDecoded(NERtcVideoStreamType type, uid_t uid, uint32_t width, uint32_t height)
Definition: nertc_channel_event_handler.h:888
virtual void onAddLiveStreamTask(const char *task_id, const char *url, int error_code)
Definition: nertc_channel_event_handler.h:993
virtual void onWarning(int warn_code, const char *msg)
Definition: nertc_channel_event_handler.h:73
virtual void onUserSubStreamVideoStart(uid_t uid, NERtcVideoProfileType max_profile)
Definition: nertc_channel_event_handler.h:613
virtual void onScreenCaptureSourceDataUpdate(NERtcScreenCaptureSourceData data)
Definition: nertc_channel_event_handler.h:665
virtual void onLiveStreamState(const char *task_id, const char *url, NERtcLiveStreamStateCode state)
Definition: nertc_channel_event_handler.h:1073
virtual void onUserAudioStart(uid_t uid)
Definition: nertc_channel_event_handler.h:422
virtual void onUserJoined(uid_t uid, const char *user_name)
Definition: nertc_channel_event_handler.h:279
virtual void onMediaRelayEvent(NERtcChannelMediaRelayEvent event, const char *channel_name, NERtcErrorCode error)
Definition: nertc_channel_event_handler.h:1137
virtual void onLocalVideoRenderSizeChanged(NERtcVideoStreamType type, uint32_t width, uint32_t height)
Definition: nertc_channel_event_handler.h:808
virtual void onUserSubStreamVideoStop(uid_t uid)
Definition: nertc_channel_event_handler.h:629
virtual void onRemoteVideoReceiveSizeChanged(uid_t uid, NERtcVideoStreamType type, uint32_t width, uint32_t height)
Definition: nertc_channel_event_handler.h:768
virtual void onMediaRightChange(bool is_audio_banned, bool is_video_banned)
Definition: nertc_channel_event_handler.h:1218
virtual void onLeaveChannel(NERtcErrorCode result)
Definition: nertc_channel_event_handler.h:203
virtual void onScreenCaptureStatus(NERtcScreenCaptureStatus status)
Definition: nertc_channel_event_handler.h:646
virtual void onUserJoined(uid_t uid, const char *user_name, NERtcUserJoinExtraInfo join_extra_info)
Definition: nertc_channel_event_handler.h:323
virtual void onUpdateLiveStreamTask(const char *task_id, const char *url, int error_code)
Definition: nertc_channel_event_handler.h:1020
virtual void onPermissionKeyWillExpire()
Definition: nertc_channel_event_handler.h:1234
virtual void onRecvSEIMsg(uid_t uid, const char *data, uint32_t dataSize)
Definition: nertc_channel_event_handler.h:1096
virtual void onRemoteAudioVolumeIndication(const NERtcAudioVolumeInfo *speakers, unsigned int speaker_number, int total_volume)
Definition: nertc_channel_event_handler.h:965
virtual void onUserSubStreamAudioStart(uid_t uid)
Definition: nertc_channel_event_handler.h:471
virtual void onConnectionStateChange(NERtcConnectionStateType state, NERtcReasonConnectionChangedType reason)
Definition: nertc_channel_event_handler.h:160
virtual void onUserLeft(uid_t uid, NERtcSessionLeaveReason reason, NERtcUserJoinExtraInfo leave_extra_info)
Definition: nertc_channel_event_handler.h:404
virtual void onUserSubStreamAudioMute(uid_t uid, bool mute)
Definition: nertc_channel_event_handler.h:504
virtual void onUserVideoStart(uid_t uid, NERtcVideoProfileType max_profile)
Definition: nertc_channel_event_handler.h:522
virtual void onFirstVideoDataReceived(NERtcVideoStreamType type, uid_t uid)
Definition: nertc_channel_event_handler.h:725
virtual void onUserVideoStop(uid_t uid)
Definition: nertc_channel_event_handler.h:538
virtual void onFirstVideoDataReceived(uid_t uid)
Definition: nertc_channel_event_handler.h:696
virtual void onRemoveLiveStreamTask(const char *task_id, int error_code)
Definition: nertc_channel_event_handler.h:1045
virtual void onLocalPublishFallbackToAudioOnly(bool is_fallback, NERtcVideoStreamType stream_type)
Definition: nertc_channel_event_handler.h:1164
virtual void onUserVideoMute(NERtcVideoStreamType videoStreamType, uid_t uid, bool mute)
Definition: nertc_channel_event_handler.h:593
virtual void onFirstAudioFrameDecoded(uid_t uid)
Definition: nertc_channel_event_handler.h:825
virtual void onError(int error_code, const char *msg)
Definition: nertc_channel_event_handler.h:53
virtual void onRemoteSubscribeFallbackToAudioOnly(uid_t uid, bool is_fallback, NERtcVideoStreamType stream_type)
Definition: nertc_channel_event_handler.h:1191
virtual void onClientRoleChanged(NERtcClientRole oldRole, NERtcClientRole newRole)
Definition: nertc_channel_event_handler.h:249
virtual void onUserSubStreamAudioStop(uid_t uid)
Definition: nertc_channel_event_handler.h:484
virtual void onFirstVideoFrameDecoded(uid_t uid, uint32_t width, uint32_t height)
Definition: nertc_channel_event_handler.h:847
virtual void onReconnectingStart(channel_id_t cid, uid_t uid)
Definition: nertc_channel_event_handler.h:139
virtual void onLocalAudioVolumeIndication(int volume)
Definition: nertc_channel_event_handler.h:913
virtual void onApiCallExecuted(const char *api_name, NERtcErrorCode error, const char *message)
Definition: nertc_channel_event_handler.h:94
virtual void onRejoinChannel(channel_id_t cid, uid_t uid, NERtcErrorCode result, uint64_t elapsed)
Definition: nertc_channel_event_handler.h:184
virtual void onDisconnect(NERtcErrorCode reason)
Definition: nertc_channel_event_handler.h:224
virtual void onUserVideoMute(uid_t uid, bool mute)
Definition: nertc_channel_event_handler.h:558
virtual void onFirstAudioDataReceived(uid_t uid)
Definition: nertc_channel_event_handler.h:678
virtual void onUpdatePermissionKey(const char *key, NERtcErrorCode error, int timeout)
Definition: nertc_channel_event_handler.h:1268
virtual void onUserLeft(uid_t uid, NERtcSessionLeaveReason reason)
Definition: nertc_channel_event_handler.h:353
virtual void onUserAudioMute(uid_t uid, bool mute)
Definition: nertc_channel_event_handler.h:454
virtual void onLocalAudioVolumeIndication(int volume, bool enable_vad)
Definition: nertc_channel_event_handler.h:935
virtual void onJoinChannel(channel_id_t cid, uid_t uid, NERtcErrorCode result, uint64_t elapsed)
Definition: nertc_channel_event_handler.h:117
virtual void onMediaRelayStateChanged(NERtcChannelMediaRelayState state, const char *channel_name)
Definition: nertc_channel_event_handler.h:1116
namespace nertc
NERtcClientRole
Definition: nertc_engine_defines.h:244
NERtcChannelMediaRelayState
Definition: nertc_engine_defines.h:5935
NERtcReasonConnectionChangedType
Definition: nertc_engine_defines.h:2272
NERtcVideoStreamType
Definition: nertc_engine_defines.h:5677
NERtcSessionLeaveReason
Definition: nertc_engine_defines.h:5342
NERtcConnectionStateType
Definition: nertc_engine_defines.h:2205
uint64_t uid_t
Definition: nertc_engine_defines.h:183
NERtcVideoProfileType
Definition: nertc_engine_defines.h:1631
uint64_t channel_id_t
Definition: nertc_engine_defines.h:192
NERtcScreenCaptureStatus
Definition: nertc_engine_defines.h:3864
NERtcLiveStreamStateCode
Definition: nertc_engine_defines.h:1049
NERtcErrorCode
Definition: nertc_error_code.h:26
NERtcChannelMediaRelayEvent
Definition: nertc_engine_defines.h:5982
NERtc SDK definitions.
The definition of error codes of NERtc SDK.
The definition of error codes of NERtc SDK.
Definition: nertc_engine_defines.h:2401
Definition: nertc_engine_defines.h:4042
Definition: nertc_engine_defines.h:7842