Commit 490c55381f75e4c43c050de593eb1a418d9a83ed
1 parent
e2f9ee8f
修复国标视频点播三种点播方式(自动点播,上级点播,接口点播)并发情况下失败的问题
Showing
3 changed files
with
0 additions
and
47 deletions
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| @@ -124,9 +124,7 @@ public class PlayServiceImpl implements IPlayService { | @@ -124,9 +124,7 @@ public class PlayServiceImpl implements IPlayService { | ||
| 124 | InviteInfo inviteInfo = inviteStreamService.getInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, deviceId, channelId); | 124 | InviteInfo inviteInfo = inviteStreamService.getInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, deviceId, channelId); |
| 125 | 125 | ||
| 126 | if (inviteInfo != null ) { | 126 | if (inviteInfo != null ) { |
| 127 | - System.out.println("inviteInfo 已存在"); | ||
| 128 | if (inviteInfo.getStreamInfo() == null) { | 127 | if (inviteInfo.getStreamInfo() == null) { |
| 129 | - System.out.println("inviteInfo 已存在, StreamInfo 不存在,添加回调等待"); | ||
| 130 | // 点播发起了但是尚未成功, 仅注册回调等待结果即可 | 128 | // 点播发起了但是尚未成功, 仅注册回调等待结果即可 |
| 131 | inviteStreamService.once(InviteSessionType.PLAY, deviceId, channelId, null, callback); | 129 | inviteStreamService.once(InviteSessionType.PLAY, deviceId, channelId, null, callback); |
| 132 | return inviteInfo.getSsrcInfo(); | 130 | return inviteInfo.getSsrcInfo(); |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
| @@ -117,8 +117,6 @@ public class PlayController { | @@ -117,8 +117,6 @@ public class PlayController { | ||
| 117 | resultHolder.put(key, uuid, result); | 117 | resultHolder.put(key, uuid, result); |
| 118 | 118 | ||
| 119 | playService.play(newMediaServerItem, deviceId, channelId, ((code, msg, data) -> { | 119 | playService.play(newMediaServerItem, deviceId, channelId, ((code, msg, data) -> { |
| 120 | - System.out.println("controller收到回调"); | ||
| 121 | - System.out.println(JSON.toJSONString(data)); | ||
| 122 | WVPResult<StreamContent> wvpResult = new WVPResult<>(); | 120 | WVPResult<StreamContent> wvpResult = new WVPResult<>(); |
| 123 | if (code == InviteErrorCode.SUCCESS.getCode()) { | 121 | if (code == InviteErrorCode.SUCCESS.getCode()) { |
| 124 | wvpResult.setCode(ErrorCode.SUCCESS.getCode()); | 122 | wvpResult.setCode(ErrorCode.SUCCESS.getCode()); |
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java
| @@ -120,49 +120,6 @@ public class ApiStreamController { | @@ -120,49 +120,6 @@ public class ApiStreamController { | ||
| 120 | return resultDeferredResult; | 120 | return resultDeferredResult; |
| 121 | } | 121 | } |
| 122 | MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device); | 122 | MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device); |
| 123 | -// playService.play(newMediaServerItem, serial, code, (mediaServerItem, response)->{ | ||
| 124 | -// InviteInfo inviteInfo = inviteStreamService.getInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, serial, code); | ||
| 125 | -// if (inviteInfo != null && inviteInfo.getStreamInfo() != null) { | ||
| 126 | -// JSONObject result = new JSONObject(); | ||
| 127 | -// result.put("StreamID", inviteInfo.getStreamInfo().getStream()); | ||
| 128 | -// result.put("DeviceID", device.getDeviceId()); | ||
| 129 | -// result.put("ChannelID", code); | ||
| 130 | -// result.put("ChannelName", deviceChannel.getName()); | ||
| 131 | -// result.put("ChannelCustomName", ""); | ||
| 132 | -// result.put("FLV", inviteInfo.getStreamInfo().getFlv().getUrl()); | ||
| 133 | -// result.put("WS_FLV", inviteInfo.getStreamInfo().getWs_flv().getUrl()); | ||
| 134 | -// result.put("RTMP", inviteInfo.getStreamInfo().getRtmp().getUrl()); | ||
| 135 | -// result.put("HLS", inviteInfo.getStreamInfo().getHls().getUrl()); | ||
| 136 | -// result.put("RTSP", inviteInfo.getStreamInfo().getRtsp().getUrl()); | ||
| 137 | -// result.put("WEBRTC", inviteInfo.getStreamInfo().getRtc().getUrl()); | ||
| 138 | -// result.put("CDN", ""); | ||
| 139 | -// result.put("SnapURL", ""); | ||
| 140 | -// result.put("Transport", device.getTransport()); | ||
| 141 | -// result.put("StartAt", ""); | ||
| 142 | -// result.put("Duration", ""); | ||
| 143 | -// result.put("SourceVideoCodecName", ""); | ||
| 144 | -// result.put("SourceVideoWidth", ""); | ||
| 145 | -// result.put("SourceVideoHeight", ""); | ||
| 146 | -// result.put("SourceVideoFrameRate", ""); | ||
| 147 | -// result.put("SourceAudioCodecName", ""); | ||
| 148 | -// result.put("SourceAudioSampleRate", ""); | ||
| 149 | -// result.put("AudioEnable", ""); | ||
| 150 | -// result.put("Ondemand", ""); | ||
| 151 | -// result.put("InBytes", ""); | ||
| 152 | -// result.put("InBitRate", ""); | ||
| 153 | -// result.put("OutBytes", ""); | ||
| 154 | -// result.put("NumOutputs", ""); | ||
| 155 | -// result.put("CascadeSize", ""); | ||
| 156 | -// result.put("RelaySize", ""); | ||
| 157 | -// result.put("ChannelPTZType", "0"); | ||
| 158 | -// resultDeferredResult.setResult(result); | ||
| 159 | -// } | ||
| 160 | -// | ||
| 161 | -// }, (eventResult) -> { | ||
| 162 | -// JSONObject result = new JSONObject(); | ||
| 163 | -// result.put("error", "channel[ " + code + " ] " + eventResult.msg); | ||
| 164 | -// resultDeferredResult.setResult(result); | ||
| 165 | -// }, null); | ||
| 166 | 123 | ||
| 167 | 124 | ||
| 168 | playService.play(newMediaServerItem, serial, code, (errorCode, msg, data) -> { | 125 | playService.play(newMediaServerItem, serial, code, (errorCode, msg, data) -> { |