存储部分使用sqlite代替redis-2

This commit is contained in:
panlinlin 2020-12-31 13:22:22 +08:00
parent 2ab8b942bd
commit 15bee5e37d
2 changed files with 5 additions and 3 deletions

View File

@ -51,7 +51,6 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(streamInfo.getDeviceID(), streamInfo.getCahnnelId()); DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(streamInfo.getDeviceID(), streamInfo.getCahnnelId());
if (deviceChannel != null) { if (deviceChannel != null) {
deviceChannel.setStreamId(null); deviceChannel.setStreamId(null);
deviceChannel.setPlay(false);
deviceChannel.setDeviceId(streamInfo.getDeviceID()); deviceChannel.setDeviceId(streamInfo.getDeviceID());
deviceChannelMapper.update(deviceChannel); deviceChannelMapper.update(deviceChannel);
} }
@ -144,7 +143,6 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(streamInfo.getDeviceID(), streamInfo.getCahnnelId()); DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(streamInfo.getDeviceID(), streamInfo.getCahnnelId());
if (deviceChannel != null) { if (deviceChannel != null) {
deviceChannel.setStreamId(null); deviceChannel.setStreamId(null);
deviceChannel.setPlay(false);
deviceChannel.setDeviceId(streamInfo.getDeviceID()); deviceChannel.setDeviceId(streamInfo.getDeviceID());
deviceChannelMapper.update(deviceChannel); deviceChannelMapper.update(deviceChannel);
} }

View File

@ -6,6 +6,7 @@ import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.vmanager.service.IPlayService; import com.genersoft.iot.vmp.vmanager.service.IPlayService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -43,6 +44,9 @@ public class PlaybackController {
@Autowired @Autowired
private IVideoManagerStorager storager; private IVideoManagerStorager storager;
@Autowired
private IRedisCatchStorage redisCatchStorage;
@Autowired @Autowired
private ZLMRESTfulUtils zlmresTfulUtils; private ZLMRESTfulUtils zlmresTfulUtils;
@ -70,7 +74,7 @@ public class PlaybackController {
resultHolder.invokeResult(msg); resultHolder.invokeResult(msg);
}); });
Device device = storager.queryVideoDevice(deviceId); Device device = storager.queryVideoDevice(deviceId);
StreamInfo streamInfo = storager.queryPlaybackByDevice(deviceId, channelId); StreamInfo streamInfo = redisCatchStorage.queryPlaybackByDevice(deviceId, channelId);
if (streamInfo != null) { if (streamInfo != null) {
// 停止之前的回放 // 停止之前的回放
cmder.streamByeCmd(streamInfo.getStreamId()); cmder.streamByeCmd(streamInfo.getStreamId());