Commit 403f1e16a39b9df292d50108197f25375d0fc471

Authored by 648540858
1 parent 8c4922cb

合并优化ssrc存储结构

src/main/java/com/genersoft/iot/vmp/conf/redis/RedisConfig.java deleted 100644 → 0
1   -package com.genersoft.iot.vmp.conf.redis;
2   -
3   -
4   -import com.alibaba.fastjson2.support.spring.data.redis.GenericFastJsonRedisSerializer;
5   -import org.springframework.context.annotation.Bean;
6   -import org.springframework.context.annotation.Configuration;
7   -import org.springframework.core.annotation.Order;
8   -import org.springframework.data.redis.connection.RedisConnectionFactory;
9   -import org.springframework.data.redis.core.RedisTemplate;
10   -import org.springframework.data.redis.serializer.StringRedisSerializer;
11   -
12   -import org.springframework.data.redis.listener.PatternTopic;
13   -import org.springframework.data.redis.listener.RedisMessageListenerContainer;
14   -
15   -
16   -/**
17   - * Redis中间件配置类,使用spring-data-redis集成,自动从application.yml中加载redis配置
18   - * swwheihei
19   - * 2019年5月30日 上午10:58:25
20   - *
21   - */
22   -@Configuration
23   -@Order(value=1)
24   -public class RedisConfig {
25   -
26   -
27   - @Bean
28   - public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
29   - RedisTemplate<Object, Object> redisTemplate = new RedisTemplate<>();
30   - // 使用fastJson序列化
31   - GenericFastJsonRedisSerializer fastJsonRedisSerializer = new GenericFastJsonRedisSerializer();
32   - // value值的序列化采用fastJsonRedisSerializer
33   - redisTemplate.setValueSerializer(fastJsonRedisSerializer);
34   - redisTemplate.setHashValueSerializer(fastJsonRedisSerializer);
35   -
36   - // key的序列化采用StringRedisSerializer
37   - redisTemplate.setKeySerializer(new StringRedisSerializer());
38   - redisTemplate.setHashKeySerializer(new StringRedisSerializer());
39   - redisTemplate.setConnectionFactory(redisConnectionFactory);
40   - return redisTemplate;
41   - }
42   -}
src/main/java/com/genersoft/iot/vmp/media/zlm/dto/MediaServerItem.java
1 1 package com.genersoft.iot.vmp.media.zlm.dto;
2 2  
3 3  
4   -import com.genersoft.iot.vmp.gb28181.session.SSRCFactory;
5 4 import com.genersoft.iot.vmp.media.zlm.ZLMServerConfig;
6 5 import io.swagger.v3.oas.annotations.media.Schema;
7 6 import org.springframework.util.ObjectUtils;
8 7  
9   -import java.util.HashMap;
10   -
11 8 @Schema(description = "流媒体服务信息")
12 9 public class MediaServerItem{
13 10  
... ... @@ -80,20 +77,10 @@ public class MediaServerItem{
80 77 @Schema(description = "是否是默认ZLM")
81 78 private boolean defaultServer;
82 79  
83   -// @Schema(description = "SSRC信息")
84   -// private SsrcConfig ssrcConfig;
85   -
86 80 @Schema(description = "当前使用到的端口")
87 81 private int currentPort;
88 82  
89 83  
90   - /**
91   - * 每一台ZLM都有一套独立的SSRC列表
92   - * 在ApplicationCheckRunner里对mediaServerSsrcMap进行初始化
93   - */
94   - @Schema(description = "ID")
95   - private HashMap<String, SSRCFactory> mediaServerSsrcMap;
96   -
97 84 public MediaServerItem() {
98 85 }
99 86  
... ... @@ -279,14 +266,6 @@ public class MediaServerItem{
279 266 this.updateTime = updateTime;
280 267 }
281 268  
282   - public HashMap<String, SSRCFactory> getMediaServerSsrcMap() {
283   - return mediaServerSsrcMap;
284   - }
285   -
286   - public void setMediaServerSsrcMap(HashMap<String, SSRCFactory> mediaServerSsrcMap) {
287   - this.mediaServerSsrcMap = mediaServerSsrcMap;
288   - }
289   -
290 269 public int getCurrentPort() {
291 270 return currentPort;
292 271 }
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
... ... @@ -10,8 +10,6 @@ import com.genersoft.iot.vmp.conf.UserSetting;
10 10 import com.genersoft.iot.vmp.conf.exception.ControllerException;
11 11 import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
12 12 import com.genersoft.iot.vmp.gb28181.session.SSRCFactory;
13   -import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
14   -import com.genersoft.iot.vmp.gb28181.session.SsrcConfig;
15 13 import com.genersoft.iot.vmp.media.zlm.AssistRESTfulUtils;
16 14 import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
17 15 import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory;
... ...