diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/controller/PlayController.java b/src/main/java/com/genersoft/iot/vmp/gb28181/controller/PlayController.java index e5087cba..b99a00bf 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/controller/PlayController.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/controller/PlayController.java @@ -21,7 +21,6 @@ import com.genersoft.iot.vmp.media.bean.MediaServer; import com.genersoft.iot.vmp.media.service.IMediaServerService; import com.genersoft.iot.vmp.service.bean.ErrorCallback; import com.genersoft.iot.vmp.service.bean.InviteErrorCode; -import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcPlayService; import com.genersoft.iot.vmp.utils.DateUtil; import com.genersoft.iot.vmp.vmanager.bean.AudioBroadcastResult; import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; @@ -66,9 +65,6 @@ public class PlayController { @Autowired private IPlayService playService; - @Autowired - private IRedisRpcPlayService redisRpcPlayService; - @Autowired private IMediaServerService mediaServerService; @@ -153,12 +149,7 @@ public class PlayController { // 此处必须释放所有请求 resultHolder.invokeAllResult(requestMessage); }; - // 判断设备是否属于当前平台, 如果不属于则发起自动调用 - if (userSetting.getServerId().equals(device.getServerId())) { - redisRpcPlayService.play(device.getServerId(), channel.getId(), callback); - }else { - playService.play(device, channel, callback); - } + playService.play(device, channel, callback); return result; } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/DeviceMapper.java b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/DeviceMapper.java index 07b18676..b33f906b 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/DeviceMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/DeviceMapper.java @@ -365,6 +365,7 @@ public interface DeviceMapper { "geo_coord_sys,"+ "on_line,"+ "media_server_id,"+ + "server_id,"+ "(SELECT count(0) FROM wvp_device_channel dc WHERE dc.device_db_id= de.id) as channel_count " + " FROM wvp_device de" + " where 1 = 1 "+ diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlayServiceImpl.java index 8b3d9f06..e631a6cd 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/PlayServiceImpl.java @@ -31,6 +31,7 @@ import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo; import com.genersoft.iot.vmp.service.IReceiveRtpServerService; import com.genersoft.iot.vmp.service.ISendRtpServerService; import com.genersoft.iot.vmp.service.bean.*; +import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcPlayService; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.utils.CloudRecordUtils; import com.genersoft.iot.vmp.utils.DateUtil; @@ -123,6 +124,9 @@ public class PlayServiceImpl implements IPlayService { @Autowired private ICloudRecordService cloudRecordService; + @Autowired + private IRedisRpcPlayService redisRpcPlayService; + /** * 流到来的处理 */ @@ -287,12 +291,18 @@ public class PlayServiceImpl implements IPlayService { @Override public void play(Device device, DeviceChannel channel, ErrorCallback callback) { - MediaServer mediaServerItem = getNewMediaServerItem(device); - if (mediaServerItem == null) { - log.warn("[点播] 未找到可用的zlm deviceId: {},channelId:{}", device.getDeviceId(), channel.getDeviceId()); - throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到可用的zlm"); + + // 判断设备是否属于当前平台, 如果不属于则发起自动调用 + if (userSetting.getServerId().equals(device.getServerId())) { + redisRpcPlayService.play(device.getServerId(), channel.getId(), callback); + }else { + MediaServer mediaServerItem = getNewMediaServerItem(device); + if (mediaServerItem == null) { + log.warn("[点播] 未找到可用的zlm deviceId: {},channelId:{}", device.getDeviceId(), channel.getDeviceId()); + throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到可用的zlm"); + } + play(mediaServerItem, device, channel, null, callback); } - play(mediaServerItem, device, channel, null, callback); } @Override @@ -1660,13 +1670,8 @@ public class PlayServiceImpl implements IPlayService { log.warn("[点播] 未找到通道{}的设备信息", channel); throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error"); } - MediaServer mediaServer = getNewMediaServerItem(device); - if (mediaServer == null) { - log.warn("[点播] 未找到可用媒体节点"); - throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error"); - } DeviceChannel deviceChannel = deviceChannelService.getOneForSourceById(channel.getGbId()); - play(mediaServer, device, deviceChannel, null, callback); + play(device, deviceChannel, callback); } @Override diff --git a/web_src/src/components/DeviceList.vue b/web_src/src/components/DeviceList.vue index 7525def5..f9240f64 100755 --- a/web_src/src/components/DeviceList.vue +++ b/web_src/src/components/DeviceList.vue @@ -15,7 +15,7 @@ 添加设备 - 平台信息 + 平台信息 @@ -53,7 +53,8 @@ @@ -62,11 +63,6 @@ - - - - -