Переглянути джерело

Merge remote-tracking branch 'origin/dev' into dev

liubo 2 роки тому
батько
коміт
2429008724
58 змінених файлів з 139 додано та 818 видалено
  1. 1 1
      zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/AlarmRecordController.java
  2. 3 3
      zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpBottleStorageOutMapper.xml
  3. 2 2
      zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpFlowDetailMapper.xml
  4. 4 0
      zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpQualificationApplyMapper.xml
  5. 4 0
      zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpUsegasApplyMapper.xml
  6. 0 172
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/common/ApiSaveConstant.java
  7. 2 0
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/common/VideoManagerConstants.java
  8. 0 91
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/conf/RedisConfig.java
  9. 0 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/conf/SipPlatformRunner.java
  10. 0 117
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/conf/Swagger3Config.java
  11. 0 24
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/conf/WVPTimerTask.java
  12. 0 4
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/SipLayer.java
  13. 0 64
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/auth/DigestServerAuthenticationHelper.java
  14. 66 0
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/bean/MediaStream.java
  15. 0 15
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/bean/PlatformRegister.java
  16. 0 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/bean/WvpSipDate.java
  17. 1 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/event/alarm/AlarmEvent.java
  18. 0 2
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/event/offline/KeepaliveTimeoutListenerForPlatform.java
  19. 0 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/event/offline/OfflineEvent.java
  20. 0 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/event/online/OnlineEvent.java
  21. 0 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/event/platformNotRegister/PlatformNotRegisterEvent.java
  22. 2 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/session/VideoStreamSessionManager.java
  23. 0 2
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/SIPProcessorFactory.java
  24. 6 7
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/cmd/ISIPCommander.java
  25. 13 7
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
  26. 0 1
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/ISIPRequestProcessor.java
  27. 2 2
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/SIPRequestAbstractProcessor.java
  28. 1 13
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/AckRequestProcessor.java
  29. 1 1
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/ByeRequestProcessor.java
  30. 1 1
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/CancelRequestProcessor.java
  31. 2 7
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java
  32. 1 35
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java
  33. 1 8
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/NotifyRequestProcessor.java
  34. 1 1
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/OtherRequestProcessor.java
  35. 1 1
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/RegisterRequestProcessor.java
  36. 1 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/SubscribeRequestProcessor.java
  37. 1 1
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/media/zlm/ZLMHttpHookListener.java
  38. 0 2
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/media/zlm/ZLMHttpHookSubscribe.java
  39. 0 29
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/media/zlm/ZLMMediaListManager.java
  40. 0 4
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/media/zlm/ZLMRTPServerFactory.java
  41. 0 46
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/media/zlm/ZLMRunner.java
  42. 2 1
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/service/IPlayService.java
  43. 0 4
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/service/impl/MediaServerServiceImpl.java
  44. 0 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/service/impl/MediaServiceImpl.java
  45. 3 4
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/service/impl/PlayServiceImpl.java
  46. 0 1
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/service/impl/StreamProxyServiceImpl.java
  47. 0 2
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/service/impl/UserServiceImpl.java
  48. 1 1
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/storager/impl/RedisCatchStorageImpl.java
  49. 0 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/utils/JarFileUtils.java
  50. 0 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/vmanager/gb28181/media/MediaController.java
  51. 6 6
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/vmanager/gb28181/play/PlayController.java
  52. 2 3
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/vmanager/gb28181/playback/DownloadController.java
  53. 2 8
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/vmanager/gb28181/playback/PlaybackController.java
  54. 0 51
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/vmanager/record/RecordController.java
  55. 0 22
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/web/ApiController.java
  56. 0 9
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/web/ApiDeviceController.java
  57. 2 6
      zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/web/ApiStreamController.java
  58. 4 4
      zd-modules/zd-base/src/main/java/com/zd/base/files/bigupload/controller/UploadController.java

+ 1 - 1
zd-modules/zd-airbottle/src/main/java/com/zd/airbottle/controller/AlarmRecordController.java

@@ -84,7 +84,7 @@ public class AlarmRecordController extends BaseController<AlarmRecord> {
         List<AlarmRecordVo> recordVos = TransferUtils.transferList(list, AlarmRecordVo.class);
         List<AlarmRecordVo> recordVos = TransferUtils.transferList(list, AlarmRecordVo.class);
         if (!recordVos.isEmpty()) {
         if (!recordVos.isEmpty()) {
             alarmRecordService.getRecordInfo(recordVos);
             alarmRecordService.getRecordInfo(recordVos);
-            recordVos.forEach(r -> r.setCurrentPressureValue(StringUtils.convertDoubleToString(r.getCurrentPressure()) + "MPa"));
+            recordVos.forEach(r -> r.setCurrentPressureValue(r.getCurrentPressure()!=null?r.getCurrentPressure()+ "MPa":""));
         }
         }
 
 
         util.exportExcel(response, recordVos, "报警记录数据");
         util.exportExcel(response, recordVos, "报警记录数据");

+ 3 - 3
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpBottleStorageOutMapper.xml

@@ -33,9 +33,7 @@
                t.storage_id, t.car_id, t.car_number, t.transport_id, t.transport_name,
                t.storage_id, t.car_id, t.car_number, t.transport_id, t.transport_name,
                t.dispose_userid, t.dispose_username, t.dispose_time, t.complete_time,
                t.dispose_userid, t.dispose_username, t.dispose_time, t.complete_time,
                t.complete_userid, t.complete_username, t.pressure,t.out_status,
                t.complete_userid, t.complete_username, t.pressure,t.out_status,
-               (select l.room room from lab_subject s,lab_subject_layout l where s.layout_id =l.id and s.id=
-               ( select location_id from qp_bottle_storage bs , qp_task ta where bs.id=t.storage_id
-                                                                            and bs.task_id = ta.id) ) room
+               (select fl.room_num from lab_build_floor_layout fl where fl.sub_id=ta.location_id) room
         from  qp_bottle_storage_out  t
         from  qp_bottle_storage_out  t
             LEFT JOIN qp_bottle_storage bs on t.storage_id=bs.id
             LEFT JOIN qp_bottle_storage bs on t.storage_id=bs.id
             LEFT JOIN qp_task ta on bs.task_id=ta.id
             LEFT JOIN qp_task ta on bs.task_id=ta.id
@@ -44,6 +42,7 @@
     </sql>
     </sql>
     <select id="selectQpBottleStorageOutList" parameterType="com.zd.airbottle.domain.vo.QpBottleStorageOutVO" resultMap="QpBottleStorageOutResult">
     <select id="selectQpBottleStorageOutList" parameterType="com.zd.airbottle.domain.vo.QpBottleStorageOutVO" resultMap="QpBottleStorageOutResult">
         <include refid="selectQpBottleStorageOutListVo"/>
         <include refid="selectQpBottleStorageOutListVo"/>
+        <where>
             <if test="searchValue != null  and searchValue != ''">
             <if test="searchValue != null  and searchValue != ''">
                 and ( t.apply_user_name like concat('%', #{searchValue}, '%')
                 and ( t.apply_user_name like concat('%', #{searchValue}, '%')
                 or t.phone like concat('%', #{searchValue}, '%')
                 or t.phone like concat('%', #{searchValue}, '%')
@@ -74,6 +73,7 @@
                 #{id}
                 #{id}
             </foreach>
             </foreach>
          </if>
          </if>
+        </where>
         <!-- 数据范围过滤 -->
         <!-- 数据范围过滤 -->
         ${params.dataScope}
         ${params.dataScope}
         order by t.create_time desc
         order by t.create_time desc

+ 2 - 2
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpFlowDetailMapper.xml

@@ -69,8 +69,8 @@
             <if test="flowType != null ">and t.flow_type = #{flowType}</if>
             <if test="flowType != null ">and t.flow_type = #{flowType}</if>
             <if test="userName != null  and userName != ''">and t.user_name like concat('%', #{userName}, '%')</if>
             <if test="userName != null  and userName != ''">and t.user_name like concat('%', #{userName}, '%')</if>
             <if test="userTelephone != null  and userTelephone != ''">and t.user_telephone = #{userTelephone}</if>
             <if test="userTelephone != null  and userTelephone != ''">and t.user_telephone = #{userTelephone}</if>
-            <if test="deptId != null ">and ( dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId}
-                ,ancestors )) or dept_id = #{deptId} )
+            <if test="deptId != null ">and ( t.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE find_in_set(#{deptId}
+                ,ancestors )) or t.dept_id = #{deptId} )
             </if>
             </if>
             <!-- 数据范围过滤 -->
             <!-- 数据范围过滤 -->
             ${params.dataScope}
             ${params.dataScope}

+ 4 - 0
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpQualificationApplyMapper.xml

@@ -98,6 +98,10 @@
             <if test="deptId != null "> and t.dept_id = #{deptId}</if>
             <if test="deptId != null "> and t.dept_id = #{deptId}</if>
             <if test="deptName != null  and deptName != ''"> and t.dept_name like concat('%', #{deptName}, '%')</if>
             <if test="deptName != null  and deptName != ''"> and t.dept_name like concat('%', #{deptName}, '%')</if>
             <if test="phone != null  and phone != ''"> and t.phone = #{phone}</if>
             <if test="phone != null  and phone != ''"> and t.phone = #{phone}</if>
+            <if test="startTime != null  and endTime != null">
+                and (t.start_time &lt;= #{startTime}  and t.end_time &gt;= #{startTime})
+                or (t.start_time &lt;= #{endTime}  and t.end_time &gt;= #{endTime})
+            </if>
             <if test="startTime != null "> and t.start_time &gt;= #{startTime}</if>
             <if test="startTime != null "> and t.start_time &gt;= #{startTime}</if>
             <if test="endTime != null "> and t.end_time &lt;= #{endTime}</if>
             <if test="endTime != null "> and t.end_time &lt;= #{endTime}</if>
             <if test="gasUse != null  and gasUse != ''"> and t.gas_use = #{gasUse}</if>
             <if test="gasUse != null  and gasUse != ''"> and t.gas_use = #{gasUse}</if>

+ 4 - 0
zd-modules/zd-airbottle/src/main/resources/mapper/airbottle/QpUsegasApplyMapper.xml

@@ -70,6 +70,10 @@
             <if test="deptId != null "> and t.dept_id = #{deptId}</if>
             <if test="deptId != null "> and t.dept_id = #{deptId}</if>
             <if test="deptName != null  and deptName != ''"> and t.dept_name like concat('%', #{deptName}, '%')</if>
             <if test="deptName != null  and deptName != ''"> and t.dept_name like concat('%', #{deptName}, '%')</if>
             <if test="phone != null  and phone != ''"> and t.phone = #{phone}</if>
             <if test="phone != null  and phone != ''"> and t.phone = #{phone}</if>
+            <if test="startTime != null  and endTime != null ">
+                and (t.start_time &lt;= #{startTime}  and t.end_time &gt;= #{startTime})
+                or (t.start_time &lt;= #{endTime}  and t.end_time &gt;= #{endTime})
+            </if>
             <if test="startTime != null "> and t.start_time &gt;= #{startTime}</if>
             <if test="startTime != null "> and t.start_time &gt;= #{startTime}</if>
             <if test="endTime != null "> and t.end_time &lt;= #{endTime}</if>
             <if test="endTime != null "> and t.end_time &lt;= #{endTime}</if>
             <if test="gasUse != null  and gasUse != ''"> and t.gas_use = #{gasUse}</if>
             <if test="gasUse != null  and gasUse != ''"> and t.gas_use = #{gasUse}</if>

+ 0 - 172
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/common/ApiSaveConstant.java

@@ -1,172 +0,0 @@
-package com.zd.alg.iot.vmp.common;
-
-public class ApiSaveConstant {
-
-    public static String getVal(String key) {
-        String[] keyItemArray = key.split("/");
-        if (keyItemArray.length <= 1 || !"api".equals(keyItemArray[1])) {
-            return null;
-        }
-        if (keyItemArray.length >= 4) {
-            switch (keyItemArray[2]) {
-                case "alarm":
-                    if ("delete".equals(keyItemArray[3])) {
-                        return "删除报警";
-                    }
-                    break;
-                case "device":
-                    switch (keyItemArray[3]) {
-                        case "config":
-                            if (keyItemArray.length >= 5 && "basicParam".equals(keyItemArray[4])) {
-                                return "[设备配置] 基本配置设置命令";
-                            }
-                            break;
-                        case "control":
-                            switch (keyItemArray[4]) {
-                                case "teleboot":
-                                    return "[设备控制] 远程启动";
-                                case "record":
-                                    return "[设备控制] 录像控制";
-                                case "guard":
-                                    return "[设备控制] 布防/撤防命令";
-                                case "reset_alarm":
-                                    return "[设备控制] 报警复位";
-                                case "i_frame":
-                                    return "[设备控制] 强制关键帧";
-                                case "home_position":
-                                    return "[设备控制] 看守位控制";
-                            }
-                            break;
-                            case "query":
-                                if (keyItemArray.length <= 5) return null;
-                                switch (keyItemArray[4]) {
-                                    case "devices":
-                                        if (keyItemArray.length < 7) return null;
-                                        switch (keyItemArray[6]) {
-                                            case "sync":
-                                                return "[设备查询] 同步设备通道";
-                                            case "delete":
-                                                return "[设备查询] 移除设备";
-                                        }
-                                        break;
-                                    case "channel":
-                                        return "[设备查询] 更新通道信息";
-                                    case "transport":
-                                        return "[设备查询] 修改数据流传输模式";
-                                }
-                                break;
-                            }
-                case "gbStream":
-                    switch (keyItemArray[3]) {
-                        case "del":
-                            return "移除通道与国标的关联";
-                        case "add":
-                            return "添加通道与国标的关联";
-                    }
-                    break;
-                case "media":
-                    break;
-                case "position":
-                    if ("subscribe".equals(keyItemArray[3])) {
-                        return "订阅位置信息";
-                    }
-                    break;
-                case "platform":
-                    switch (keyItemArray[3]) {
-                        case "save":
-                            return "添加上级平台";
-                        case "delete":
-                            return "移除上级平台";
-                        case "update_channel_for_gb":
-                            return "向上级平台添加国标通道";
-                        case "del_channel_for_gb":
-                            return "从上级平台移除国标通道";
-                    }
-                    break;
-                case "platform_gb_stream":
-                    break;
-                case "play":
-                    switch (keyItemArray[3]) {
-                        case "start":
-                            return "开始点播";
-                        case "stop":
-                            return "停止点播";
-                        case "convert":
-                            return "转码";
-                        case "convertStop":
-                            return "结束转码";
-                        case "broadcast":
-                            return "语音广播";
-                    }
-                    break;
-                case "download":
-                    switch (keyItemArray[3]) {
-                        case "start":
-                            return "开始历史媒体下载";
-                        case "stop":
-                            return "停止历史媒体下载";
-                    }
-                    break;
-                case "playback":
-                    switch (keyItemArray[3]) {
-                        case "start":
-                            return "开始视频回放";
-                        case "stop":
-                            return "停止视频回放";
-                    }
-                    break;
-                case "ptz":
-                    switch (keyItemArray[3]) {
-                        case "control":
-                            return "云台控制";
-                        case "front_end_command":
-                            return "通用前端控制命令";
-                    }
-                    break;
-                case "gb_record":
-                    break;
-                case "onvif":
-                    break;
-                case "server":
-                    if ("restart".equals(keyItemArray[3])) {
-                        return "重启流媒体服务";
-                    }
-                    break;
-                case "proxy":
-                    switch (keyItemArray[3]) {
-                        case "save":
-                            return "保存代理";
-                        case "del":
-                            return "移除代理";
-                        case "start":
-                            return "启用代理";
-                        case "stop":
-                            return "停用代理";
-                    }
-                    break;
-                case "push":
-                    switch (keyItemArray[3]) {
-                        case "save_to_gb":
-                            return "将推流添加到国标";
-                        case "remove_form_gb":
-                            return "将推流移出到国标";
-                    }
-                    break;
-                case "user":
-                    switch (keyItemArray[3]) {
-                        case "login":
-                            return "登录";
-                        case "changePassword":
-                            return "修改密码";
-                        case "add":
-                            return "添加用户";
-                        case "delete":
-                            return "删除用户";
-                    }
-                    break;
-            }
-        }
-        return null;
-    }
-}
-

+ 2 - 0
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/common/VideoManagerConstants.java

@@ -51,4 +51,6 @@ public class VideoManagerConstants {
 	public static final String MEDIA_SSRC_USED_PREFIX = "VMP_media_used_ssrc_";
 	public static final String MEDIA_SSRC_USED_PREFIX = "VMP_media_used_ssrc_";
 
 
 	public static final String MEDIA_TRANSACTION_USED_PREFIX = "VMP_media_transaction_";
 	public static final String MEDIA_TRANSACTION_USED_PREFIX = "VMP_media_transaction_";
+
+	public static final long REDIS_ERPIRE = 12*60*60;
 }
 }

+ 0 - 91
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/conf/RedisConfig.java

@@ -1,91 +0,0 @@
-//package com.zd.alg.iot.vmp.conf;
-//
-//import org.apache.commons.lang3.StringUtils;
-//import org.springframework.beans.factory.annotation.Value;
-//import org.springframework.cache.annotation.CachingConfigurerSupport;
-//import org.springframework.context.annotation.Bean;
-//import org.springframework.context.annotation.Configuration;
-//import org.springframework.data.redis.connection.RedisConnectionFactory;
-//import org.springframework.data.redis.core.RedisTemplate;
-//import org.springframework.data.redis.listener.RedisMessageListenerContainer;
-//import org.springframework.data.redis.serializer.StringRedisSerializer;
-//
-//import com.alibaba.fastjson.parser.ParserConfig;
-//import com.zd.alg.iot.vmp.utils.redis.FastJsonRedisSerializer;
-//import redis.clients.jedis.JedisPool;
-//import redis.clients.jedis.JedisPoolConfig;
-//
-///**
-// * @Description:Redis中间件配置类,使用spring-data-redis集成,自动从application.yml中加载redis配置
-// * @author: dgs
-// * @date: 2019年5月30日 上午10:58:25
-// *
-// */
-//@Configuration
-//public class RedisConfig extends CachingConfigurerSupport {
-//
-//	@Value("${spring.redis.host}")
-//	private String host;
-//	@Value("${spring.redis.port}")
-//	private int port;
-//	@Value("${spring.redis.database}")
-//	private int database;
-//	@Value("${spring.redis.password}")
-//	private String password;
-//	@Value("${spring.redis.timeout:2000}")
-//	private int timeout;
-//	@Value("${spring.redis.poolMaxTotal:1000}")
-//	private int poolMaxTotal;
-//	@Value("${spring.redis.poolMaxIdle:500}")
-//	private int poolMaxIdle;
-//	@Value("${spring.redis.poolMaxWait:5}")
-//	private int poolMaxWait;
-//
-//	@Bean
-//	public JedisPool jedisPool() {
-//		if (StringUtils.isBlank(password)) {
-//			password = null;
-//		}
-//		JedisPoolConfig poolConfig = new JedisPoolConfig();
-//		poolConfig.setMaxIdle(poolMaxIdle);
-//		poolConfig.setMaxTotal(poolMaxTotal);
-//		// 秒转毫秒
-//		poolConfig.setMaxWaitMillis(poolMaxWait * 1000L);
-//		JedisPool jp = new JedisPool(poolConfig, host, port, timeout * 1000, password, database);
-//		return jp;
-//	}
-//
-//	@Bean("redisTemplate")
-//	public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
-//		RedisTemplate<Object, Object> template = new RedisTemplate<>();
-//		template.setConnectionFactory(redisConnectionFactory);
-//		// 使用fastjson进行序列化处理,提高解析效率
-//		FastJsonRedisSerializer<Object> serializer = new FastJsonRedisSerializer<Object>(Object.class);
-//		// value值的序列化采用fastJsonRedisSerializer
-//		template.setValueSerializer(serializer);
-//		template.setHashValueSerializer(serializer);
-//		// key的序列化采用StringRedisSerializer
-//		template.setKeySerializer(new StringRedisSerializer());
-//		template.setHashKeySerializer(new StringRedisSerializer());
-//		template.setConnectionFactory(redisConnectionFactory);
-//		// 使用fastjson时需设置此项,否则会报异常not support type
-//		ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
-//		return template;
-//	}
-//
-//	/**
-//	 * redis消息监听器容器 可以添加多个监听不同话题的redis监听器,只需要把消息监听器和相应的消息订阅处理器绑定,该消息监听器
-//	 * 通过反射技术调用消息订阅处理器的相关方法进行一些业务处理
-//	 *
-//	 * @param connectionFactory
-//	 * @return
-//	 */
-//	@Bean
-//	RedisMessageListenerContainer container(RedisConnectionFactory connectionFactory) {
-//
-//        RedisMessageListenerContainer container = new RedisMessageListenerContainer();
-//        container.setConnectionFactory(connectionFactory);
-//        return container;
-//    }
-//
-//}

+ 0 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/conf/SipPlatformRunner.java

@@ -41,9 +41,6 @@ public class SipPlatformRunner implements CommandLineRunner {
         // 清理所有平台注册缓存
         // 清理所有平台注册缓存
         redisCatchStorage.cleanPlatformRegisterInfos();
         redisCatchStorage.cleanPlatformRegisterInfos();
 
 
-        // 停止所有推流
-//        zlmrtpServerFactory.closeAllSendRtpStream();
-
         List<ParentPlatform> parentPlatforms = storager.queryEnableParentPlatformList(true);
         List<ParentPlatform> parentPlatforms = storager.queryEnableParentPlatformList(true);
 
 
         for (ParentPlatform parentPlatform : parentPlatforms) {
         for (ParentPlatform parentPlatform : parentPlatforms) {

+ 0 - 117
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/conf/Swagger3Config.java

@@ -1,117 +0,0 @@
-//package com.zd.alg.iot.vmp.conf;
-//
-//import org.springframework.beans.factory.annotation.Value;
-//import org.springframework.context.annotation.Bean;
-//import org.springframework.context.annotation.Configuration;
-//import springfox.documentation.builders.ApiInfoBuilder;
-//import springfox.documentation.builders.PathSelectors;
-//import springfox.documentation.builders.RequestHandlerSelectors;
-//import springfox.documentation.service.ApiInfo;
-//import springfox.documentation.service.Contact;
-//import springfox.documentation.spi.DocumentationType;
-//import springfox.documentation.spring.web.plugins.Docket;
-//
-//@Configuration
-//public class Swagger3Config {
-//
-//    @Value("${swagger-ui.enabled}")
-//    private boolean enable;
-//
-//    @Bean
-//    public Docket createRestApi() {
-//        return new Docket(DocumentationType.OAS_30)
-//                .apiInfo(apiInfo())
-//                .groupName("1. 全部")
-//                .select()
-//                .apis(RequestHandlerSelectors.basePackage("com.zd.iot.vmp.vmanager"))
-//                .paths(PathSelectors.any())
-//                .build()
-//                .pathMapping("/")
-//                .enable(enable);
-//    }
-//    @Bean
-//    public Docket createRestGBApi() {
-//        return new Docket(DocumentationType.OAS_30)
-//                .apiInfo(apiInfo())
-//                .groupName("2. 国标28181")
-//                .select()
-//                .apis(RequestHandlerSelectors.basePackage("com.zd.iot.vmp.vmanager.gb28181"))
-//                .paths(PathSelectors.any())
-//                .build()
-//                .pathMapping("/")
-//                .enable(enable);
-//    }
-//
-//    @Bean
-//    public Docket createRestONVIFApi() {
-//        return new Docket(DocumentationType.OAS_30)
-//                .apiInfo(apiInfo())
-//                .groupName("3. ONVIF")
-//                .select()
-//                .apis(RequestHandlerSelectors.basePackage("com.zd.iot.vmp.vmanager.onvif"))
-//                .paths(PathSelectors.any())
-//                .build()
-//                .pathMapping("/")
-//                .enable(enable);
-//    }
-//
-//    @Bean
-//    public Docket createRestStreamProxyApi() {
-//        return new Docket(DocumentationType.OAS_30)
-//                .apiInfo(apiInfo())
-//                .groupName("4. 拉流转发")
-//                .select()
-//                .apis(RequestHandlerSelectors.basePackage("com.zd.iot.vmp.vmanager.streamProxy"))
-//                .paths(PathSelectors.any())
-//                .build()
-//                .pathMapping("/")
-//                .enable(enable);
-//    }
-//    @Bean
-//    public Docket createRestStreamPushApi() {
-//        return new Docket(DocumentationType.OAS_30)
-//                .apiInfo(apiInfo())
-//                .groupName("5. 推流管理")
-//                .select()
-//                .apis(RequestHandlerSelectors.basePackage("com.zd.iot.vmp.vmanager.streamPush"))
-//                .paths(PathSelectors.any())
-//                .build()
-//                .pathMapping("/")
-//                .enable(enable);
-//    }
-//
-//
-//    @Bean
-//    public Docket createServerApi() {
-//        return new Docket(DocumentationType.OAS_30)
-//                .apiInfo(apiInfo())
-//                .groupName("6. 服务管理")
-//                .select()
-//                .apis(RequestHandlerSelectors.basePackage("com.zd.iot.vmp.vmanager.server"))
-//                .paths(PathSelectors.any())
-//                .build()
-//                .pathMapping("/")
-//                .enable(enable);
-//    }
-//    @Bean
-//    public Docket createUserApi() {
-//        return new Docket(DocumentationType.OAS_30)
-//                .apiInfo(apiInfo())
-//                .groupName("7. 用户管理")
-//                .select()
-//                .apis(RequestHandlerSelectors.basePackage("com.zd.iot.vmp.vmanager.user"))
-//                .paths(PathSelectors.any())
-//                .build()
-//                .pathMapping("/")
-//                .enable(enable);
-//    }
-//
-//    private ApiInfo apiInfo() {
-//        return new ApiInfoBuilder()
-//                .title("WVP-PRO 接口文档")
-//                .description("更多请咨询服务开发者(18010473990@@163.com)。")
-//                .contact(new Contact("panlinlin", "http://www.ruiyeclub.cn", "ruiyeclub@foxmail.com"))
-//                .version("2.0")
-//                .build();
-//    }
-//}

+ 0 - 24
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/conf/WVPTimerTask.java

@@ -1,24 +0,0 @@
-package com.zd.alg.iot.vmp.conf;
-
-import com.zd.alg.iot.vmp.storager.IRedisCatchStorage;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-@Component
-public class WVPTimerTask {
-
-    @Autowired
-    private IRedisCatchStorage redisCatchStorage;
-
-    @Autowired
-    private SipConfig sipConfig;
-
-    @Autowired
-    private MediaConfig mediaConfig;
-
-    @Scheduled(cron="0/2 * *  * * ? ")   //每3秒执行一次
-    public void execute(){
-//        redisCatchStorage.updateWVPInfo();
-    }
-}

+ 0 - 4
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/SipLayer.java

@@ -186,9 +186,6 @@ public class SipLayer implements SipListener {
 				}
 				}
 			}
 			}
 		}
 		}
-
-
-
 	}
 	}
 
 
 	/**
 	/**
@@ -250,7 +247,6 @@ public class SipLayer implements SipListener {
 	@Override
 	@Override
 	public void processDialogTerminated(DialogTerminatedEvent dialogTerminatedEvent) {
 	public void processDialogTerminated(DialogTerminatedEvent dialogTerminatedEvent) {
 		// TODO Auto-generated method stub
 		// TODO Auto-generated method stub
-
 	}
 	}
 
 
 }
 }

+ 0 - 64
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/auth/DigestServerAuthenticationHelper.java

@@ -56,9 +56,6 @@ public class DigestServerAuthenticationHelper  {
     public static final String DEFAULT_ALGORITHM = "MD5";
     public static final String DEFAULT_ALGORITHM = "MD5";
     public static final String DEFAULT_SCHEME = "Digest";
     public static final String DEFAULT_SCHEME = "Digest";
 
 
-
-
-
     /** to hex converter */
     /** to hex converter */
     private static final char[] toHex = { '0', '1', '2', '3', '4', '5', '6',
     private static final char[] toHex = { '0', '1', '2', '3', '4', '5', '6',
             '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
             '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
@@ -134,19 +131,15 @@ public class DigestServerAuthenticationHelper  {
         if ( username == null || realm == null ) {
         if ( username == null || realm == null ) {
             return false;
             return false;
         }
         }
-
         String nonce = authHeader.getNonce();
         String nonce = authHeader.getNonce();
         URI uri = authHeader.getURI();
         URI uri = authHeader.getURI();
         if (uri == null) {
         if (uri == null) {
             return false;
             return false;
         }
         }
 
 
-
-
         String A2 = request.getMethod().toUpperCase() + ":" + uri.toString();
         String A2 = request.getMethod().toUpperCase() + ":" + uri.toString();
         String HA1 = hashedPassword;
         String HA1 = hashedPassword;
 
 
-
         byte[] mdbytes = messageDigest.digest(A2.getBytes());
         byte[] mdbytes = messageDigest.digest(A2.getBytes());
         String HA2 = toHexString(mdbytes);
         String HA2 = toHexString(mdbytes);
 
 
@@ -197,8 +190,6 @@ public class DigestServerAuthenticationHelper  {
         // nonce计数器,是一个16进制的数值,表示同一nonce下客户端发送出请求的数量
         // nonce计数器,是一个16进制的数值,表示同一nonce下客户端发送出请求的数量
         int nc = authHeader.getNonceCount();
         int nc = authHeader.getNonceCount();
         String ncStr = String.format("%08x", nc).toUpperCase();
         String ncStr = String.format("%08x", nc).toUpperCase();
-        // String ncStr = new DecimalFormat("00000000").format(nc);
-        // String ncStr = new DecimalFormat("00000000").format(Integer.parseInt(nc + "", 16));
 
 
         String A1 = username + ":" + realm + ":" + pass;
         String A1 = username + ":" + realm + ":" + pass;
         String A2 = request.getMethod().toUpperCase() + ":" + uri.toString();
         String A2 = request.getMethod().toUpperCase() + ":" + uri.toString();
@@ -237,59 +228,4 @@ public class DigestServerAuthenticationHelper  {
         return mdString.equals(response);
         return mdString.equals(response);
 
 
     }
     }
-
-//     public static void main(String[] args) throws NoSuchAlgorithmException {
-//         String realm = "3402000000";
-//         String username = "44010000001180008012";
-
-
-//         String nonce = "07cab60999fbf643264ace27d3b7de8b";
-//         String uri = "sip:34020000002000000001@3402000000";
-//         // qop 保护质量 包含auth(默认的)和auth-int(增加了报文完整性检测)两种策略
-//         String qop = "auth";
-
-//         // 客户端随机数,这是一个不透明的字符串值,由客户端提供,并且客户端和服务器都会使用,以避免用明文文本。
-//         // 这使得双方都可以查验对方的身份,并对消息的完整性提供一些保护
-//         //String cNonce = authHeader.getCNonce();
-
-//         // nonce计数器,是一个16进制的数值,表示同一nonce下客户端发送出请求的数量
-//         int nc = 1;
-//         String ncStr = new DecimalFormat("00000000").format(nc);
-// //        String ncStr = new DecimalFormat("00000000").format(Integer.parseInt(nc + "", 16));
-//         MessageDigest messageDigest = MessageDigest.getInstance(DEFAULT_ALGORITHM);
-//         String A1 = username + ":" + realm + ":" + "12345678";
-//         String A2 = "REGISTER" + ":" + uri;
-//         byte mdbytes[] = messageDigest.digest(A1.getBytes());
-//         String HA1 = toHexString(mdbytes);
-//         System.out.println("A1: " + A1);
-//         System.out.println("A2: " + A2);
-
-//         mdbytes = messageDigest.digest(A2.getBytes());
-//         String HA2 = toHexString(mdbytes);
-//         System.out.println("HA1: " + HA1);
-//         System.out.println("HA2: " + HA2);
-//         String cnonce = "0a4f113b";
-//         System.out.println("nonce: " + nonce);
-//         System.out.println("nc: " + ncStr);
-//         System.out.println("cnonce: " + cnonce);
-//         System.out.println("qop: " + qop);
-//         String KD = HA1 + ":" + nonce;
-
-//         if (qop != null && qop.equals("auth") ) {
-//             if (nc != -1) {
-//                 KD += ":" + ncStr;
-//             }
-//             if (cnonce != null) {
-//                 KD += ":" + cnonce;
-//             }
-//             KD += ":" + qop;
-//         }
-//         KD += ":" + HA2;
-//         System.out.println("KD: " + KD);
-//         mdbytes = messageDigest.digest(KD.getBytes());
-//         String mdString = toHexString(mdbytes);
-//         System.out.println("mdString: " + mdString);
-//         String response = "4f0507d4b87cdecff04bdaf4c96348f0";
-//         System.out.println("response: " + response);
-//     }
 }
 }

+ 66 - 0
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/bean/MediaStream.java

@@ -0,0 +1,66 @@
+package com.zd.alg.iot.vmp.gb28181.bean;
+
+import com.zd.common.core.utils.StringUtils;
+
+import java.util.HashMap;
+import java.util.Map;
+/**
+ * <p>媒体流参数模型类</p>
+ *
+ * @author linft
+ * @version 1.0
+ * @date 2/7/2023
+ */
+public class MediaStream {
+
+
+    /**
+     * 视频描述f参数
+     * @param dpi
+     * @return
+     */
+    public static String getMediaStreamF(Integer dpi){
+        if (dpi == null || StringUtils.isEmpty(mediaStreamFParams.get(dpi))) {
+            return mediaStreamFParams.get(720);
+        }
+        return mediaStreamFParams.get(dpi);
+    }
+
+    /**
+     * 按分辨率获取码流(主码流、子码流、第三码流)
+     * @param dpi
+     * @return
+     */
+    public static String getMediaStreamA(Integer dpi){
+        if (dpi != null) {
+            if (dpi > 720) {
+                return "stream:0";
+            } else if (dpi < 720){
+                return "stream:2";
+            }
+        }
+        return "stream:1";
+    }
+
+    /**
+     * GB/T28181视频流f参数
+     * f字段:f=v/码格式/分辨率/帧数/码率类型/码率大小 a/编码格式/码率大小/采样率
+     * v(video)后为视频参数
+     *  --编码格式:1-MPEG-4, 2-H.264, 3-SVAV, 4-3GP
+     *  --分辨率:1-QCIF(176×144), 2-CIF(352×288), 3-4CIF(704×576), 4-D1(720*576), 5-720P, 6-1080P/I
+     *  --帧数:0~99 (海康:0~25)
+     *  --码率类型:1-固定码率, 2-可变码率
+     *  --码率大小(Kbps): 0~100000 (海康:256~16384)
+     * a(aud) 后为音频参数
+     *  --编码格式:1-G.711, 2-G.723.1, 3-G729, 4-722.1
+     *  --码率大小:
+     *  --编码码率:1-5.3kbps, 2-6.3kbps, 3-8kbps, 4-16kbps
+     */
+    protected static Map<Integer,String> mediaStreamFParams = new HashMap<Integer,String>(){{
+        put(288,"v/2/2/20/1/256 a///");
+        put(480,"v/2/3/18/1/256 a///");
+        put(576,"v/2/4/18/1/512 a///");
+        put(720,"v/2/5/16/1/512 a///");
+        put(1080,"v/2/6/15/1/1024 a///");
+    }};
+}

+ 0 - 15
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/bean/PlatformRegister.java

@@ -1,15 +0,0 @@
-package com.zd.alg.iot.vmp.gb28181.bean;
-
-public class PlatformRegister {
-
-    // 未回复次数
-    private int reply;
-
-    public int getReply() {
-        return reply;
-    }
-
-    public void setReply(int reply) {
-        this.reply = reply;
-    }
-}

+ 0 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/bean/WvpSipDate.java

@@ -10,9 +10,6 @@ import java.util.*;
  */
  */
 public class WvpSipDate extends SIPDate {
 public class WvpSipDate extends SIPDate {
 
 
-    /**
-     *
-     */
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
     private Calendar javaCal;
     private Calendar javaCal;

+ 1 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/event/alarm/AlarmEvent.java

@@ -10,9 +10,7 @@ import org.springframework.context.ApplicationEvent;
  */
  */
 
 
 public class AlarmEvent extends ApplicationEvent {
 public class AlarmEvent extends ApplicationEvent {
-    /**
-     *
-     */
+
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
     public AlarmEvent(Object source) {
     public AlarmEvent(Object source) {

+ 0 - 2
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/event/offline/KeepaliveTimeoutListenerForPlatform.java

@@ -28,7 +28,6 @@ public class KeepaliveTimeoutListenerForPlatform extends KeyExpirationEventMessa
         super(listenerContainer);
         super(listenerContainer);
     }
     }
 
 
-
     /**
     /**
      * 监听失效的key
      * 监听失效的key
      * @param message
      * @param message
@@ -56,6 +55,5 @@ public class KeepaliveTimeoutListenerForPlatform extends KeyExpirationEventMessa
             String deviceId = expiredKey.substring(VideoManagerConstants.KEEPLIVEKEY_PREFIX.length(),expiredKey.length());
             String deviceId = expiredKey.substring(VideoManagerConstants.KEEPLIVEKEY_PREFIX.length(),expiredKey.length());
             publisher.outlineEventPublish(deviceId, VideoManagerConstants.EVENT_OUTLINE_TIMEOUT);
             publisher.outlineEventPublish(deviceId, VideoManagerConstants.EVENT_OUTLINE_TIMEOUT);
         }
         }
-
     }
     }
 }
 }

+ 0 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/event/offline/OfflineEvent.java

@@ -9,9 +9,6 @@ import org.springframework.context.ApplicationEvent;
  */
  */
 public class OfflineEvent extends ApplicationEvent {
 public class OfflineEvent extends ApplicationEvent {
 
 
-	/**
-	 *
-	 */
 	private static final long serialVersionUID = 1L;
 	private static final long serialVersionUID = 1L;
 
 
 	public OfflineEvent(Object source) {
 	public OfflineEvent(Object source) {

+ 0 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/event/online/OnlineEvent.java

@@ -10,9 +10,6 @@ import org.springframework.context.ApplicationEvent;
  */
  */
 public class OnlineEvent extends ApplicationEvent {
 public class OnlineEvent extends ApplicationEvent {
 
 
-	/**
-	 *
-	 */
 	private static final long serialVersionUID = 1L;
 	private static final long serialVersionUID = 1L;
 
 
 	public OnlineEvent(Object source) {
 	public OnlineEvent(Object source) {

+ 0 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/event/platformNotRegister/PlatformNotRegisterEvent.java

@@ -4,9 +4,6 @@ import org.springframework.context.ApplicationEvent;
 
 
 public class PlatformNotRegisterEvent extends ApplicationEvent {
 public class PlatformNotRegisterEvent extends ApplicationEvent {
 
 
-    /**
-     * Add default serial version ID
-     */
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
     private String platformGbID;
     private String platformGbID;

+ 2 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/session/VideoStreamSessionManager.java

@@ -34,8 +34,7 @@ public class VideoStreamSessionManager {
 		ssrcTransaction.setTransaction(transactionByteArray);
 		ssrcTransaction.setTransaction(transactionByteArray);
 		ssrcTransaction.setSsrc(ssrc);
 		ssrcTransaction.setSsrc(ssrc);
 		ssrcTransaction.setMediaServerId(mediaServerId);
 		ssrcTransaction.setMediaServerId(mediaServerId);
-
-		redisUtil.set(VideoManagerConstants.MEDIA_TRANSACTION_USED_PREFIX +  deviceId + "_" + channelId, ssrcTransaction);
+		redisUtil.set(VideoManagerConstants.MEDIA_TRANSACTION_USED_PREFIX +  deviceId + "_" + channelId, ssrcTransaction, VideoManagerConstants.REDIS_ERPIRE);
 	}
 	}
 
 
 	public void put(String deviceId, String channelId , Dialog dialog){
 	public void put(String deviceId, String channelId , Dialog dialog){
@@ -44,7 +43,7 @@ public class VideoStreamSessionManager {
 			byte[] dialogByteArray = SerializeUtils.serialize(dialog);
 			byte[] dialogByteArray = SerializeUtils.serialize(dialog);
 			ssrcTransaction.setDialog(dialogByteArray);
 			ssrcTransaction.setDialog(dialogByteArray);
 		}
 		}
-		redisUtil.set(VideoManagerConstants.MEDIA_TRANSACTION_USED_PREFIX +  deviceId + "_" + channelId, ssrcTransaction);
+		redisUtil.set(VideoManagerConstants.MEDIA_TRANSACTION_USED_PREFIX +  deviceId + "_" + channelId, ssrcTransaction, VideoManagerConstants.REDIS_ERPIRE);
 	}
 	}
 
 
 
 

+ 0 - 2
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/SIPProcessorFactory.java

@@ -38,8 +38,6 @@ import javax.sip.message.Response;
 @Component
 @Component
 public class SIPProcessorFactory {
 public class SIPProcessorFactory {
 
 
-	// private final static Logger logger = LoggerFactory.getLogger(SIPProcessorFactory.class);
-
 	@Autowired
 	@Autowired
 	private SipConfig sipConfig;
 	private SipConfig sipConfig;
 
 

+ 6 - 7
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/cmd/ISIPCommander.java

@@ -20,7 +20,6 @@ public interface ISIPCommander {
 	 * @param channelId  预览通道
 	 * @param channelId  预览通道
 	 * @param leftRight  镜头左移右移 0:停止 1:左移 2:右移
 	 * @param leftRight  镜头左移右移 0:停止 1:左移 2:右移
      * @param upDown     镜头上移下移 0:停止 1:上移 2:下移
      * @param upDown     镜头上移下移 0:停止 1:上移 2:下移
-     * @param moveSpeed  镜头移动速度
 	 */
 	 */
 	boolean ptzdirectCmd(Device device, String channelId, int leftRight, int upDown);
 	boolean ptzdirectCmd(Device device, String channelId, int leftRight, int upDown);
 
 
@@ -50,7 +49,7 @@ public interface ISIPCommander {
 	 * @param device  控制设备
 	 * @param device  控制设备
 	 * @param channelId  预览通道
 	 * @param channelId  预览通道
      * @param inOut      镜头放大缩小 0:停止 1:缩小 2:放大
      * @param inOut      镜头放大缩小 0:停止 1:缩小 2:放大
-     * @param zoomSpeed  镜头缩放速度
+     * @param moveSpeed  镜头缩放速度
 	 */
 	 */
 	boolean ptzZoomCmd(Device device, String channelId, int inOut, int moveSpeed);
 	boolean ptzZoomCmd(Device device, String channelId, int inOut, int moveSpeed);
 
 
@@ -92,7 +91,7 @@ public interface ISIPCommander {
 	 * @param device  视频设备
 	 * @param device  视频设备
 	 * @param channelId  预览通道
 	 * @param channelId  预览通道
 	 */
 	 */
-	void playStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent);
+	void playStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent, Integer dpi);
 
 
 	/**
 	/**
 	 * 请求回放视频流
 	 * 请求回放视频流
@@ -102,7 +101,7 @@ public interface ISIPCommander {
 	 * @param startTime 开始时间,格式要求:yyyy-MM-dd HH:mm:ss
 	 * @param startTime 开始时间,格式要求:yyyy-MM-dd HH:mm:ss
 	 * @param endTime 结束时间,格式要求:yyyy-MM-dd HH:mm:ss
 	 * @param endTime 结束时间,格式要求:yyyy-MM-dd HH:mm:ss
 	 */
 	 */
-	void playbackStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInf, Device device, String channelId, String startTime, String endTime, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent);
+	void playbackStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInf, Device device, String channelId, String startTime, String endTime, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent, Integer dpi);
 
 
 	/**
 	/**
 	 * 请求历史媒体下载
 	 * 请求历史媒体下载
@@ -113,7 +112,7 @@ public interface ISIPCommander {
 	 * @param endTime 结束时间,格式要求:yyyy-MM-dd HH:mm:ss
 	 * @param endTime 结束时间,格式要求:yyyy-MM-dd HH:mm:ss
 	 * @param downloadSpeed 下载倍速参数
 	 * @param downloadSpeed 下载倍速参数
 	 */
 	 */
-	void downloadStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, String startTime, String endTime, String downloadSpeed, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent);
+	void downloadStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, String startTime, String endTime, String downloadSpeed, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent, Integer dpi);
 
 
 	/**
 	/**
 	 * 视频流停止
 	 * 视频流停止
@@ -157,7 +156,7 @@ public interface ISIPCommander {
 	 * 报警布防/撤防命令
 	 * 报警布防/撤防命令
 	 *
 	 *
 	 * @param device  	视频设备
 	 * @param device  	视频设备
-	 * @param setGuard	true: SetGuard, false: ResetGuard
+	 * @param guardCmdStr	true: SetGuard, false: ResetGuard
 	 */
 	 */
 	boolean guardCmd(Device device, String guardCmdStr, SipSubscribe.Event errorEvent);
 	boolean guardCmd(Device device, String guardCmdStr, SipSubscribe.Event errorEvent);
 
 
@@ -292,7 +291,7 @@ public interface ISIPCommander {
 	 * @param expires		订阅过期时间(0 = 取消订阅)
 	 * @param expires		订阅过期时间(0 = 取消订阅)
 	 * @param startPriority	报警起始级别(可选)
 	 * @param startPriority	报警起始级别(可选)
 	 * @param endPriority	报警终止级别(可选)
 	 * @param endPriority	报警终止级别(可选)
-	 * @param alarmMethods	报警方式条件(可选)
+	 * @param alarmMethod	报警方式条件(可选)
 	 * @param alarmType		报警类型
 	 * @param alarmType		报警类型
 	 * @param startTime		报警发生起始时间(可选)
 	 * @param startTime		报警发生起始时间(可选)
 	 * @param endTime		报警发生终止时间(可选)
 	 * @param endTime		报警发生终止时间(可选)

+ 13 - 7
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java

@@ -3,6 +3,7 @@ package com.zd.alg.iot.vmp.gb28181.transmit.cmd.impl;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.zd.alg.iot.vmp.conf.SipConfig;
 import com.zd.alg.iot.vmp.conf.SipConfig;
 import com.zd.alg.iot.vmp.conf.UserSetup;
 import com.zd.alg.iot.vmp.conf.UserSetup;
+import com.zd.alg.iot.vmp.gb28181.bean.MediaStream;
 import com.zd.alg.iot.vmp.service.IMediaServerService;
 import com.zd.alg.iot.vmp.service.IMediaServerService;
 import com.zd.alg.iot.vmp.service.bean.SSRCInfo;
 import com.zd.alg.iot.vmp.service.bean.SSRCInfo;
 import com.zd.alg.iot.vmp.storager.IRedisCatchStorage;
 import com.zd.alg.iot.vmp.storager.IRedisCatchStorage;
@@ -337,12 +338,11 @@ public class SIPCommander implements ISIPCommander {
 	  * @param errorEvent sip错误订阅
 	  * @param errorEvent sip错误订阅
 	  */
 	  */
 	@Override
 	@Override
-	public void playStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent) {
+	public void playStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent, Integer dpi) {
 		String streamId = ssrcInfo.getStreamId();
 		String streamId = ssrcInfo.getStreamId();
 		try {
 		try {
 			if (device == null) return;
 			if (device == null) return;
 			String streamMode = device.getStreamMode().toUpperCase();
 			String streamMode = device.getStreamMode().toUpperCase();
-			//logger.info("{} 分配的ZLM为: {} [{}:{}]", streamId, mediaServerItem.getId(), mediaServerItem.getIp(), ssrcInfo.getPort());
 			// 添加订阅
 			// 添加订阅
 			JSONObject subscribeKey = new JSONObject();
 			JSONObject subscribeKey = new JSONObject();
 			subscribeKey.put("app", "rtp");
 			subscribeKey.put("app", "rtp");
@@ -408,9 +408,12 @@ public class SIPCommander implements ISIPCommander {
 					content.append("a=connection:new\r\n");
 					content.append("a=connection:new\r\n");
 				}
 				}
 			}
 			}
-
+			//验证1:获取码流
+			//content.append("a="+MediaStream.getMediaStreamA(dpi)+"\r\n");
 			content.append("y="+ssrcInfo.getSsrc()+"\r\n");//ssrc
 			content.append("y="+ssrcInfo.getSsrc()+"\r\n");//ssrc
-
+			//验证2:设置编码格式、分辨率、帧数、码率类型、码率大小、编码格式、码率大小
+			content.append("f="+MediaStream.getMediaStreamF(dpi)+"\r\n");
+			logger.info("【RTSP实时视频流请求】 请求参数:\r\n"+content.toString());
 			String tm = Long.toString(System.currentTimeMillis());
 			String tm = Long.toString(System.currentTimeMillis());
 
 
 			CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId()
 			CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId()
@@ -441,7 +444,7 @@ public class SIPCommander implements ISIPCommander {
 	 */
 	 */
 	@Override
 	@Override
 	public void playbackStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, String startTime, String endTime, ZLMHttpHookSubscribe.Event event
 	public void playbackStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, String startTime, String endTime, ZLMHttpHookSubscribe.Event event
-			, SipSubscribe.Event errorEvent) {
+			, SipSubscribe.Event errorEvent, Integer dpi) {
 		try {
 		try {
 			logger.info("{} 分配的ZLM为: {} [{}:{}]", ssrcInfo.getStreamId(), mediaServerItem.getId(), mediaServerItem.getIp(), ssrcInfo.getPort());
 			logger.info("{} 分配的ZLM为: {} [{}:{}]", ssrcInfo.getStreamId(), mediaServerItem.getId(), mediaServerItem.getIp(), ssrcInfo.getPort());
 			// 添加订阅
 			// 添加订阅
@@ -514,6 +517,8 @@ public class SIPCommander implements ISIPCommander {
 				}
 				}
 			}
 			}
 	        content.append("y=" + ssrcInfo.getSsrc() + "\r\n");//ssrc
 	        content.append("y=" + ssrcInfo.getSsrc() + "\r\n");//ssrc
+			//设置编码格式、分辨率、帧数、码率类型、码率大小、编码格式、码率大小
+			content.append("f="+MediaStream.getMediaStreamF(dpi)+"\r\n");
 			String tm = Long.toString(System.currentTimeMillis());
 			String tm = Long.toString(System.currentTimeMillis());
 			CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId()
 			CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId()
 					: udpSipProvider.getNewCallId();
 					: udpSipProvider.getNewCallId();
@@ -540,7 +545,7 @@ public class SIPCommander implements ISIPCommander {
 	 */
 	 */
 	@Override
 	@Override
 	public void downloadStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, String startTime, String endTime, String downloadSpeed, ZLMHttpHookSubscribe.Event event
 	public void downloadStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, String startTime, String endTime, String downloadSpeed, ZLMHttpHookSubscribe.Event event
-			, SipSubscribe.Event errorEvent) {
+			, SipSubscribe.Event errorEvent, Integer dpi) {
 		try {
 		try {
 			logger.info("{} 分配的ZLM为: {} [{}:{}]", ssrcInfo.getStreamId(), mediaServerItem.getId(), mediaServerItem.getIp(), ssrcInfo.getPort());
 			logger.info("{} 分配的ZLM为: {} [{}:{}]", ssrcInfo.getStreamId(), mediaServerItem.getId(), mediaServerItem.getIp(), ssrcInfo.getPort());
 
 
@@ -615,7 +620,8 @@ public class SIPCommander implements ISIPCommander {
 			content.append("a=downloadspeed:" + downloadSpeed + "\r\n");
 			content.append("a=downloadspeed:" + downloadSpeed + "\r\n");
 
 
 	        content.append("y=" + ssrcInfo.getSsrc() + "\r\n");//ssrc
 	        content.append("y=" + ssrcInfo.getSsrc() + "\r\n");//ssrc
-
+			//设置编码格式、分辨率、帧数、码率类型、码率大小、编码格式、码率大小
+			content.append("f="+MediaStream.getMediaStreamF(dpi)+"\r\n");
 			String tm = Long.toString(System.currentTimeMillis());
 			String tm = Long.toString(System.currentTimeMillis());
 
 
 			CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId()
 			CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId()

+ 0 - 1
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/ISIPRequestProcessor.java

@@ -8,5 +8,4 @@ package com.zd.alg.iot.vmp.gb28181.transmit.request;
 public interface ISIPRequestProcessor {
 public interface ISIPRequestProcessor {
 
 
 	public void process();
 	public void process();
-
 }
 }

+ 2 - 2
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/SIPRequestAbstractProcessor.java

@@ -36,10 +36,10 @@ public abstract class SIPRequestAbstractProcessor implements ISIPRequestProcesso
 
 
 	@Override
 	@Override
 	public void process() {
 	public void process() {
-		this.process(evt);
+		this.process(evt, null);
 	}
 	}
 
 
-	public abstract void process(RequestEvent evt);
+	public abstract void process(RequestEvent evt, Integer dpi);
 
 
 	public ServerTransaction getServerTransaction(RequestEvent evt) {
 	public ServerTransaction getServerTransaction(RequestEvent evt) {
 		Request request = evt.getRequest();
 		Request request = evt.getRequest();

+ 1 - 13
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/AckRequestProcessor.java

@@ -40,7 +40,7 @@ public class AckRequestProcessor extends SIPRequestAbstractProcessor {
 	 * @param evt
 	 * @param evt
 	 */
 	 */
 	@Override
 	@Override
-	public void process(RequestEvent evt) {
+	public void process(RequestEvent evt, Integer dpi) {
 		//Request request = evt.getRequest();
 		//Request request = evt.getRequest();
 		Dialog dialog = evt.getDialog();
 		Dialog dialog = evt.getDialog();
 		if (dialog == null) return;
 		if (dialog == null) return;
@@ -102,18 +102,6 @@ public class AckRequestProcessor extends SIPRequestAbstractProcessor {
 				}
 				}
 			}
 			}
 		}
 		}
-		// try {
-		// 	Request ackRequest = null;
-		// 	CSeq csReq = (CSeq) request.getHeader(CSeq.NAME);
-		// 	ackRequest = dialog.createAck(csReq.getSeqNumber());
-		// 	dialog.sendAck(ackRequest);
-		// 	logger.info("send ack to callee:" + ackRequest.toString());
-		// } catch (SipException e) {
-		// 	e.printStackTrace();
-		// } catch (InvalidArgumentException e) {
-		// 	e.printStackTrace();
-		// }
-
 	}
 	}
 
 
 	public IRedisCatchStorage getRedisCatchStorage() {
 	public IRedisCatchStorage getRedisCatchStorage() {

+ 1 - 1
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/ByeRequestProcessor.java

@@ -48,7 +48,7 @@ public class ByeRequestProcessor extends SIPRequestAbstractProcessor {
 	 * @param evt
 	 * @param evt
 	 */
 	 */
 	@Override
 	@Override
-	public void process(RequestEvent evt) {
+	public void process(RequestEvent evt, Integer dpi) {
 		try {
 		try {
 			responseAck(evt);
 			responseAck(evt);
 			Dialog dialog = evt.getDialog();
 			Dialog dialog = evt.getDialog();

+ 1 - 1
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/CancelRequestProcessor.java

@@ -20,7 +20,7 @@ public class CancelRequestProcessor extends SIPRequestAbstractProcessor {
 	 * @param config
 	 * @param config
 	 */
 	 */
 	@Override
 	@Override
-	public void process(RequestEvent evt) {
+	public void process(RequestEvent evt, Integer dpi) {
 		// TODO 优先级99 Cancel Request消息实现,此消息一般为级联消息,上级给下级发送请求取消指令
 		// TODO 优先级99 Cancel Request消息实现,此消息一般为级联消息,上级给下级发送请求取消指令
 
 
 	}
 	}

+ 2 - 7
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java

@@ -66,7 +66,7 @@ public class InviteRequestProcessor extends SIPRequestAbstractProcessor {
 	 *            请求消息
 	 *            请求消息
 	 */
 	 */
 	@Override
 	@Override
-	public void process(RequestEvent evt) {
+	public void process(RequestEvent evt, Integer dpi) {
 		//  Invite Request消息实现,此消息一般为级联消息,上级给下级发送请求视频指令
 		//  Invite Request消息实现,此消息一般为级联消息,上级给下级发送请求视频指令
 		try {
 		try {
 			Request request = evt.getRequest();
 			Request request = evt.getRequest();
@@ -242,7 +242,7 @@ public class InviteRequestProcessor extends SIPRequestAbstractProcessor {
 						} catch (ParseException | SipException | InvalidArgumentException e) {
 						} catch (ParseException | SipException | InvalidArgumentException e) {
 							e.printStackTrace();
 							e.printStackTrace();
 						}
 						}
-					}));
+					}), dpi);
 					if (logger.isDebugEnabled()) {
 					if (logger.isDebugEnabled()) {
 						logger.debug(playResult.getResult().toString());
 						logger.debug(playResult.getResult().toString());
 					}
 					}
@@ -423,11 +423,6 @@ public class InviteRequestProcessor extends SIPRequestAbstractProcessor {
 		getServerTransaction(evt).sendResponse(response);
 		getServerTransaction(evt).sendResponse(response);
 	}
 	}
 
 
-
-
-
-
-
 	public SIPCommanderFroPlatform getCmderFroPlatform() {
 	public SIPCommanderFroPlatform getCmderFroPlatform() {
 		return cmderFroPlatform;
 		return cmderFroPlatform;
 	}
 	}

+ 1 - 35
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/MessageRequestProcessor.java

@@ -104,7 +104,7 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
 	 * @param evt
 	 * @param evt
 	 */
 	 */
 	@Override
 	@Override
-	public void process(RequestEvent evt) {
+	public void process(RequestEvent evt, Integer dpi) {
 
 
 		try {
 		try {
 			Element rootElement = getRootElement(evt);
 			Element rootElement = getRootElement(evt);
@@ -898,41 +898,7 @@ public class MessageRequestProcessor extends SIPRequestAbstractProcessor {
 						logger.debug("Thread " + cacheKey + " already started.");
 						logger.debug("Thread " + cacheKey + " already started.");
 					}
 					}
 				}
 				}
-
-				// 存在录像且如果当前录像明细个数小于总条数,说明拆包返回,需要组装,暂不返回
-				// if (recordInfo.getSumNum() > 0 && recordList.size() > 0 && recordList.size() < recordInfo.getSumNum()) {
-				// 	// 为防止连续请求该设备的录像数据,返回数据错乱,特增加sn进行区分
-				// 	String cacheKey = CACHE_RECORDINFO_KEY + deviceId + sn;
-
-				// 	redis.set(cacheKey + "_" + uuid, recordList, 90);
-				// 	List<Object> cacheKeys = redis.scan(cacheKey + "_*");
-				// 	List<RecordItem> totalRecordList = new ArrayList<RecordItem>();
-				// 	for (int i = 0; i < cacheKeys.size(); i++) {
-				// 		totalRecordList.addAll((List<RecordItem>) redis.get(cacheKeys.get(i).toString()));
-				// 	}
-				// 	if (totalRecordList.size() < recordInfo.getSumNum()) {
-				// 		logger.info("已获取" + totalRecordList.size() + "项录像数据,共" + recordInfo.getSumNum() + "项");
-				// 		return;
-				// 	}
-				// 	logger.info("录像数据已全部获取,共" + recordInfo.getSumNum() + "项");
-				// 	recordInfo.setRecordList(totalRecordList);
-				// 	for (int i = 0; i < cacheKeys.size(); i++) {
-				// 		redis.del(cacheKeys.get(i).toString());
-				// 	}
-				// }
-				// // 自然顺序排序, 元素进行升序排列
-				// recordInfo.getRecordList().sort(Comparator.naturalOrder());
 			}
 			}
-			// 走到这里,有以下可能:1、没有录像信息,第一次收到recordinfo的消息即返回响应数据,无redis操作
-			// 2、有录像数据,且第一次即收到完整数据,返回响应数据,无redis操作
-			// 3、有录像数据,在超时时间内收到多次包组装后数量足够,返回数据
-
-			// RequestMessage msg = new RequestMessage();
-			// msg.setDeviceId(deviceId);
-			// msg.setType(DeferredResultHolder.CALLBACK_CMD_RECORDINFO);
-			// msg.setData(recordInfo);
-			// deferredResultHolder.invokeResult(msg);
-			// logger.info("处理完成,返回结果");
 		} catch (DocumentException | SipException | InvalidArgumentException | ParseException e) {
 		} catch (DocumentException | SipException | InvalidArgumentException | ParseException e) {
 			e.printStackTrace();
 			e.printStackTrace();
 		}
 		}

+ 1 - 8
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/NotifyRequestProcessor.java

@@ -64,7 +64,7 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor {
 	private static final String NOTIFY_MOBILE_POSITION = "MobilePosition";
 	private static final String NOTIFY_MOBILE_POSITION = "MobilePosition";
 
 
 	@Override
 	@Override
-	public void process(RequestEvent evt) {
+	public void process(RequestEvent evt, Integer dpi) {
 		try {
 		try {
 			Element rootElement = getRootElement(evt);
 			Element rootElement = getRootElement(evt);
 			String cmd = XmlUtil.getText(rootElement, "CmdType");
 			String cmd = XmlUtil.getText(rootElement, "CmdType");
@@ -320,13 +320,6 @@ public class NotifyRequestProcessor extends SIPRequestAbstractProcessor {
 					deviceChannel.setHasAudio(true); // 默认含有音频,播放时再检查是否有音频及是否AAC
 					deviceChannel.setHasAudio(true); // 默认含有音频,播放时再检查是否有音频及是否AAC
 					storager.updateChannel(device.getDeviceId(), deviceChannel);
 					storager.updateChannel(device.getDeviceId(), deviceChannel);
 				}
 				}
-
-				// RequestMessage msg = new RequestMessage();
-				// msg.setDeviceId(deviceId);
-				// msg.setType(DeferredResultHolder.CALLBACK_CMD_CATALOG);
-				// msg.setData(device);
-				// deferredResultHolder.invokeResult(msg);
-				// 回复200 OK
 				response200Ok(evt);
 				response200Ok(evt);
 				if (offLineDetector.isOnline(deviceId)) {
 				if (offLineDetector.isOnline(deviceId)) {
 					publisher.onlineEventPublish(device, VideoManagerConstants.EVENT_ONLINE_MESSAGE);
 					publisher.onlineEventPublish(device, VideoManagerConstants.EVENT_ONLINE_MESSAGE);

+ 1 - 1
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/OtherRequestProcessor.java

@@ -24,7 +24,7 @@ public class OtherRequestProcessor extends SIPRequestAbstractProcessor {
 	 * @param config
 	 * @param config
 	 */
 	 */
 	@Override
 	@Override
-	public void process(RequestEvent evt) {
+	public void process(RequestEvent evt, Integer dpi) {
 		logger.info("Unsupported the method: " + evt.getRequest().getMethod());
 		logger.info("Unsupported the method: " + evt.getRequest().getMethod());
 	}
 	}
 
 

+ 1 - 1
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/RegisterRequestProcessor.java

@@ -52,7 +52,7 @@ public class RegisterRequestProcessor extends SIPRequestAbstractProcessor {
  	 * @param evt
  	 * @param evt
 	 */
 	 */
 	@Override
 	@Override
-	public void process(RequestEvent evt) {
+	public void process(RequestEvent evt, Integer dpi) {
 		try {
 		try {
 			RequestEventExt evtExt = (RequestEventExt)evt;
 			RequestEventExt evtExt = (RequestEventExt)evt;
 			String requestAddress = evtExt.getRemoteIpAddress() + ":" + evtExt.getRemotePort();
 			String requestAddress = evtExt.getRemoteIpAddress() + ":" + evtExt.getRemotePort();

+ 1 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/gb28181/transmit/request/impl/SubscribeRequestProcessor.java

@@ -29,7 +29,7 @@ public class SubscribeRequestProcessor extends SIPRequestAbstractProcessor {
 	 * @param evt
 	 * @param evt
 	 */
 	 */
 	@Override
 	@Override
-	public void process(RequestEvent evt) {
+	public void process(RequestEvent evt, Integer dpi) {
 		Request request = evt.getRequest();
 		Request request = evt.getRequest();
 
 
 		try {
 		try {
@@ -56,7 +56,5 @@ public class SubscribeRequestProcessor extends SIPRequestAbstractProcessor {
 		} catch (InvalidArgumentException e) {
 		} catch (InvalidArgumentException e) {
 			e.printStackTrace();
 			e.printStackTrace();
 		}
 		}
-
 	}
 	}
-
 }
 }

+ 1 - 1
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/media/zlm/ZLMHttpHookListener.java

@@ -391,7 +391,7 @@ public class ZLMHttpHookListener {
 						cmder.playStreamCmd(mediaInfo, ssrcInfo, device, channelId, (MediaServerItem mediaServerItemInuse, JSONObject response) -> {
 						cmder.playStreamCmd(mediaInfo, ssrcInfo, device, channelId, (MediaServerItem mediaServerItemInuse, JSONObject response) -> {
 							logger.info("收到订阅消息: " + response.toJSONString());
 							logger.info("收到订阅消息: " + response.toJSONString());
 							playService.onPublishHandlerForPlay(mediaServerItemInuse, response, deviceId, channelId, uuid.toString());
 							playService.onPublishHandlerForPlay(mediaServerItemInuse, response, deviceId, channelId, uuid.toString());
-						}, null);
+						}, null, null);
 					}
 					}
 
 
 				}
 				}

+ 0 - 2
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/media/zlm/ZLMHttpHookSubscribe.java

@@ -112,6 +112,4 @@ public class ZLMHttpHookSubscribe {
         }
         }
         return result;
         return result;
     }
     }
-
-
 }
 }

+ 0 - 29
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/media/zlm/ZLMMediaListManager.java

@@ -122,33 +122,4 @@ public class ZLMMediaListManager {
             storager.mediaOutline(app, streamId);
             storager.mediaOutline(app, streamId);
         }
         }
     }
     }
-
-//    public void clearAllSessions() {
-//        logger.info("清空所有国标相关的session");
-//        JSONObject allSessionJSON = zlmresTfulUtils.getAllSession();
-//        ZLMServerConfig mediaInfo = redisCatchStorage.getMediaInfo();
-//        HashSet<String> allLocalPorts = new HashSet();
-//        if (allSessionJSON.getInteger("code") == 0) {
-//            JSONArray data = allSessionJSON.getJSONArray("data");
-//            if (data.size() > 0) {
-//                for (int i = 0; i < data.size(); i++) {
-//                    JSONObject sessionJOSN = data.getJSONObject(i);
-//                    Integer local_port = sessionJOSN.getInteger("local_port");
-//                    if (!local_port.equals(Integer.valueOf(mediaInfo.getHttpPort())) &&
-//                        !local_port.equals(Integer.valueOf(mediaInfo.getHttpSSLport())) &&
-//                        !local_port.equals(Integer.valueOf(mediaInfo.getRtmpPort())) &&
-//                        !local_port.equals(Integer.valueOf(mediaInfo.getRtspPort())) &&
-//                        !local_port.equals(Integer.valueOf(mediaInfo.getRtspSSlport())) &&
-//                        !local_port.equals(Integer.valueOf(mediaInfo.getHookOnFlowReport()))){
-//                        allLocalPorts.add(sessionJOSN.getInteger("local_port") + "");
-//                     }
-//                }
-//            }
-//        }
-//        if (allLocalPorts.size() > 0) {
-//            List<String> result = new ArrayList<>(allLocalPorts);
-//            String localPortSStr = String.join(",", result);
-//            zlmresTfulUtils.kickSessions(localPortSStr);
-//        }
-//    }
 }
 }

+ 0 - 4
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/media/zlm/ZLMRTPServerFactory.java

@@ -249,8 +249,4 @@ public class ZLMRTPServerFactory {
         }
         }
         return result;
         return result;
     }
     }
-
-    public void closeAllSendRtpStream() {
-
-    }
 }
 }

+ 0 - 46
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/media/zlm/ZLMRunner.java

@@ -44,20 +44,6 @@ public class ZLMRunner implements CommandLineRunner {
         // 清楚redis缓存的在线zlm信息
         // 清楚redis缓存的在线zlm信息
         mediaServerService.clearMediaServerForOnline();
         mediaServerService.clearMediaServerForOnline();
 
 
-        // 将配置文件的meida配置写入数据库
-//        MediaServerItem presetMediaServer = mediaServerService.getOneByHostAndPort(
-//                mediaConfig.getIp(), mediaConfig.getHttpPort());
-//        if (presetMediaServer  != null) {
-//            MediaServerItem mediaSerItem = mediaConfig.getMediaSerItem();
-//            mediaSerItem.setId(presetMediaServer.getId());
-//            mediaServerService.update(mediaSerItem);
-//        }else {
-//            if (mediaConfig.getId() != null) {
-//                MediaServerItem mediaSerItem = mediaConfig.getMediaSerItem();
-//                mediaServerService.add(mediaSerItem);
-//            }
-//        }
-
         // 订阅 zlm启动事件, 新的zlm也会从这里进入系统
         // 订阅 zlm启动事件, 新的zlm也会从这里进入系统
         hookSubscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_server_started,null,
         hookSubscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_server_started,null,
                 (MediaServerItem mediaServerItem, JSONObject response)->{
                 (MediaServerItem mediaServerItem, JSONObject response)->{
@@ -131,36 +117,4 @@ public class ZLMRunner implements CommandLineRunner {
         return ZLMServerConfig;
         return ZLMServerConfig;
 
 
     }
     }
-
-    /**
-     * zlm 连接成功或者zlm重启后
-     */
-//    private void zLmRunning(ZLMServerConfig zlmServerConfig){
-//        logger.info( "[ id: " + zlmServerConfig.getGeneralMediaServerId() + "] zlm接入成功...");
-//        // 关闭循环获取zlm配置
-//        startGetMedia = false;
-//        MediaServerItem mediaServerItem = new MediaServerItem(zlmServerConfig, sipIp);
-//        storager.updateMediaServer(mediaServerItem);
-//
-//        if (mediaServerItem.isAutoConfig()) setZLMConfig(mediaServerItem);
-//        zlmServerManger.updateServerCatchFromHook(zlmServerConfig);
-//
-//        // 清空所有session
-////        zlmMediaListManager.clearAllSessions();
-//
-//        // 更新流列表
-//        zlmMediaListManager.updateMediaList(mediaServerItem);
-//        // 恢复流代理, 只查找这个这个流媒体
-//        List<StreamProxyItem> streamProxyListForEnable = storager.getStreamProxyListForEnableInMediaServer(
-//                mediaServerItem.getId(), true);
-//        for (StreamProxyItem streamProxyDto : streamProxyListForEnable) {
-//            logger.info("恢复流代理," + streamProxyDto.getApp() + "/" + streamProxyDto.getStream());
-//            JSONObject jsonObject = streamProxyService.addStreamProxyToZlm(streamProxyDto);
-//            if (jsonObject == null) {
-//                // 设置为未启用
-//                logger.info("恢复流代理失败,请检查流地址后重新启用" + streamProxyDto.getApp() + "/" + streamProxyDto.getStream());
-//                streamProxyService.stop(streamProxyDto.getApp(), streamProxyDto.getStream());
-//            }
-//        }
-//    }
 }
 }

+ 2 - 1
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/service/IPlayService.java

@@ -16,9 +16,10 @@ import java.util.List;
 public interface IPlayService {
 public interface IPlayService {
 
 
     void onPublishHandlerForPlayBack(MediaServerItem mediaServerItem, JSONObject resonse, String deviceId, String channelId, String uuid);
     void onPublishHandlerForPlayBack(MediaServerItem mediaServerItem, JSONObject resonse, String deviceId, String channelId, String uuid);
+
     void onPublishHandlerForPlay(MediaServerItem mediaServerItem, JSONObject resonse, String deviceId, String channelId, String uuid);
     void onPublishHandlerForPlay(MediaServerItem mediaServerItem, JSONObject resonse, String deviceId, String channelId, String uuid);
 
 
-    PlayResult play(MediaServerItem mediaServerItem, String deviceId, String channelId, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent);
+    PlayResult play(MediaServerItem mediaServerItem, String deviceId, String channelId, ZLMHttpHookSubscribe.Event event, SipSubscribe.Event errorEvent, Integer dpi);
 
 
     MediaServerItem getNewMediaServerItem(Device device);
     MediaServerItem getNewMediaServerItem(Device device);
 
 

+ 0 - 4
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/service/impl/MediaServerServiceImpl.java

@@ -308,14 +308,12 @@ public class MediaServerServiceImpl implements IMediaServerService, CommandLineR
 
 
     }
     }
 
 
-
     @Override
     @Override
     public void addCount(String mediaServerId) {
     public void addCount(String mediaServerId) {
         if (mediaServerId == null) return;
         if (mediaServerId == null) return;
         String key = VideoManagerConstants.MEDIA_SERVERS_ONLINE_PREFIX;
         String key = VideoManagerConstants.MEDIA_SERVERS_ONLINE_PREFIX;
         Double aDouble = redisUtil.zScore(key, mediaServerId);
         Double aDouble = redisUtil.zScore(key, mediaServerId);
         redisUtil.zIncrScore(key, mediaServerId, 1);
         redisUtil.zIncrScore(key, mediaServerId, 1);
-
     }
     }
 
 
     @Override
     @Override
@@ -389,6 +387,4 @@ public class MediaServerServiceImpl implements IMediaServerService, CommandLineR
                     mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort());
                     mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort());
         }
         }
     }
     }
-
-
 }
 }

+ 0 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/service/impl/MediaServiceImpl.java

@@ -28,8 +28,6 @@ public class MediaServiceImpl implements IMediaService {
     @Autowired
     @Autowired
     private ZLMRESTfulUtils zlmresTfulUtils;
     private ZLMRESTfulUtils zlmresTfulUtils;
 
 
-
-
     @Override
     @Override
     public StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaInfo, String app, String stream, JSONArray tracks) {
     public StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaInfo, String app, String stream, JSONArray tracks) {
         return getStreamInfoByAppAndStream(mediaInfo, app, stream, tracks, null);
         return getStreamInfoByAppAndStream(mediaInfo, app, stream, tracks, null);
@@ -83,5 +81,4 @@ public class MediaServiceImpl implements IMediaService {
         streamInfoResult.setTracks(tracks);
         streamInfoResult.setTracks(tracks);
         return streamInfoResult;
         return streamInfoResult;
     }
     }
-
 }
 }

+ 3 - 4
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/service/impl/PlayServiceImpl.java

@@ -83,7 +83,7 @@ public class PlayServiceImpl implements IPlayService {
 
 
 
 
     @Override
     @Override
-    public PlayResult play(MediaServerItem mediaServerItem, String deviceId, String channelId, ZLMHttpHookSubscribe.Event hookEvent, SipSubscribe.Event errorEvent) {
+    public PlayResult play(MediaServerItem mediaServerItem, String deviceId, String channelId, ZLMHttpHookSubscribe.Event hookEvent, SipSubscribe.Event errorEvent, Integer dpi) {
         long timeOut = new Date().getTime();
         long timeOut = new Date().getTime();
         PlayResult playResult = new PlayResult();
         PlayResult playResult = new PlayResult();
         if (mediaServerItem == null) {
         if (mediaServerItem == null) {
@@ -201,7 +201,7 @@ public class PlayServiceImpl implements IPlayService {
                     errorEvent.response(event);
                     errorEvent.response(event);
                 }
                 }
 
 
-            });
+            }, dpi);
         } else {
         } else {
             String streamId = streamInfo.getStreamId();
             String streamId = streamInfo.getStreamId();
             if (streamId == null) {
             if (streamId == null) {
@@ -261,7 +261,7 @@ public class PlayServiceImpl implements IPlayService {
                     wvpResult.setMsg(String.format("点播失败, 错误码: %s, %s", response.getStatusCode(), response.getReasonPhrase()));
                     wvpResult.setMsg(String.format("点播失败, 错误码: %s, %s", response.getStatusCode(), response.getReasonPhrase()));
                     msg.setData(wvpResult);
                     msg.setData(wvpResult);
                     resultHolder.invokeResult(msg);
                     resultHolder.invokeResult(msg);
-                });
+                }, dpi);
             }
             }
         }
         }
         while (true){
         while (true){
@@ -350,5 +350,4 @@ public class PlayServiceImpl implements IPlayService {
         streamInfo.setChannelId(channelId);
         streamInfo.setChannelId(channelId);
         return streamInfo;
         return streamInfo;
     }
     }
-
 }
 }

+ 0 - 1
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/service/impl/StreamProxyServiceImpl.java

@@ -209,7 +209,6 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
                 }
                 }
             }
             }
         }
         }
-
         return result;
         return result;
     }
     }
 }
 }

+ 0 - 2
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/service/impl/UserServiceImpl.java

@@ -51,6 +51,4 @@ public class UserServiceImpl implements IUserService {
     public int updateUsers(User user) {
     public int updateUsers(User user) {
         return userMapper.update(user);
         return userMapper.update(user);
     }
     }
-
-
 }
 }

+ 1 - 1
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/storager/impl/RedisCatchStorageImpl.java

@@ -39,7 +39,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
     @Override
     @Override
     public boolean startPlay(StreamInfo stream) {
     public boolean startPlay(StreamInfo stream) {
         return redis.set(String.format("%S_%s_%s_%s", VideoManagerConstants.PLAYER_PREFIX, stream.getStreamId(),stream.getDeviceID(), stream.getChannelId()),
         return redis.set(String.format("%S_%s_%s_%s", VideoManagerConstants.PLAYER_PREFIX, stream.getStreamId(),stream.getDeviceID(), stream.getChannelId()),
-                stream);
+                stream, VideoManagerConstants.REDIS_ERPIRE);
     }
     }
 
 
     /**
     /**

+ 0 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/utils/JarFileUtils.java

@@ -65,9 +65,6 @@ public class JarFileUtils {
                 e.printStackTrace();
                 e.printStackTrace();
             }
             }
         }
         }
-
         return map;
         return map;
-
     }
     }
-
 }
 }

+ 0 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/vmanager/gb28181/media/MediaController.java

@@ -61,7 +61,4 @@ public class MediaController {
         }
         }
         return result;
         return result;
     }
     }
-
-
-
 }
 }

+ 6 - 6
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/vmanager/gb28181/play/PlayController.java

@@ -76,14 +76,14 @@ public class PlayController {
     @ApiOperation("开始点播")
     @ApiOperation("开始点播")
     @ApiImplicitParams({
     @ApiImplicitParams({
             @ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
             @ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class),
-            @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class)})
+            @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class),
+			@ApiImplicitParam(name = "dpi", value = "分辨率", dataTypeClass = Integer.class)})
     @GetMapping("/start/{deviceId}/{channelId}")
     @GetMapping("/start/{deviceId}/{channelId}")
-    public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, @PathVariable String channelId) {
-
+    public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, @PathVariable String channelId, @PathVariable Integer dpi) {
 		// 获取可用的zlm
 		// 获取可用的zlm
 		Device device = storager.queryVideoDevice(deviceId);
 		Device device = storager.queryVideoDevice(deviceId);
 		MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device);
 		MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device);
-		PlayResult playResult = playService.play(newMediaServerItem, deviceId, channelId, null, null);
+		PlayResult playResult = playService.play(newMediaServerItem, deviceId, channelId, null, null, dpi);
 
 
 		return playResult.getResult();
 		return playResult.getResult();
 	}
 	}
@@ -94,7 +94,7 @@ public class PlayController {
             @ApiImplicitParam(name = "page", value = "当前页", required = true, dataTypeClass = Integer.class),
             @ApiImplicitParam(name = "page", value = "当前页", required = true, dataTypeClass = Integer.class),
             @ApiImplicitParam(name = "count", value = "每页查询数量", required = true, dataTypeClass = Integer.class)})
             @ApiImplicitParam(name = "count", value = "每页查询数量", required = true, dataTypeClass = Integer.class)})
     @GetMapping("/startList")
     @GetMapping("/startList")
-    public Map<String, Object> play(String deviceIds, int page, int count) {
+    public Map<String, Object> play(String deviceIds, Integer dpi, int page, int count) {
         if (deviceIds==null || ("").equals(deviceIds)) {
         if (deviceIds==null || ("").equals(deviceIds)) {
             Map<String, Object> map = new HashMap<>();
             Map<String, Object> map = new HashMap<>();
             map.put("code", "500");
             map.put("code", "500");
@@ -111,7 +111,7 @@ public class PlayController {
 				// 获取可用的zlm
 				// 获取可用的zlm
 				Device device = storager.queryVideoDevice(deviceChannel.getDeviceId());
 				Device device = storager.queryVideoDevice(deviceChannel.getDeviceId());
 				MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device);
 				MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device);
-				PlayResult playResult = playService.play(newMediaServerItem, deviceChannel.getDeviceId(), deviceChannel.getChannelId(), null, null);
+				PlayResult playResult = playService.play(newMediaServerItem, deviceChannel.getDeviceId(), deviceChannel.getChannelId(), null, null, dpi);
 				if (playResult != null && playResult.getResult() != null) {
 				if (playResult != null && playResult.getResult() != null) {
 					DeferredResult<ResponseEntity<String>> result = playResult.getResult();
 					DeferredResult<ResponseEntity<String>> result = playResult.getResult();
 					if (result != null && result.getResult() != null) {
 					if (result != null && result.getResult() != null) {

+ 2 - 3
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/vmanager/gb28181/playback/DownloadController.java

@@ -71,7 +71,7 @@ public class DownloadController {
 	})
 	})
 	@GetMapping("/start/{deviceId}/{channelId}")
 	@GetMapping("/start/{deviceId}/{channelId}")
 	public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, @PathVariable String channelId,
 	public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, @PathVariable String channelId,
-													   String startTime, String endTime, String downloadSpeed) {
+													   Integer dpi, String startTime, String endTime, String downloadSpeed) {
 
 
 		if (logger.isDebugEnabled()) {
 		if (logger.isDebugEnabled()) {
 			logger.debug(String.format("历史媒体下载 API调用,deviceId:%s,channelId:%s,downloadSpeed:%s", deviceId, channelId, downloadSpeed));
 			logger.debug(String.format("历史媒体下载 API调用,deviceId:%s,channelId:%s,downloadSpeed:%s", deviceId, channelId, downloadSpeed));
@@ -104,7 +104,6 @@ public class DownloadController {
 		}
 		}
 
 
 		SSRCInfo ssrcInfo = mediaServerService.openRTPServer(newMediaServerItem, null);
 		SSRCInfo ssrcInfo = mediaServerService.openRTPServer(newMediaServerItem, null);
-
 		cmder.downloadStreamCmd(newMediaServerItem, ssrcInfo, device, channelId, startTime, endTime, downloadSpeed, (MediaServerItem mediaServerItem, JSONObject response) -> {
 		cmder.downloadStreamCmd(newMediaServerItem, ssrcInfo, device, channelId, startTime, endTime, downloadSpeed, (MediaServerItem mediaServerItem, JSONObject response) -> {
 			logger.info("收到订阅消息: " + response.toJSONString());
 			logger.info("收到订阅消息: " + response.toJSONString());
 			playService.onPublishHandlerForPlayBack(mediaServerItem, response, deviceId, channelId, uuid.toString());
 			playService.onPublishHandlerForPlayBack(mediaServerItem, response, deviceId, channelId, uuid.toString());
@@ -114,7 +113,7 @@ public class DownloadController {
 			msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
 			msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
 			msg.setData(String.format("回放失败, 错误码: %s, %s", response.getStatusCode(), response.getReasonPhrase()));
 			msg.setData(String.format("回放失败, 错误码: %s, %s", response.getStatusCode(), response.getReasonPhrase()));
 			resultHolder.invokeResult(msg);
 			resultHolder.invokeResult(msg);
-		});
+		}, dpi);
 
 
 		return result;
 		return result;
 	}
 	}

+ 2 - 8
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/vmanager/gb28181/playback/PlaybackController.java

@@ -3,7 +3,6 @@ package com.zd.alg.iot.vmp.vmanager.gb28181.playback;
 import com.zd.alg.iot.vmp.common.StreamInfo;
 import com.zd.alg.iot.vmp.common.StreamInfo;
 import com.zd.alg.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
 import com.zd.alg.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
 import com.zd.alg.iot.vmp.gb28181.transmit.callback.RequestMessage;
 import com.zd.alg.iot.vmp.gb28181.transmit.callback.RequestMessage;
-//import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
 import com.zd.alg.iot.vmp.media.zlm.dto.MediaServerItem;
 import com.zd.alg.iot.vmp.media.zlm.dto.MediaServerItem;
 import com.zd.alg.iot.vmp.service.IMediaServerService;
 import com.zd.alg.iot.vmp.service.IMediaServerService;
 import com.zd.alg.iot.vmp.service.bean.SSRCInfo;
 import com.zd.alg.iot.vmp.service.bean.SSRCInfo;
@@ -24,12 +23,10 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
-
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.zd.alg.iot.vmp.gb28181.bean.Device;
 import com.zd.alg.iot.vmp.gb28181.bean.Device;
 import com.zd.alg.iot.vmp.storager.IVideoManagerStorager;
 import com.zd.alg.iot.vmp.storager.IVideoManagerStorager;
 import org.springframework.web.context.request.async.DeferredResult;
 import org.springframework.web.context.request.async.DeferredResult;
-
 import javax.sip.message.Response;
 import javax.sip.message.Response;
 import java.util.UUID;
 import java.util.UUID;
 
 
@@ -50,9 +47,6 @@ public class PlaybackController {
 	@Autowired
 	@Autowired
 	private IRedisCatchStorage redisCatchStorage;
 	private IRedisCatchStorage redisCatchStorage;
 
 
-	// @Autowired
-	// private ZLMRESTfulUtils zlmresTfulUtils;
-
 	@Autowired
 	@Autowired
 	private IPlayService playService;
 	private IPlayService playService;
 
 
@@ -71,7 +65,7 @@ public class PlaybackController {
 	})
 	})
 	@GetMapping("/start/{deviceId}/{channelId}")
 	@GetMapping("/start/{deviceId}/{channelId}")
 	public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, @PathVariable String channelId,
 	public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, @PathVariable String channelId,
-													   String startTime,String endTime) {
+													   Integer dpi, String startTime,String endTime) {
 
 
 		if (logger.isDebugEnabled()) {
 		if (logger.isDebugEnabled()) {
 			logger.debug(String.format("设备回放 API调用,deviceId:%s ,channelId:%s", deviceId, channelId));
 			logger.debug(String.format("设备回放 API调用,deviceId:%s ,channelId:%s", deviceId, channelId));
@@ -121,7 +115,7 @@ public class PlaybackController {
 			msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
 			msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
 			msg.setData(String.format("回放失败, 错误码: %s, %s", response.getStatusCode(), response.getReasonPhrase()));
 			msg.setData(String.format("回放失败, 错误码: %s, %s", response.getStatusCode(), response.getReasonPhrase()));
 			resultHolder.invokeResult(msg);
 			resultHolder.invokeResult(msg);
-		});
+		}, dpi);
 
 
 		return result;
 		return result;
 	}
 	}

+ 0 - 51
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/vmanager/record/RecordController.java

@@ -1,51 +0,0 @@
-package com.zd.alg.iot.vmp.vmanager.record;//package com.genersoft.iot.vmp.vmanager.record;
-//
-//import com.alibaba.fastjson.JSONObject;
-//import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
-//import com.genersoft.iot.vmp.service.IRecordInfoServer;
-//import com.genersoft.iot.vmp.storager.dao.dto.RecordInfo;
-//import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
-//import com.github.pagehelper.PageInfo;
-//import io.swagger.annotations.Api;
-//import io.swagger.annotations.ApiImplicitParam;
-//import io.swagger.annotations.ApiImplicitParams;
-//import io.swagger.annotations.ApiOperation;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.web.bind.annotation.*;
-//
-//@Api(tags = "云端录像")
-//@CrossOrigin
-//@RestController
-//@RequestMapping("/api/record")
-//public class RecordController {
-//
-//    @Autowired
-//    private IRecordInfoServer recordInfoServer;
-//
-//    @ApiOperation("录像列表查询")
-//    @ApiImplicitParams({
-//            @ApiImplicitParam(name="page", value = "当前页", required = true, dataTypeClass = Integer.class),
-//            @ApiImplicitParam(name="count", value = "每页查询数量", required = true, dataTypeClass = Integer.class),
-//            @ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class),
-//    })
-//    @GetMapping(value = "/app/list")
-//    @ResponseBody
-//    public Object list(@RequestParam(required = false)Integer page,
-//                                     @RequestParam(required = false)Integer count ){
-//
-//        PageInfo<RecordInfo> recordList = recordInfoServer.getRecordList(page - 1, page - 1 + count);
-//        return recordList;
-//    }
-//
-//    @ApiOperation("获取录像详情")
-//    @ApiImplicitParams({
-//            @ApiImplicitParam(name="recordInfo", value = "录像记录", required = true, dataTypeClass = RecordInfo.class)
-//    })
-//    @GetMapping(value = "/detail")
-//    @ResponseBody
-//    public JSONObject list(RecordInfo recordInfo, String time ){
-//
-//
-//        return null;
-//    }
-//}

+ 0 - 22
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/web/ApiController.java

@@ -53,28 +53,6 @@ public class ApiController {
 
 
     @RequestMapping(value = "/userinfo")
     @RequestMapping(value = "/userinfo")
     private JSONObject userinfo(){
     private JSONObject userinfo(){
-//        JSONObject result = new JSONObject();
-//        result.put("ID","ceshi");
-//        result.put("Hardware","");
-//        result.put("InterfaceVersion","2.5.5");
-//        result.put("IsDemo","");
-//        result.put("Hardware","false");
-//        result.put("APIAuth","false");
-//        result.put("RemainDays","永久");
-//        result.put("RunningTime","");
-//        result.put("ServerTime","2020-09-02 17:11");
-//        result.put("StartUpTime","2020-09-02 17:11");
-//        result.put("Server","");
-//        result.put("SIPSerial", sipConfig.getId());
-//        result.put("SIPRealm", sipConfig.getDomain());
-//        result.put("SIPHost", sipConfig.getIp());
-//        result.put("SIPPort", sipConfig.getPort());
-//        result.put("ChannelCount","1000");
-//        result.put("VersionType","");
-//        result.put("LogoMiniText","");
-//        result.put("LogoText","");
-//        result.put("CopyrightText","");
-
         return null;
         return null;
     }
     }
 
 

+ 0 - 9
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/web/ApiDeviceController.java

@@ -27,15 +27,6 @@ public class ApiDeviceController {
     @Autowired
     @Autowired
     private IVideoManagerStorager storager;
     private IVideoManagerStorager storager;
 
 
-    // @Autowired
-    // private SIPCommander cmder;
-
-    // @Autowired
-    // private DeferredResultHolder resultHolder;
-
-    // @Autowired
-    // private DeviceOffLineDetector offLineDetector;
-
     /**
     /**
      * 分页获取设备列表 TODO 现在直接返回,尚未实现分页
      * 分页获取设备列表 TODO 现在直接返回,尚未实现分页
      * @param start
      * @param start

+ 2 - 6
zd-modules/zd-algorithm/src/main/java/com/zd/alg/iot/vmp/web/ApiStreamController.java

@@ -36,11 +36,6 @@ public class ApiStreamController {
     @Autowired
     @Autowired
     private IRedisCatchStorage redisCatchStorage;
     private IRedisCatchStorage redisCatchStorage;
 
 
-
-    // @Autowired
-    // private ZLMRESTfulUtils zlmresTfulUtils;
-
-
     @Autowired
     @Autowired
     private PlayController playController;
     private PlayController playController;
 
 
@@ -61,6 +56,7 @@ public class ApiStreamController {
     private DeferredResult<JSONObject> start(String serial ,
     private DeferredResult<JSONObject> start(String serial ,
                                              @RequestParam(required = false)Integer channel ,
                                              @RequestParam(required = false)Integer channel ,
                                              @RequestParam(required = false)String code,
                                              @RequestParam(required = false)String code,
+                                             @RequestParam(required = false)Integer dpi,
                                              @RequestParam(required = false)String cdn,
                                              @RequestParam(required = false)String cdn,
                                              @RequestParam(required = false)String audio,
                                              @RequestParam(required = false)String audio,
                                              @RequestParam(required = false)String transport,
                                              @RequestParam(required = false)String transport,
@@ -99,7 +95,7 @@ public class ApiStreamController {
             result.put("error","channel[ " + code + " ]offline");
             result.put("error","channel[ " + code + " ]offline");
             resultDeferredResult.setResult(result);
             resultDeferredResult.setResult(result);
         }
         }
-        DeferredResult<ResponseEntity<String>> play = playController.play(serial, code);
+        DeferredResult<ResponseEntity<String>> play = playController.play(serial, code, dpi);
 
 
         play.setResultHandler((Object o)->{
         play.setResultHandler((Object o)->{
             ResponseEntity<String> responseEntity = (ResponseEntity)o;
             ResponseEntity<String> responseEntity = (ResponseEntity)o;

+ 4 - 4
zd-modules/zd-base/src/main/java/com/zd/base/files/bigupload/controller/UploadController.java

@@ -23,7 +23,7 @@ public class UploadController {
     private IUploadService uploadService;
     private IUploadService uploadService;
 
 
     /**
     /**
-     * 检查分片是否存
+     * 检查分片是否存��
      *
      *
      * @return
      * @return
      */
      */
@@ -39,9 +39,9 @@ public class UploadController {
     }
     }
 
 
     /**
     /**
-     * 检查分片是否存
+     * 检查分片是否存��
      * @param identifier  文件秘钥
      * @param identifier  文件秘钥
-     * @param filename 文件
+     * @param filename 文件��
      * @param totalChunks 分片总数
      * @param totalChunks 分片总数
      * @return
      * @return
      */
      */
@@ -51,7 +51,7 @@ public class UploadController {
                                               @RequestParam("totalChunks") Integer totalChunks) {
                                               @RequestParam("totalChunks") Integer totalChunks) {
         FileChunkResultDTO fileChunkCheckDTO;
         FileChunkResultDTO fileChunkCheckDTO;
         try {
         try {
-            log.info("apk文件上传入参 identifier {}filename {}, totalChunks {}", identifier, filename, totalChunks);
+            log.info("apk文件上传入参 identifier {}��filename {}, totalChunks {}", identifier, filename, totalChunks);
             FileChunkDTO chunkDTO = new FileChunkDTO();
             FileChunkDTO chunkDTO = new FileChunkDTO();
             chunkDTO.setIdentifier(identifier);
             chunkDTO.setIdentifier(identifier);
             chunkDTO.setFilename(filename);
             chunkDTO.setFilename(filename);