From c807572bdfe41723da86d0e2934cb77d858c60fe Mon Sep 17 00:00:00 2001
From: Lawrence <1934378145@qq.com>
Date: 星期三, 27 一月 2021 16:05:08 +0800
Subject: [PATCH] 修改说明
---
src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java | 26 +++++++-------------------
1 files changed, 7 insertions(+), 19 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
index 8eaaf68..d4b6f44 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
@@ -6,7 +6,6 @@
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.dao.DeviceChannelMapper;
-import com.genersoft.iot.vmp.storager.dao.DeviceMapper;
import com.genersoft.iot.vmp.utils.redis.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -23,9 +22,6 @@
private RedisUtil redis;
@Autowired
- private DeviceMapper deviceMapper;
-
- @Autowired
private DeviceChannelMapper deviceChannelMapper;
@@ -36,7 +32,7 @@
*/
@Override
public boolean startPlay(StreamInfo stream) {
- return redis.set(String.format("%S_%s_%s_%s", VideoManagerConstants.PLAYER_PREFIX, stream.getStreamId(),stream.getDeviceID(), stream.getCahnnelId()),
+ return redis.set(String.format("%S_%s_%s_%s", VideoManagerConstants.PLAYER_PREFIX, stream.getStreamId(),stream.getDeviceID(), stream.getChannelId()),
stream);
}
@@ -48,17 +44,10 @@
@Override
public boolean stopPlay(StreamInfo streamInfo) {
if (streamInfo == null) return false;
- DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(streamInfo.getDeviceID(), streamInfo.getCahnnelId());
- if (deviceChannel != null) {
- deviceChannel.setStreamId(null);
- deviceChannel.setPlay(false);
- deviceChannel.setDeviceId(streamInfo.getDeviceID());
- deviceChannelMapper.update(deviceChannel);
- }
return redis.del(String.format("%S_%s_%s_%s", VideoManagerConstants.PLAYER_PREFIX,
streamInfo.getStreamId(),
streamInfo.getDeviceID(),
- streamInfo.getCahnnelId()));
+ streamInfo.getChannelId()));
}
/**
@@ -71,7 +60,7 @@
VideoManagerConstants.PLAYER_PREFIX,
streamInfo.getStreamId(),
streamInfo.getDeviceID(),
- streamInfo.getCahnnelId()));
+ streamInfo.getChannelId()));
}
@Override
public StreamInfo queryPlayByStreamId(String steamId) {
@@ -125,7 +114,7 @@
for (int i = 0; i < players.size(); i++) {
String key = (String) players.get(i);
StreamInfo streamInfo = (StreamInfo)redis.get(key);
- streamInfos.put(streamInfo.getDeviceID() + "_" + streamInfo.getCahnnelId(), streamInfo);
+ streamInfos.put(streamInfo.getDeviceID() + "_" + streamInfo.getChannelId(), streamInfo);
}
return streamInfos;
}
@@ -133,7 +122,7 @@
@Override
public boolean startPlayback(StreamInfo stream) {
- return redis.set(String.format("%S_%s_%s_%s", VideoManagerConstants.PLAY_BLACK_PREFIX, stream.getStreamId(),stream.getDeviceID(), stream.getCahnnelId()),
+ return redis.set(String.format("%S_%s_%s_%s", VideoManagerConstants.PLAY_BLACK_PREFIX, stream.getStreamId(),stream.getDeviceID(), stream.getChannelId()),
stream);
}
@@ -141,17 +130,16 @@
@Override
public boolean stopPlayback(StreamInfo streamInfo) {
if (streamInfo == null) return false;
- DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(streamInfo.getDeviceID(), streamInfo.getCahnnelId());
+ DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(streamInfo.getDeviceID(), streamInfo.getChannelId());
if (deviceChannel != null) {
deviceChannel.setStreamId(null);
- deviceChannel.setPlay(false);
deviceChannel.setDeviceId(streamInfo.getDeviceID());
deviceChannelMapper.update(deviceChannel);
}
return redis.del(String.format("%S_%s_%s_%s", VideoManagerConstants.PLAY_BLACK_PREFIX,
streamInfo.getStreamId(),
streamInfo.getDeviceID(),
- streamInfo.getCahnnelId()));
+ streamInfo.getChannelId()));
}
@Override
--
Gitblit v1.8.0