存储部分使用sqlite代替redis

This commit is contained in:
panlinlin
2020-12-31 13:15:50 +08:00
parent 00e61d9a80
commit 3d83775468
30 changed files with 933 additions and 956 deletions

View File

@@ -65,7 +65,7 @@ public class ApiDeviceController {
JSONObject result = new JSONObject();
List<Device> devices;
if (start == null || limit ==null) {
devices = storager.queryVideoDeviceList(null);
devices = storager.queryVideoDeviceList();
result.put("DeviceCount", devices.size());
}else {
PageResult<Device> deviceList = storager.queryVideoDeviceList(null, start/limit, limit);

View File

@@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
import com.genersoft.iot.vmp.vmanager.play.PlayController;
import org.slf4j.Logger;
@@ -35,6 +36,9 @@ public class ApiStreamController {
@Autowired
private IVideoManagerStorager storager;
@Autowired
private IRedisCatchStorage redisCatchStorage;
private boolean closeWaitRTPInfo = false;
@@ -158,14 +162,14 @@ public class ApiStreamController {
){
StreamInfo streamInfo = storager.queryPlayByDevice(serial, code);
StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(serial, code);
if (streamInfo == null) {
JSONObject result = new JSONObject();
result.put("error","未找到流信息");
return result;
}
cmder.streamByeCmd(streamInfo.getStreamId());
storager.stopPlay(streamInfo);
redisCatchStorage.stopPlay(streamInfo);
return null;
}