优化流信息存储的兼容性
This commit is contained in:
@@ -213,7 +213,7 @@ public class Device {
|
||||
@Schema(description = "所属服务Id")
|
||||
private String serverId;
|
||||
|
||||
public boolean isWgs84() {
|
||||
public boolean checkWgs84() {
|
||||
return geoCoordSys.equalsIgnoreCase("WGS84");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
|
||||
catalogChannelEvent.getChannel().setDataDeviceId(device.getId());
|
||||
if (catalogChannelEvent.getChannel().getLongitude() > 0
|
||||
&& catalogChannelEvent.getChannel().getLatitude() > 0) {
|
||||
if (device.isWgs84()) {
|
||||
if (device.checkWgs84()) {
|
||||
catalogChannelEvent.getChannel().setGbLongitude(catalogChannelEvent.getChannel().getLongitude());
|
||||
catalogChannelEvent.getChannel().setGbLatitude(catalogChannelEvent.getChannel().getLatitude());
|
||||
}else {
|
||||
|
||||
@@ -106,7 +106,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||
if (streamAuthorityInfo != null) {
|
||||
mediaInfo.setCallId(streamAuthorityInfo.getCallId());
|
||||
}
|
||||
redisTemplate.opsForValue().set(key, mediaInfo);
|
||||
redisTemplate.opsForValue().set(key, JSON.toJSONString(mediaInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -130,7 +130,8 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||
String key = VideoManagerConstants.WVP_SERVER_STREAM_PREFIX + userSetting.getServerId() + "_" + type.toUpperCase() + "_*_*_" + mediaServerId;
|
||||
List<Object> streams = RedisUtil.scan(redisTemplate, key);
|
||||
for (Object stream : streams) {
|
||||
MediaInfo mediaInfo = (MediaInfo)redisTemplate.opsForValue().get(stream);
|
||||
String mediaInfoJson = (String)redisTemplate.opsForValue().get(stream);
|
||||
MediaInfo mediaInfo = JSON.parseObject(mediaInfoJson, MediaInfo.class);
|
||||
result.add(mediaInfo);
|
||||
}
|
||||
return result;
|
||||
@@ -251,7 +252,8 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||
List<Object> keys = RedisUtil.scan(redisTemplate, scanKey);
|
||||
if (keys.size() > 0) {
|
||||
String key = (String) keys.get(0);
|
||||
result = JsonUtil.redisJsonToObject(redisTemplate, key, MediaInfo.class);
|
||||
String mediaInfoJson = (String)redisTemplate.opsForValue().get(key);
|
||||
result = JSON.parseObject(mediaInfoJson, MediaInfo.class);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -265,7 +267,8 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||
List<Object> keys = RedisUtil.scan(redisTemplate, scanKey);
|
||||
if (keys.size() > 0) {
|
||||
String key = (String) keys.get(0);
|
||||
result = JsonUtil.redisJsonToObject(redisTemplate, key, MediaInfo.class);
|
||||
String mediaInfoJson = (String)redisTemplate.opsForValue().get(key);
|
||||
result = JSON.parseObject(mediaInfoJson, MediaInfo.class);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -335,6 +335,9 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||
}
|
||||
if (!mediaInfoList.isEmpty()) {
|
||||
for (MediaInfo mediaInfo : mediaInfoList) {
|
||||
if (mediaInfo == null) {
|
||||
continue;
|
||||
}
|
||||
streamInfoPushItemMap.put(mediaInfo.getApp() + mediaInfo.getStream(), mediaInfo);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user