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 | 4 | import com.genersoft.iot.vmp.conf.exception.ServiceException; |
| 5 | 5 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 6 | 6 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| 7 | -import com.genersoft.iot.vmp.service.bean.DownloadFileInfo; | |
| 8 | 7 | import com.genersoft.iot.vmp.service.bean.ErrorCallback; |
| 9 | 8 | import com.genersoft.iot.vmp.service.bean.SSRCInfo; |
| 10 | 9 | |
| ... | ... | @@ -23,11 +22,6 @@ public interface IPlayService { |
| 23 | 22 | |
| 24 | 23 | MediaServerItem getNewMediaServerItem(Device device); |
| 25 | 24 | |
| 26 | - /** | |
| 27 | - * 获取包含assist服务的节点 | |
| 28 | - */ | |
| 29 | - MediaServerItem getNewMediaServerItemHasAssist(Device device); | |
| 30 | - | |
| 31 | 25 | void playBack(String deviceId, String channelId, String startTime, String endTime, ErrorCallback<Object> callback); |
| 32 | 26 | void playBack(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, String deviceId, String channelId, String startTime, String endTime, ErrorCallback<Object> callback); |
| 33 | 27 | void zlmServerOffline(String mediaServerId); | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| 1 | 1 | package com.genersoft.iot.vmp.service.impl; |
| 2 | 2 | |
| 3 | -import com.alibaba.fastjson2.JSON; | |
| 4 | 3 | import com.alibaba.fastjson2.JSONArray; |
| 5 | 4 | import com.alibaba.fastjson2.JSONObject; |
| 6 | 5 | import com.genersoft.iot.vmp.common.InviteInfo; |
| ... | ... | @@ -15,11 +14,9 @@ import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; |
| 15 | 14 | import com.genersoft.iot.vmp.gb28181.bean.*; |
| 16 | 15 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; |
| 17 | 16 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| 18 | -import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | |
| 19 | 17 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 20 | 18 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; |
| 21 | 19 | import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| 22 | -import com.genersoft.iot.vmp.media.zlm.AssistRESTfulUtils; | |
| 23 | 20 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| 24 | 21 | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| 25 | 22 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| ... | ... | @@ -50,11 +47,9 @@ import java.io.File; |
| 50 | 47 | import java.math.BigDecimal; |
| 51 | 48 | import java.math.RoundingMode; |
| 52 | 49 | import java.text.ParseException; |
| 53 | -import java.time.Instant; | |
| 54 | 50 | import java.util.List; |
| 55 | 51 | import java.util.UUID; |
| 56 | 52 | import java.util.Vector; |
| 57 | -import java.util.concurrent.TimeUnit; | |
| 58 | 53 | |
| 59 | 54 | @SuppressWarnings(value = {"rawtypes", "unchecked"}) |
| 60 | 55 | @Service |
| ... | ... | @@ -440,23 +435,6 @@ public class PlayServiceImpl implements IPlayService { |
| 440 | 435 | } |
| 441 | 436 | |
| 442 | 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 | 438 | public void playBack(String deviceId, String channelId, String startTime, |
| 461 | 439 | String endTime, ErrorCallback<Object> callback) { |
| 462 | 440 | Device device = storager.queryVideoDevice(deviceId); |
| ... | ... | @@ -662,7 +640,7 @@ public class PlayServiceImpl implements IPlayService { |
| 662 | 640 | if (device == null) { |
| 663 | 641 | return; |
| 664 | 642 | } |
| 665 | - MediaServerItem newMediaServerItem = getNewMediaServerItemHasAssist(device); | |
| 643 | + MediaServerItem newMediaServerItem = this.getNewMediaServerItem(device); | |
| 666 | 644 | if (newMediaServerItem == null) { |
| 667 | 645 | callback.run(InviteErrorCode.ERROR_FOR_ASSIST_NOT_READY.getCode(), |
| 668 | 646 | InviteErrorCode.ERROR_FOR_ASSIST_NOT_READY.getMsg(), | ... | ... |