| | |
| | | @Override |
| | | public boolean startDownload(StreamInfo stream, String callId) { |
| | | boolean result; |
| | | String key=String.format("%S_%s_%s_%s_%s_%s_%s", VideoManagerConstants.DOWNLOAD_PREFIX, |
| | | userSetting.getServerId(), stream.getMediaServerId(), stream.getDeviceID(), stream.getChannelId(), stream.getStream(), callId); |
| | | if (stream.getProgress() == 1) { |
| | | result = RedisUtil.set(String.format("%S_%s_%s_%s_%s_%s_%s", VideoManagerConstants.DOWNLOAD_PREFIX, |
| | | userSetting.getServerId(), stream.getMediaServerId(), stream.getDeviceID(), stream.getChannelId(), stream.getStream(), callId), stream); |
| | | logger.debug("添加下载缓存==已完成下载=》{}",key); |
| | | result = RedisUtil.set(key, stream); |
| | | }else { |
| | | result = RedisUtil.set(String.format("%S_%s_%s_%s_%s_%s_%s", VideoManagerConstants.DOWNLOAD_PREFIX, |
| | | userSetting.getServerId(), stream.getMediaServerId(), stream.getDeviceID(), stream.getChannelId(), stream.getStream(), callId), stream, 60*60); |
| | | logger.debug("添加下载缓存==未完成下载=》{}",key); |
| | | result = RedisUtil.set(key, stream, 60*60); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | stream, |
| | | callId |
| | | ); |
| | | List<Object> streamInfoScan = RedisUtil.scan(key); |
| | | List<Object> streamInfoScan = RedisUtil.scan2(key); |
| | | if (streamInfoScan.size() > 0) { |
| | | return (StreamInfo) RedisUtil.get((String) streamInfoScan.get(0)); |
| | | }else { |