From f34eb9c9e6b61b596d0085e9a2baec48628b23e1 Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: 星期四, 14 一月 2021 23:53:57 +0800 Subject: [PATCH] 通道查询排序输出,避免列表杂乱无章 --- src/main/java/com/genersoft/iot/vmp/vmanager/service/impl/PlayServiceImpl.java | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/service/impl/PlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/vmanager/service/impl/PlayServiceImpl.java index 6ce0868..70ca1f3 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/service/impl/PlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/service/impl/PlayServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; import com.genersoft.iot.vmp.common.StreamInfo; import com.genersoft.iot.vmp.conf.MediaServerConfig; +import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; @@ -37,6 +38,12 @@ msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); StreamInfo streamInfo = onPublishHandler(resonse, deviceId, channelId, uuid); if (streamInfo != null) { + DeviceChannel deviceChannel = storager.queryChannel(deviceId, channelId); + if (deviceChannel != null) { + deviceChannel.setStreamId(streamInfo.getStreamId()); + storager.startPlay(deviceId, channelId, streamInfo.getStreamId()); + } + redisCatchStorage.startPlay(streamInfo); msg.setData(JSON.toJSONString(streamInfo)); resultHolder.invokeResult(msg); @@ -68,7 +75,7 @@ StreamInfo streamInfo = new StreamInfo(); streamInfo.setStreamId(streamId); streamInfo.setDeviceID(deviceId); - streamInfo.setCahnnelId(channelId); + streamInfo.setChannelId(channelId); MediaServerConfig mediaServerConfig = redisCatchStorage.getMediaInfo(); streamInfo.setFlv(String.format("http://%s:%s/rtp/%s.flv", mediaServerConfig.getWanIp(), mediaServerConfig.getHttpPort(), streamId)); -- Gitblit v1.8.0