Commit 76e8480cb1198786d9f0f1268bfa8504ca88b877
1 parent
b3eb319e
去除多余方法
Showing
2 changed files
with
1 additions
and
29 deletions
src/main/java/com/genersoft/iot/vmp/service/IPlayService.java
| @@ -4,7 +4,6 @@ import com.genersoft.iot.vmp.common.StreamInfo; | @@ -4,7 +4,6 @@ import com.genersoft.iot.vmp.common.StreamInfo; | ||
| 4 | import com.genersoft.iot.vmp.conf.exception.ServiceException; | 4 | import com.genersoft.iot.vmp.conf.exception.ServiceException; |
| 5 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 5 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 6 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; | 6 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| 7 | -import com.genersoft.iot.vmp.service.bean.DownloadFileInfo; | ||
| 8 | import com.genersoft.iot.vmp.service.bean.ErrorCallback; | 7 | import com.genersoft.iot.vmp.service.bean.ErrorCallback; |
| 9 | import com.genersoft.iot.vmp.service.bean.SSRCInfo; | 8 | import com.genersoft.iot.vmp.service.bean.SSRCInfo; |
| 10 | 9 | ||
| @@ -23,11 +22,6 @@ public interface IPlayService { | @@ -23,11 +22,6 @@ public interface IPlayService { | ||
| 23 | 22 | ||
| 24 | MediaServerItem getNewMediaServerItem(Device device); | 23 | MediaServerItem getNewMediaServerItem(Device device); |
| 25 | 24 | ||
| 26 | - /** | ||
| 27 | - * 获取包含assist服务的节点 | ||
| 28 | - */ | ||
| 29 | - MediaServerItem getNewMediaServerItemHasAssist(Device device); | ||
| 30 | - | ||
| 31 | void playBack(String deviceId, String channelId, String startTime, String endTime, ErrorCallback<Object> callback); | 25 | void playBack(String deviceId, String channelId, String startTime, String endTime, ErrorCallback<Object> callback); |
| 32 | void playBack(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, String deviceId, String channelId, String startTime, String endTime, ErrorCallback<Object> callback); | 26 | void playBack(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, String deviceId, String channelId, String startTime, String endTime, ErrorCallback<Object> callback); |
| 33 | void zlmServerOffline(String mediaServerId); | 27 | void zlmServerOffline(String mediaServerId); |
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| 1 | package com.genersoft.iot.vmp.service.impl; | 1 | package com.genersoft.iot.vmp.service.impl; |
| 2 | 2 | ||
| 3 | -import com.alibaba.fastjson2.JSON; | ||
| 4 | import com.alibaba.fastjson2.JSONArray; | 3 | import com.alibaba.fastjson2.JSONArray; |
| 5 | import com.alibaba.fastjson2.JSONObject; | 4 | import com.alibaba.fastjson2.JSONObject; |
| 6 | import com.genersoft.iot.vmp.common.InviteInfo; | 5 | import com.genersoft.iot.vmp.common.InviteInfo; |
| @@ -15,11 +14,9 @@ import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; | @@ -15,11 +14,9 @@ import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; | ||
| 15 | import com.genersoft.iot.vmp.gb28181.bean.*; | 14 | import com.genersoft.iot.vmp.gb28181.bean.*; |
| 16 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; | 15 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; |
| 17 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; | 16 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| 18 | -import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | ||
| 19 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | 17 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 20 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; | 18 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; |
| 21 | import com.genersoft.iot.vmp.gb28181.utils.SipUtils; | 19 | import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| 22 | -import com.genersoft.iot.vmp.media.zlm.AssistRESTfulUtils; | ||
| 23 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; | 20 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| 24 | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; | 21 | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| 25 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; | 22 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| @@ -50,11 +47,9 @@ import java.io.File; | @@ -50,11 +47,9 @@ import java.io.File; | ||
| 50 | import java.math.BigDecimal; | 47 | import java.math.BigDecimal; |
| 51 | import java.math.RoundingMode; | 48 | import java.math.RoundingMode; |
| 52 | import java.text.ParseException; | 49 | import java.text.ParseException; |
| 53 | -import java.time.Instant; | ||
| 54 | import java.util.List; | 50 | import java.util.List; |
| 55 | import java.util.UUID; | 51 | import java.util.UUID; |
| 56 | import java.util.Vector; | 52 | import java.util.Vector; |
| 57 | -import java.util.concurrent.TimeUnit; | ||
| 58 | 53 | ||
| 59 | @SuppressWarnings(value = {"rawtypes", "unchecked"}) | 54 | @SuppressWarnings(value = {"rawtypes", "unchecked"}) |
| 60 | @Service | 55 | @Service |
| @@ -440,23 +435,6 @@ public class PlayServiceImpl implements IPlayService { | @@ -440,23 +435,6 @@ public class PlayServiceImpl implements IPlayService { | ||
| 440 | } | 435 | } |
| 441 | 436 | ||
| 442 | @Override | 437 | @Override |
| 443 | - public MediaServerItem getNewMediaServerItemHasAssist(Device device) { | ||
| 444 | - if (device == null) { | ||
| 445 | - return null; | ||
| 446 | - } | ||
| 447 | - MediaServerItem mediaServerItem; | ||
| 448 | - if (ObjectUtils.isEmpty(device.getMediaServerId()) || "auto".equals(device.getMediaServerId())) { | ||
| 449 | - mediaServerItem = mediaServerService.getMediaServerForMinimumLoad(true); | ||
| 450 | - } else { | ||
| 451 | - mediaServerItem = mediaServerService.getOne(device.getMediaServerId()); | ||
| 452 | - } | ||
| 453 | - if (mediaServerItem == null) { | ||
| 454 | - logger.warn("[获取可用的ZLM节点]未找到可使用的ZLM..."); | ||
| 455 | - } | ||
| 456 | - return mediaServerItem; | ||
| 457 | - } | ||
| 458 | - | ||
| 459 | - @Override | ||
| 460 | public void playBack(String deviceId, String channelId, String startTime, | 438 | public void playBack(String deviceId, String channelId, String startTime, |
| 461 | String endTime, ErrorCallback<Object> callback) { | 439 | String endTime, ErrorCallback<Object> callback) { |
| 462 | Device device = storager.queryVideoDevice(deviceId); | 440 | Device device = storager.queryVideoDevice(deviceId); |
| @@ -662,7 +640,7 @@ public class PlayServiceImpl implements IPlayService { | @@ -662,7 +640,7 @@ public class PlayServiceImpl implements IPlayService { | ||
| 662 | if (device == null) { | 640 | if (device == null) { |
| 663 | return; | 641 | return; |
| 664 | } | 642 | } |
| 665 | - MediaServerItem newMediaServerItem = getNewMediaServerItemHasAssist(device); | 643 | + MediaServerItem newMediaServerItem = this.getNewMediaServerItem(device); |
| 666 | if (newMediaServerItem == null) { | 644 | if (newMediaServerItem == null) { |
| 667 | callback.run(InviteErrorCode.ERROR_FOR_ASSIST_NOT_READY.getCode(), | 645 | callback.run(InviteErrorCode.ERROR_FOR_ASSIST_NOT_READY.getCode(), |
| 668 | InviteErrorCode.ERROR_FOR_ASSIST_NOT_READY.getMsg(), | 646 | InviteErrorCode.ERROR_FOR_ASSIST_NOT_READY.getMsg(), |