正在显示
3 个修改的文件
包含
25 行增加
和
21 行删除
| @@ -41,13 +41,13 @@ class AudioApe extends Ape { | @@ -41,13 +41,13 @@ class AudioApe extends Ape { | ||
| 41 | /////////////发送数据操作//////////////////////////////////////////// | 41 | /////////////发送数据操作//////////////////////////////////////////// |
| 42 | //获取播流地址 | 42 | //获取播流地址 |
| 43 | getAudioPlayPath(_param) { | 43 | getAudioPlayPath(_param) { |
| 44 | - loger.log('getAudioPlayPath'); | 44 | + loger.log('获取播流地址->'); |
| 45 | return this.mediaModule.getMediaPlayPath(_param); | 45 | return this.mediaModule.getMediaPlayPath(_param); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | //获取推流地址 | 48 | //获取推流地址 |
| 49 | getAudioPublishPath(_param) { | 49 | getAudioPublishPath(_param) { |
| 50 | - loger.log('getAudioPublishPath'); | 50 | + loger.log('获取推流地址->'); |
| 51 | if(!this.mcu.connected){ | 51 | if(!this.mcu.connected){ |
| 52 | loger.warn(GlobalConfig.getCurrentStatus()); | 52 | loger.warn(GlobalConfig.getCurrentStatus()); |
| 53 | return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"};; | 53 | return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"};; |
| @@ -57,7 +57,7 @@ class AudioApe extends Ape { | @@ -57,7 +57,7 @@ class AudioApe extends Ape { | ||
| 57 | 57 | ||
| 58 | //获取当前所有频道信息 | 58 | //获取当前所有频道信息 |
| 59 | getAllChannelInfo(_param){ | 59 | getAllChannelInfo(_param){ |
| 60 | - loger.log('getAllChannelInfo'); | 60 | + loger.log('获取当前所有频道信息->'); |
| 61 | return this.mediaModule.getAllMediaChannelInfo(); | 61 | return this.mediaModule.getAllMediaChannelInfo(); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| @@ -70,7 +70,7 @@ class AudioApe extends Ape { | @@ -70,7 +70,7 @@ class AudioApe extends Ape { | ||
| 70 | 70 | ||
| 71 | if (_param == null||_param.publishUrl == null) | 71 | if (_param == null||_param.publishUrl == null) |
| 72 | { | 72 | { |
| 73 | - loger.warn('publishAudio,参数错误', _param); | 73 | + loger.warn('推流->参数错误', _param); |
| 74 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 74 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 75 | return {"code": ApeConsts.RETURN_FAILED, "data": "参数错误"}; | 75 | return {"code": ApeConsts.RETURN_FAILED, "data": "参数错误"}; |
| 76 | } | 76 | } |
| @@ -78,7 +78,7 @@ class AudioApe extends Ape { | @@ -78,7 +78,7 @@ class AudioApe extends Ape { | ||
| 78 | //根据推流的地址获取对应的频道信息 | 78 | //根据推流的地址获取对应的频道信息 |
| 79 | let needPublishChannelInfo=this.mediaModule.getNeedPublishMediaChannel(_param.publishUrl); | 79 | let needPublishChannelInfo=this.mediaModule.getNeedPublishMediaChannel(_param.publishUrl); |
| 80 | if(needPublishChannelInfo==null){ | 80 | if(needPublishChannelInfo==null){ |
| 81 | - loger.warn('publishVideo,推流数据已经无效', _param); | 81 | + loger.warn('推流->推流数据已经无效', _param); |
| 82 | return {"code": ApeConsts.RETURN_FAILED, "data": "推流数据已经无效"}; | 82 | return {"code": ApeConsts.RETURN_FAILED, "data": "推流数据已经无效"}; |
| 83 | } | 83 | } |
| 84 | 84 | ||
| @@ -93,7 +93,7 @@ class AudioApe extends Ape { | @@ -93,7 +93,7 @@ class AudioApe extends Ape { | ||
| 93 | //判断当前是否还有空闲的channle | 93 | //判断当前是否还有空闲的channle |
| 94 | let freeChannel = this.mediaModule.getFreeMediaChannel(); | 94 | let freeChannel = this.mediaModule.getFreeMediaChannel(); |
| 95 | if (freeChannel == 0) { | 95 | if (freeChannel == 0) { |
| 96 | - loger.warn("publishAudio,没有空闲的channel "); | 96 | + loger.warn("推流->不能再打开更多的设备"); |
| 97 | return {"code": ApeConsts.RETURN_FAILED, "data": "不能再打开更多的设备","mediaChannels":this.mediaModule.mediaChannels}; | 97 | return {"code": ApeConsts.RETURN_FAILED, "data": "不能再打开更多的设备","mediaChannels":this.mediaModule.mediaChannels}; |
| 98 | } | 98 | } |
| 99 | 99 | ||
| @@ -116,7 +116,7 @@ class AudioApe extends Ape { | @@ -116,7 +116,7 @@ class AudioApe extends Ape { | ||
| 116 | 116 | ||
| 117 | //停止推流, | 117 | //停止推流, |
| 118 | stopPublishAudio(_param) { | 118 | stopPublishAudio(_param) { |
| 119 | - loger.log('stopPublishAudio ->_param',_param); | 119 | + loger.log('停止推流 ->',_param); |
| 120 | if(!this.mcu.connected){ | 120 | if(!this.mcu.connected){ |
| 121 | loger.warn(GlobalConfig.getCurrentStatus()); | 121 | loger.warn(GlobalConfig.getCurrentStatus()); |
| 122 | return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"}; | 122 | return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"}; |
| @@ -317,7 +317,7 @@ class AudioApe extends Ape { | @@ -317,7 +317,7 @@ class AudioApe extends Ape { | ||
| 317 | receiveChannelInfo.mediaId=unpackChannelInfo.channelId; | 317 | receiveChannelInfo.mediaId=unpackChannelInfo.channelId; |
| 318 | receiveChannelInfo.fromNodeId=unpackChannelInfo.fromNodeId; | 318 | receiveChannelInfo.fromNodeId=unpackChannelInfo.fromNodeId; |
| 319 | receiveChannelInfo.userName=unpackChannelInfo.userName||""; | 319 | receiveChannelInfo.userName=unpackChannelInfo.userName||""; |
| 320 | - | 320 | + receiveChannelInfo.userRole=unpackChannelInfo.userRole||ApeConsts.normal; |
| 321 | //消息不是自己同步的,需要处理 | 321 | //消息不是自己同步的,需要处理 |
| 322 | if(unpackChannelInfo.status==ApeConsts.CHANNEL_STATUS_OPENING){ | 322 | if(unpackChannelInfo.status==ApeConsts.CHANNEL_STATUS_OPENING){ |
| 323 | //正在推流 | 323 | //正在推流 |
| @@ -340,11 +340,11 @@ class AudioApe extends Ape { | @@ -340,11 +340,11 @@ class AudioApe extends Ape { | ||
| 340 | if(replay.code==0){ | 340 | if(replay.code==0){ |
| 341 | receiveChannelInfo.replay=replay.playUrl; | 341 | receiveChannelInfo.replay=replay.playUrl; |
| 342 | } | 342 | } |
| 343 | - loger.log("AUDIO_PLAY",receiveChannelInfo); | 343 | + loger.log("AUDIO_PLAY->",receiveChannelInfo); |
| 344 | //广播播放视频的消息 | 344 | //广播播放视频的消息 |
| 345 | this._emit(MessageTypes.AUDIO_PLAY, receiveChannelInfo); | 345 | this._emit(MessageTypes.AUDIO_PLAY, receiveChannelInfo); |
| 346 | }else { | 346 | }else { |
| 347 | - loger.log("AUDIO_STOP",receiveChannelInfo); | 347 | + loger.log("AUDIO_STOP->",receiveChannelInfo); |
| 348 | //流已经停止 | 348 | //流已经停止 |
| 349 | this._emit(MessageTypes.AUDIO_STOP, receiveChannelInfo); | 349 | this._emit(MessageTypes.AUDIO_STOP, receiveChannelInfo); |
| 350 | } | 350 | } |
| @@ -358,9 +358,9 @@ class AudioApe extends Ape { | @@ -358,9 +358,9 @@ class AudioApe extends Ape { | ||
| 358 | 358 | ||
| 359 | ///////数据的封包和解包///////////////////////////////////////// | 359 | ///////数据的封包和解包///////////////////////////////////////// |
| 360 | packPdu(_param, _itemIdx) { | 360 | packPdu(_param, _itemIdx) { |
| 361 | - loger.log("packPdu "); | ||
| 362 | //验证坐标点集合数组是否合法 | 361 | //验证坐标点集合数组是否合法 |
| 363 | if (_param == null || _itemIdx == null) { | 362 | if (_param == null || _itemIdx == null) { |
| 363 | + loger.warn("packPdu->失败"); | ||
| 364 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 364 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 365 | return null; | 365 | return null; |
| 366 | } | 366 | } |
| @@ -378,22 +378,22 @@ class AudioApe extends Ape { | @@ -378,22 +378,22 @@ class AudioApe extends Ape { | ||
| 378 | packPduModel.fromNodeId = GlobalConfig.nodeId; | 378 | packPduModel.fromNodeId = GlobalConfig.nodeId; |
| 379 | packPduModel.userName=GlobalConfig.userName||""; | 379 | packPduModel.userName=GlobalConfig.userName||""; |
| 380 | packPduModel.toNodeId = 0; | 380 | packPduModel.toNodeId = 0; |
| 381 | - loger.log("packPdu",packPduModel); | 381 | + packPduModel.userRole=GlobalConfig.userRole||ApeConsts.normal; |
| 382 | + loger.log("packPdu->",packPduModel); | ||
| 382 | return packPduModel; | 383 | return packPduModel; |
| 383 | } | 384 | } |
| 384 | 385 | ||
| 385 | unPackPdu(owner, itemIdx, itemData) { | 386 | unPackPdu(owner, itemIdx, itemData) { |
| 386 | - loger.log("unPackPdu "); | ||
| 387 | if (owner == null || itemIdx == null || itemData == null) { | 387 | if (owner == null || itemIdx == null || itemData == null) { |
| 388 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 388 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 389 | return null; | 389 | return null; |
| 390 | } | 390 | } |
| 391 | try { | 391 | try { |
| 392 | let packChannelInfo = pdu['RCAudioChannelInfoPdu'].decode(itemData); | 392 | let packChannelInfo = pdu['RCAudioChannelInfoPdu'].decode(itemData); |
| 393 | - loger.log(packChannelInfo); | 393 | + loger.log("unPackPdu->",packChannelInfo); |
| 394 | return packChannelInfo; | 394 | return packChannelInfo; |
| 395 | } catch (err) { | 395 | } catch (err) { |
| 396 | - loger.log("unPackPdu error,itemIdx=" + itemIdx + " err:" + err.message); | 396 | + loger.log("unPackPdu error->itemIdx=" + itemIdx + " err:" + err.message); |
| 397 | } | 397 | } |
| 398 | return null; | 398 | return null; |
| 399 | } | 399 | } |
| @@ -47,7 +47,7 @@ class VideoApe extends Ape { | @@ -47,7 +47,7 @@ class VideoApe extends Ape { | ||
| 47 | 47 | ||
| 48 | //获取推流地址 | 48 | //获取推流地址 |
| 49 | getPublishVideoPath(_param) { | 49 | getPublishVideoPath(_param) { |
| 50 | - loger.log('getPublishVideoPath'); | 50 | + loger.log('获取推流地址->'); |
| 51 | if(!this.mcu.connected){ | 51 | if(!this.mcu.connected){ |
| 52 | loger.warn(GlobalConfig.getCurrentStatus()); | 52 | loger.warn(GlobalConfig.getCurrentStatus()); |
| 53 | return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"};; | 53 | return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"};; |
| @@ -57,7 +57,7 @@ class VideoApe extends Ape { | @@ -57,7 +57,7 @@ class VideoApe extends Ape { | ||
| 57 | 57 | ||
| 58 | //获取当前所有频道信息 | 58 | //获取当前所有频道信息 |
| 59 | getAllChannelInfo(_param){ | 59 | getAllChannelInfo(_param){ |
| 60 | - loger.log('getAllChannelInfo'); | 60 | + loger.log('获取当前所有频道信息->'); |
| 61 | return this.mediaModule.getAllMediaChannelInfo(); | 61 | return this.mediaModule.getAllMediaChannelInfo(); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| @@ -70,7 +70,7 @@ class VideoApe extends Ape { | @@ -70,7 +70,7 @@ class VideoApe extends Ape { | ||
| 70 | 70 | ||
| 71 | if (_param == null||_param.publishUrl == null) | 71 | if (_param == null||_param.publishUrl == null) |
| 72 | { | 72 | { |
| 73 | - loger.warn('publishVideo,参数错误', _param); | 73 | + loger.warn('推流->参数错误', _param); |
| 74 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 74 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 75 | return {"code": ApeConsts.RETURN_FAILED, "data": "参数错误"}; | 75 | return {"code": ApeConsts.RETURN_FAILED, "data": "参数错误"}; |
| 76 | } | 76 | } |
| @@ -78,7 +78,7 @@ class VideoApe extends Ape { | @@ -78,7 +78,7 @@ class VideoApe extends Ape { | ||
| 78 | //根据推流的地址获取对应的频道信息 | 78 | //根据推流的地址获取对应的频道信息 |
| 79 | let needPublishChannelInfo=this.mediaModule.getNeedPublishMediaChannel(_param.publishUrl); | 79 | let needPublishChannelInfo=this.mediaModule.getNeedPublishMediaChannel(_param.publishUrl); |
| 80 | if(needPublishChannelInfo==null){ | 80 | if(needPublishChannelInfo==null){ |
| 81 | - loger.warn('publishVideo,推流数据已经无效', _param); | 81 | + loger.warn('推流->推流数据已经无效', _param); |
| 82 | return {"code": ApeConsts.RETURN_FAILED, "data": "推流数据已经无效"}; | 82 | return {"code": ApeConsts.RETURN_FAILED, "data": "推流数据已经无效"}; |
| 83 | } | 83 | } |
| 84 | 84 | ||
| @@ -93,7 +93,7 @@ class VideoApe extends Ape { | @@ -93,7 +93,7 @@ class VideoApe extends Ape { | ||
| 93 | //判断当前是否还有空闲的channle | 93 | //判断当前是否还有空闲的channle |
| 94 | let freeChannel = this.mediaModule.getFreeMediaChannel(); | 94 | let freeChannel = this.mediaModule.getFreeMediaChannel(); |
| 95 | if (freeChannel == 0) { | 95 | if (freeChannel == 0) { |
| 96 | - loger.warn("publishVideo,没有空闲的channel "); | 96 | + loger.warn("推流->不能再打开更多的设备 "); |
| 97 | return {"code": ApeConsts.RETURN_FAILED, "data": "不能再打开更多的设备","mediaChannels":this.mediaModule.mediaChannels}; | 97 | return {"code": ApeConsts.RETURN_FAILED, "data": "不能再打开更多的设备","mediaChannels":this.mediaModule.mediaChannels}; |
| 98 | } | 98 | } |
| 99 | 99 | ||
| @@ -118,7 +118,7 @@ class VideoApe extends Ape { | @@ -118,7 +118,7 @@ class VideoApe extends Ape { | ||
| 118 | 118 | ||
| 119 | //停止推流, | 119 | //停止推流, |
| 120 | stopPublishVideo(_param) { | 120 | stopPublishVideo(_param) { |
| 121 | - loger.log('stopPublishVideo ->_param',_param); | 121 | + loger.log('停止推流->',_param); |
| 122 | if(!this.mcu.connected){ | 122 | if(!this.mcu.connected){ |
| 123 | loger.warn(GlobalConfig.getCurrentStatus()); | 123 | loger.warn(GlobalConfig.getCurrentStatus()); |
| 124 | return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"}; | 124 | return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"}; |
| @@ -321,6 +321,7 @@ class VideoApe extends Ape { | @@ -321,6 +321,7 @@ class VideoApe extends Ape { | ||
| 321 | receiveChannelInfo.mediaId=unpackChannelInfo.channelId; | 321 | receiveChannelInfo.mediaId=unpackChannelInfo.channelId; |
| 322 | receiveChannelInfo.fromNodeId=unpackChannelInfo.fromNodeId; | 322 | receiveChannelInfo.fromNodeId=unpackChannelInfo.fromNodeId; |
| 323 | receiveChannelInfo.userName=unpackChannelInfo.userName||""; | 323 | receiveChannelInfo.userName=unpackChannelInfo.userName||""; |
| 324 | + receiveChannelInfo.userRole=unpackChannelInfo.userRole||ApeConsts.normal; | ||
| 324 | //消息不是自己同步的,需要处理 | 325 | //消息不是自己同步的,需要处理 |
| 325 | if(unpackChannelInfo.status==ApeConsts.CHANNEL_STATUS_OPENING){ | 326 | if(unpackChannelInfo.status==ApeConsts.CHANNEL_STATUS_OPENING){ |
| 326 | //正在推流 | 327 | //正在推流 |
| @@ -382,6 +383,7 @@ class VideoApe extends Ape { | @@ -382,6 +383,7 @@ class VideoApe extends Ape { | ||
| 382 | packPduModel.fromNodeId = GlobalConfig.nodeId; | 383 | packPduModel.fromNodeId = GlobalConfig.nodeId; |
| 383 | packPduModel.userName=GlobalConfig.userName||""; | 384 | packPduModel.userName=GlobalConfig.userName||""; |
| 384 | packPduModel.toNodeId = 0; | 385 | packPduModel.toNodeId = 0; |
| 386 | + packPduModel.userRole=GlobalConfig.userRole||ApeConsts.normal; | ||
| 385 | loger.log(packPduModel); | 387 | loger.log(packPduModel); |
| 386 | return packPduModel; | 388 | return packPduModel; |
| 387 | } | 389 | } |
| @@ -788,6 +788,7 @@ message RCAudioChannelInfoPdu { | @@ -788,6 +788,7 @@ message RCAudioChannelInfoPdu { | ||
| 788 | optional string user_id = 9;//用户的userId | 788 | optional string user_id = 9;//用户的userId |
| 789 | optional string stream_id = 10;//流名称 | 789 | optional string stream_id = 10;//流名称 |
| 790 | optional string user_name = 11;//用户的名字 | 790 | optional string user_name = 11;//用户的名字 |
| 791 | + optional string user_role = 12;//用户的身份 | ||
| 791 | } | 792 | } |
| 792 | 793 | ||
| 793 | message RCVideoChannelInfoPdu { | 794 | message RCVideoChannelInfoPdu { |
| @@ -802,6 +803,7 @@ message RCVideoChannelInfoPdu { | @@ -802,6 +803,7 @@ message RCVideoChannelInfoPdu { | ||
| 802 | optional string user_id = 9;//用户的userId | 803 | optional string user_id = 9;//用户的userId |
| 803 | optional string stream_id = 10;//流名称 | 804 | optional string stream_id = 10;//流名称 |
| 804 | optional string user_name = 11;//用户的名字 | 805 | optional string user_name = 11;//用户的名字 |
| 806 | + optional string user_role = 12;//用户的身份 | ||
| 805 | } | 807 | } |
| 806 | 808 | ||
| 807 | message RCVideoChannelInfoRecordPdu { | 809 | message RCVideoChannelInfoRecordPdu { |
-
请 注册 或 登录 后发表评论