Commit a25f7e4f99401f842d9a0129d35011fa11930e9e
1 parent
3d837754
存储部分使用sqlite代替redis-2
Showing
2 changed files
with
5 additions
and
3 deletions
src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
| @@ -51,7 +51,6 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { | @@ -51,7 +51,6 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { | ||
| 51 | DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(streamInfo.getDeviceID(), streamInfo.getCahnnelId()); | 51 | DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(streamInfo.getDeviceID(), streamInfo.getCahnnelId()); |
| 52 | if (deviceChannel != null) { | 52 | if (deviceChannel != null) { |
| 53 | deviceChannel.setStreamId(null); | 53 | deviceChannel.setStreamId(null); |
| 54 | - deviceChannel.setPlay(false); | ||
| 55 | deviceChannel.setDeviceId(streamInfo.getDeviceID()); | 54 | deviceChannel.setDeviceId(streamInfo.getDeviceID()); |
| 56 | deviceChannelMapper.update(deviceChannel); | 55 | deviceChannelMapper.update(deviceChannel); |
| 57 | } | 56 | } |
| @@ -144,7 +143,6 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { | @@ -144,7 +143,6 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { | ||
| 144 | DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(streamInfo.getDeviceID(), streamInfo.getCahnnelId()); | 143 | DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(streamInfo.getDeviceID(), streamInfo.getCahnnelId()); |
| 145 | if (deviceChannel != null) { | 144 | if (deviceChannel != null) { |
| 146 | deviceChannel.setStreamId(null); | 145 | deviceChannel.setStreamId(null); |
| 147 | - deviceChannel.setPlay(false); | ||
| 148 | deviceChannel.setDeviceId(streamInfo.getDeviceID()); | 146 | deviceChannel.setDeviceId(streamInfo.getDeviceID()); |
| 149 | deviceChannelMapper.update(deviceChannel); | 147 | deviceChannelMapper.update(deviceChannel); |
| 150 | } | 148 | } |
src/main/java/com/genersoft/iot/vmp/vmanager/playback/PlaybackController.java
| @@ -6,6 +6,7 @@ import com.genersoft.iot.vmp.common.StreamInfo; | @@ -6,6 +6,7 @@ import com.genersoft.iot.vmp.common.StreamInfo; | ||
| 6 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | 6 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| 7 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; | 7 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| 8 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; | 8 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| 9 | +import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | ||
| 9 | import com.genersoft.iot.vmp.vmanager.service.IPlayService; | 10 | import com.genersoft.iot.vmp.vmanager.service.IPlayService; |
| 10 | import org.slf4j.Logger; | 11 | import org.slf4j.Logger; |
| 11 | import org.slf4j.LoggerFactory; | 12 | import org.slf4j.LoggerFactory; |
| @@ -44,6 +45,9 @@ public class PlaybackController { | @@ -44,6 +45,9 @@ public class PlaybackController { | ||
| 44 | private IVideoManagerStorager storager; | 45 | private IVideoManagerStorager storager; |
| 45 | 46 | ||
| 46 | @Autowired | 47 | @Autowired |
| 48 | + private IRedisCatchStorage redisCatchStorage; | ||
| 49 | + | ||
| 50 | + @Autowired | ||
| 47 | private ZLMRESTfulUtils zlmresTfulUtils; | 51 | private ZLMRESTfulUtils zlmresTfulUtils; |
| 48 | 52 | ||
| 49 | @Autowired | 53 | @Autowired |
| @@ -70,7 +74,7 @@ public class PlaybackController { | @@ -70,7 +74,7 @@ public class PlaybackController { | ||
| 70 | resultHolder.invokeResult(msg); | 74 | resultHolder.invokeResult(msg); |
| 71 | }); | 75 | }); |
| 72 | Device device = storager.queryVideoDevice(deviceId); | 76 | Device device = storager.queryVideoDevice(deviceId); |
| 73 | - StreamInfo streamInfo = storager.queryPlaybackByDevice(deviceId, channelId); | 77 | + StreamInfo streamInfo = redisCatchStorage.queryPlaybackByDevice(deviceId, channelId); |
| 74 | if (streamInfo != null) { | 78 | if (streamInfo != null) { |
| 75 | // 停止之前的回放 | 79 | // 停止之前的回放 |
| 76 | cmder.streamByeCmd(streamInfo.getStreamId()); | 80 | cmder.streamByeCmd(streamInfo.getStreamId()); |