修复国标视频点播三种点播方式(自动点播,上级点播,接口点播)并发情况下失败的问题

This commit is contained in:
648540858 2023-05-06 17:59:12 +08:00
parent a4bf9ffe7a
commit 3d51317f62
3 changed files with 0 additions and 47 deletions

View File

@ -124,9 +124,7 @@ public class PlayServiceImpl implements IPlayService {
InviteInfo inviteInfo = inviteStreamService.getInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, deviceId, channelId); InviteInfo inviteInfo = inviteStreamService.getInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, deviceId, channelId);
if (inviteInfo != null ) { if (inviteInfo != null ) {
System.out.println("inviteInfo 已存在");
if (inviteInfo.getStreamInfo() == null) { if (inviteInfo.getStreamInfo() == null) {
System.out.println("inviteInfo 已存在, StreamInfo 不存在,添加回调等待");
// 点播发起了但是尚未成功, 仅注册回调等待结果即可 // 点播发起了但是尚未成功, 仅注册回调等待结果即可
inviteStreamService.once(InviteSessionType.PLAY, deviceId, channelId, null, callback); inviteStreamService.once(InviteSessionType.PLAY, deviceId, channelId, null, callback);
return inviteInfo.getSsrcInfo(); return inviteInfo.getSsrcInfo();

View File

@ -117,8 +117,6 @@ public class PlayController {
resultHolder.put(key, uuid, result); resultHolder.put(key, uuid, result);
playService.play(newMediaServerItem, deviceId, channelId, ((code, msg, data) -> { playService.play(newMediaServerItem, deviceId, channelId, ((code, msg, data) -> {
System.out.println("controller收到回调");
System.out.println(JSON.toJSONString(data));
WVPResult<StreamContent> wvpResult = new WVPResult<>(); WVPResult<StreamContent> wvpResult = new WVPResult<>();
if (code == InviteErrorCode.SUCCESS.getCode()) { if (code == InviteErrorCode.SUCCESS.getCode()) {
wvpResult.setCode(ErrorCode.SUCCESS.getCode()); wvpResult.setCode(ErrorCode.SUCCESS.getCode());

View File

@ -120,49 +120,6 @@ public class ApiStreamController {
return resultDeferredResult; return resultDeferredResult;
} }
MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device); MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device);
// playService.play(newMediaServerItem, serial, code, (mediaServerItem, response)->{
// InviteInfo inviteInfo = inviteStreamService.getInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, serial, code);
// if (inviteInfo != null && inviteInfo.getStreamInfo() != null) {
// JSONObject result = new JSONObject();
// result.put("StreamID", inviteInfo.getStreamInfo().getStream());
// result.put("DeviceID", device.getDeviceId());
// result.put("ChannelID", code);
// result.put("ChannelName", deviceChannel.getName());
// result.put("ChannelCustomName", "");
// result.put("FLV", inviteInfo.getStreamInfo().getFlv().getUrl());
// result.put("WS_FLV", inviteInfo.getStreamInfo().getWs_flv().getUrl());
// result.put("RTMP", inviteInfo.getStreamInfo().getRtmp().getUrl());
// result.put("HLS", inviteInfo.getStreamInfo().getHls().getUrl());
// result.put("RTSP", inviteInfo.getStreamInfo().getRtsp().getUrl());
// result.put("WEBRTC", inviteInfo.getStreamInfo().getRtc().getUrl());
// result.put("CDN", "");
// result.put("SnapURL", "");
// result.put("Transport", device.getTransport());
// result.put("StartAt", "");
// result.put("Duration", "");
// result.put("SourceVideoCodecName", "");
// result.put("SourceVideoWidth", "");
// result.put("SourceVideoHeight", "");
// result.put("SourceVideoFrameRate", "");
// result.put("SourceAudioCodecName", "");
// result.put("SourceAudioSampleRate", "");
// result.put("AudioEnable", "");
// result.put("Ondemand", "");
// result.put("InBytes", "");
// result.put("InBitRate", "");
// result.put("OutBytes", "");
// result.put("NumOutputs", "");
// result.put("CascadeSize", "");
// result.put("RelaySize", "");
// result.put("ChannelPTZType", "0");
// resultDeferredResult.setResult(result);
// }
//
// }, (eventResult) -> {
// JSONObject result = new JSONObject();
// result.put("error", "channel[ " + code + " ] " + eventResult.msg);
// resultDeferredResult.setResult(result);
// }, null);
playService.play(newMediaServerItem, serial, code, (errorCode, msg, data) -> { playService.play(newMediaServerItem, serial, code, (errorCode, msg, data) -> {