|
typedef void(* | nim_vchat_cb_func) (enum NIMVideoChatSessionType type, int64_t channel_id, int code, const char *json_extension, const void *user_data) |
|
typedef void(* | nim_vchat_mp4_record_opt_cb_func) (bool ret, int code, const char *file, int64_t time, const char *json_extension, const void *user_data) |
|
typedef void(* | nim_vchat_audio_record_opt_cb_func) (bool ret, int code, const char *file, int64_t time, const char *json_extension, const void *user_data) |
|
typedef void(* | nim_vchat_opt_cb_func) (bool ret, int code, const char *json_extension, const void *user_data) |
|
typedef void(* | nim_vchat_opt2_cb_func) (int code, int64_t channel_id, const char *json_extension, const void *user_data) |
|
typedef void(* | nim_vchat_rate_callback) (bool ret, int response_code, const char *json_extension, const void *user_data) |
|
typedef void(* | nim_vchat_remote_audio_data_cb_func) (uint64_t time, const char *data, unsigned int size, int channels, int rate, const char *json_extension, const void *user_data) |
|
|
enum | NIMVideoChatSessionType {
kNIMVideoChatSessionTypeStartRes = 1
, kNIMVideoChatSessionTypeInviteNotify = 2
, kNIMVideoChatSessionTypeCalleeAckRes = 3
, kNIMVideoChatSessionTypeCalleeAckNotify = 4
,
kNIMVideoChatSessionTypeControlRes = 5
, kNIMVideoChatSessionTypeControlNotify = 6
, kNIMVideoChatSessionTypeConnect = 7
, kNIMVideoChatSessionTypePeopleStatus = 8
,
kNIMVideoChatSessionTypeNetStatus = 9
, kNIMVideoChatSessionTypeHangupRes = 10
, kNIMVideoChatSessionTypeHangupNotify = 11
, kNIMVideoChatSessionTypeSyncAckNotify = 12
,
kNIMVideoChatSessionTypeMp4Notify = 13
, kNIMVideoChatSessionTypeInfoNotify = 14
, kNIMVideoChatSessionTypeVolumeNotify = 15
, kNIMVideoChatSessionTypeAuRecordNotify = 16
,
kNIMVideoChatSessionTypeLiveState = 17
, kNIMVideoChatSessionTypePubSubNotify = 18
} |
|
enum | NIMVChatControlType {
kNIMTagControlOpenAudio = 1
, kNIMTagControlCloseAudio = 2
, kNIMTagControlOpenVideo = 3
, kNIMTagControlCloseVideo = 4
,
kNIMTagControlAudioToVideo = 5
, kNIMTagControlAgreeAudioToVideo = 6
, kNIMTagControlRejectAudioToVideo = 7
, kNIMTagControlVideoToAudio = 8
,
kNIMTagControlBusyLine = 9
, kNIMTagControlCamaraNotAvailable = 10
, kNIMTagControlEnterBackground = 11
, kNIMTagControlReceiveStartNotifyFeedback = 12
,
kNIMTagControlMp4StartRecord = 13
, kNIMTagControlMp4StopRecord = 14
} |
|
enum | NIMVideoChatMode { kNIMVideoChatModeAudio = 1
, kNIMVideoChatModeVideo = 2
} |
|
enum | NIMVChatConnectStatus {
kNIMVChatConnectNone = 0
, kNIMVChatConnecting = 1
, kNIMVChatConnected = 2
, kNIMVChatReConnecting = 3
,
kNIMVChatDisconnect = 4
} |
|
enum | NIMVChatVideoQuality {
kNIMVChatVideoQualityNormal = 0
, kNIMVChatVideoQualityLow = 1
, kNIMVChatVideoQualityMedium = 2
, kNIMVChatVideoQualityHigh = 3
,
kNIMVChatVideoQualitySuper = 4
, kNIMVChatVideoQuality540p = 5
, kNIMVChatVideoQuality720p = 6
} |
|
enum | NIMVChatVideoFrameRate {
kNIMVChatVideoFrameRateNormal = 0
, kNIMVChatVideoFrameRate5 = 1
, kNIMVChatVideoFrameRate10 = 2
, kNIMVChatVideoFrameRate15 = 3
,
kNIMVChatVideoFrameRate20 = 4
, kNIMVChatVideoFrameRate25 = 5
} |
|
enum | NIMVChatVideoEncodeMode { kNIMVChatVEModeNormal = 0
, kNIMVChatVEModeFramerate = 1
, kNIMVChatVEModeQuality = 2
, kNIMVChatVEModeScreen = 3
} |
|
enum | NIMVChatVideoFrameScaleType { kNIMVChatVideoFrameScaleNone = 0
, kNIMVChatVideoFrameScale1x1 = 1
, kNIMVChatVideoFrameScale4x3 = 2
, kNIMVChatVideoFrameScale16x9 = 3
} |
|
enum | NIMVChatMp4RecordCode {
kNIMVChatMp4RecordClose = 0
, kNIMVChatMp4RecordVideoSizeError = 1
, kNIMVChatMp4RecordOutDiskSpace = 2
, kNIMVChatMp4RecordThreadBusy = 3
,
kNIMVChatMp4RecordCreate = 200
, kNIMVChatMp4RecordExsit = 400
, kNIMVChatMp4RecordCreateError = 403
, kNIMVChatMp4RecordInvalid = 404
} |
|
enum | NIMVChatAudioRecordCode {
kNIMVChatAudioRecordClose = 0
, kNIMVChatAudioRecordOutDiskSpace = 2
, kNIMVChatAudioRecordCreate = 200
, kNIMVChatAudioRecordExsit = 400
,
kNIMVChatAudioRecordCreateError = 403
, kNIMVChatAudioRecordInvalid = 404
} |
|
enum | NIMVChatVideoSplitMode {
kNIMVChatSplitBottomHorFloating = 0
, kNIMVChatSplitTopHorFloating = 1
, kNIMVChatSplitLatticeTile = 2
, kNIMVChatSplitLatticeCuttingTile = 3
,
kNIMVChatSplitCustomLayout = 4
, kNIMVChatSplitAudioLayout = 5
} |
|
enum | NIMVChatLiveStateCode {
kNIMVChatLiveStateInitial = 500
, kNIMVChatLiveStateLayoutError = 501
, kNIMVChatLiveStateStartConnecting = 502
, kNIMVChatLiveStateConnectted = 503
,
kNIMVChatLiveStateConnectFail = 504
, kNIMVChatLiveStatePushing = 505
, kNIMVChatLiveStatePushFail = 506
, kNIMVChatLiveStateInnerError = 507
,
kNIMVChatLiveStatePeopleLimit = 508
} |
|
enum | NIMVChatAudioMode { kNIMVChatAdModeDefault = 0
, kNIMVChatAdModeNormal = 1
, kNIMVChatAdModeHighVoip = 2
, kNIMVChatAdModeHighMusic = 3
} |
|
enum | NIMVideoChatSessionStatus { kNIMVideoChatSessionStatusJoined = 0
, kNIMVideoChatSessionStatusLeaved = 1
} |
|
enum | NIMVideoChatUserLeftType { kNIMVChatUserLeftTimeout = -1
, kNIMVChatUserLeftNormal = 0
} |
|
enum | NIMVideoChatSessionNetStat { kNIMVChatNetStatusVideoClose = -1
, kNIMVideoChatSessionNetStatGood = 0
, kNIMVideoChatSessionNetStatPoor = 1
, kNIMVideoChatSessionNetStatBad = 2
} |
|
enum | NIMVChatConnectErrorCode {
kNIMVChatConnectDisconn = 0
, kNIMVChatConnectStartFail = 1
, kNIMVChatConnectTimeout = 101
, kNIMVChatConnectMeetingModeError = 102
,
kNIMVChatConnectRtmpModeError = 103
, kNIMVChatConnectRtmpNodesError = 104
, kNIMVChatConnectRtmpHostError = 105
, kNIMVChatConnectRtmpCreateError = 106
,
kNIMVChatJoinServerValidError = 107
, kNIMVChatJoinChannelClosed = 108
, kNIMVChatConnectSuccess = 200
, kNIMVChatConnectLayoutError = 208
,
kNIMVChatConnectInvalidParam = 400
, kNIMVChatConnectDesKey = 401
, kNIMVChatConnectInvalidRequst = 417
, kNIMVChatConnectServerUnknown = 500
,
kNIMVChatConnectLogout = 1001
, kNIMVChatChannelStartFail = 11000
, kNIMVChatChannelDisconnected = 11001
, kNIMVChatVersionSelfLow = 11002
,
kNIMVChatVersionRemoteLow = 11003
, kNIMVChatLocalChannelClosed = 11004
, kNIMVChatLocalChannelKicked = 11005
} |
|
enum | NIMNetDetectType { kNIMNetDetectTypeAudio = 0
, kNIMNetDetectTypeVideo = 1
} |
|
enum | NIMNetDetectVideoQuality {
kNIMNDVideoQualityDefault = 0
, kNIMNDVideoQualityLow = 1
, kNIMNDVideoQualityMedium = 2
, kNIMNDVideoQualityHigh = 3
,
kNIMNDVideoQuality480p = 4
, kNIMNDVideoQuality540p = 5
, kNIMNDVideoQuality720p = 6
} |
|
enum | NIMMainPictureOptCode {
kNIMMainPictureOptSucess = 200
, kNIMMainPictureOptAuthError = 401
, kNIMMainPictureOptRoomNotExist = 404
, kNIMMainPictureOptUidNotExist = 405
,
kNIMMainPictureOptDataError = 417
, kNIMMainPictureOptError = 500
, kNIMMainPictureOptServerError = 600
, kNIMMainPictureOptInvalid = 11403
} |
|
enum | NIMVChatServRecordType { kNIMVChatServRecordMixedSingle = 0
, kNIMVChatServRecordMixed = 1
, kNIMVChatServRecordSingle = 2
} |
|
enum | NIMVChatPubSubNotifyType {
kNIMVChatNotifyPublishVideoRet = 0
, kNIMVChatNotifyUnpublishVideoRet = 1
, kNIMVChatNotifyRemotePublishVideo = 2
, kNIMVChatNotifyRemoteUnpublishVideo = 3
,
kNIMVChatNotifySubscribeVideoRet = 4
, kNIMVChatNotifyUnsubscribeVideoRet = 5
, kNIMVChatNotifySubscribeAudioRet = 6
, kNIMVChatNotifyUnsubscribeAudioRet = 7
} |
|
enum | NIMVChatPublishVideoStreamMode { kNIMVChatPublishVideoSingleStream = 0
, kNIMVChatPublishVideoDualStream = 1
} |
|
enum | NIMVChatPublishVideoSimulcastRes { kNIMVChatPublishVideoSimulcastResHigh = 0
, kNIMVChatPublishVideoSimulcastResLow = 2
} |
|
enum | NIMVChatPubSubErrorCode {
kNIMVChatPSErrCodeSuccess = 0
, kNIMVChatPSErrCodeFail = -1
, kNIMVChatPSErrCodeViewerMode = -200
, kNIMVChatPSErrCodeAudioMode = -300
,
kNIMVChatPSErrCodeOptBusy = -400
, kNIMVChatPSErrCodeAutoMode = -500
, kNIMVChatPSErrCodeForbid = -600
, kNIMVChatPSErrCodeSubscribed = -700
} |
|
enum | NIMVChatServerSubscribeFallbackStrategy { kNIMVChatSteamFallbackStrategyDisabled = 0
, kNIMVChatSteamFallbackStrategyAudioOnly = 2
} |
|
void(* nim_vchat_cb_func)(NIMVideoChatSessionType type, int64_t channel_id, int code, const char *json_extension, const void *user_data) |
NIM VChat 音视频通话中状态返回回调接口
根据NIMVideoChatSessionType的具体参数说明如下:
kNIMVideoChatSessionTypeStartRes, // 创建通话结果 code=200成功,json 返回kNIMVChatSessionId
kNIMVideoChatSessionTypeInviteNotify, // 通话邀请 code无效,json 返回kNIMVChatUid发起者,kNIMVChatType对应NIMVideoChatMode, kNIMVChatTime, kNIMVChatCustomInfo
kNIMVideoChatSessionTypeCalleeAckRes, // 确认通话,接受拒绝结果 json 无效 code: 200:成功 9103 : 已经在其他端接听 / 拒绝过这通电话
kNIMVideoChatSessionTypeCalleeAckNotify, // 确认通话,接受拒绝通知 code=无效,json 返回kNIMVChatUid对方,kNIMVChatType对应NIMVideoChatMode, kNIMVChatAccept
kNIMVideoChatSessionTypeControlRes, //NIMVChatControlType 结果 code=200成功,json 返回kNIMVChatType对应NIMVChatControlType
kNIMVideoChatSessionTypeControlNotify, //NIMVChatControlType 通知 code=无效,json 返回kNIMVChatUid对方,kNIMVChatType对应NIMVChatControlType
kNIMVideoChatSessionTypeConnect, // 通话中链接状态通知 code对应NIMVChatConnectErrorCode, 非200均失败并底层结束
// code=1001,代表通话注销结果,带通话本地时长(kNIMVChatTime)及数据量(kNIMVChatTrafficStatRX kNIMVChatTrafficStatTX)
kNIMVideoChatSessionTypePeopleStatus, // 通话中成员状态 code对应NIMVideoChatSessionStatus, json返回kNIMVChatUid,如果是离开带kNIMVChatStatus对应NIMVideoChatUserLeftType
kNIMVideoChatSessionTypeNetStatus, // 通话中网络状态 code对应NIMVideoChatSessionNetStat, json返回kNIMVChatUid
kNIMVideoChatSessionTypeHangupRes, // 通话主动结果 code=200成功,json无效
kNIMVideoChatSessionTypeHangupNotify, // 通话被挂断通知 code无效,json无效
kNIMVideoChatSessionTypeSyncAckNotify, // 其他端接听挂断后的同步通知 json 返回 kNIMVChatTime,kNIMVChatType对应NIMVideoChatMode,kNIMVChatAccept,kNIMVChatClient
kNIMVideoChatSessionTypeMp4Notify //windows(pc)有效.通知MP4录制状态,包括开始录制和结束录制, code无效,json(其他成员的录制通知带uid,自己的不带) 返回如下
// MP4开始 {"mp4_start":{ "mp4_file": "d:\\test.mp4", "time": 14496477000000, "uid":"id123" }}
// MP4结束 {"mp4_close":{ "mp4_file": "d:\\test.mp4", "time": 120000, "status": 0, "uid":"id123" }}
kNIMVideoChatSessionTypeAuRecordNotify //windows(pc)有效.通知音频录制状态,包括开始录制和结束录制 code无效,json 返回如下
// 录制开始 {"audio_record_start":{ "file": "d:\\test.aac", "time": 14496477000000 }}
// 录制结束 {"audio_record_close":{ "file": "d:\\test.aac", "time": 120000, "status": 0 }}
kNIMVideoChatSessionTypeInfoNotify // 实时状态 {"static_info":{"rtt":20, "video": {"fps":20, "KBps":200, "lost_rate":5, "width":1280,"height":720}, "audio": {"fps":17, "KBps":3", lost_rate":3 }}}
kNIMVideoChatSessionTypeVolumeNotify // 音量状态 {"audio_volume":{ "self": {"status":600}, "receiver": [{"uid":"id123","status":1000},{"uid":"id456","status":222}] }}
kNIMVideoChatSessionTypeLiveState //windows(pc)有效.直播状态 {"live_state":{"status":505 }}
kNIMVideoChatSessionTypePubSubNotify // 订阅及发布相关的通知,code返回(NIMVChatPubSubErrorCode),json包含kNIMVChatType(NIMVChatPubSubNotifyType) 远端视频额外带有kNIMVChatUid 本端订阅发布操作、远端发布带有kNIMVChatVideoSimulcastResList
- 参数
-
[out] | type | NIMVideoChatSessionType |
[out] | channel_id | 通话的通道id |
[out] | code | 结果类型或错误类型 |
[out] | json_extension | Json string 扩展 |
[out] | user_data | APP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理! |
- 返回
- void 无返回值