diff --git a/src/main/java/com/genersoft/iot/vmp/media/service/IMediaNodeServerService.java b/src/main/java/com/genersoft/iot/vmp/media/service/IMediaNodeServerService.java index 971f48a6..2f8983b5 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/service/IMediaNodeServerService.java +++ b/src/main/java/com/genersoft/iot/vmp/media/service/IMediaNodeServerService.java @@ -27,5 +27,5 @@ public interface IMediaNodeServerService { boolean deleteRecordDirectory(MediaServerItem mediaServerItem, String app, String stream, String date, String fileName); - List getMediaList(MediaServerItem mediaServerItem, String app, String stream); + List getMediaList(MediaServerItem mediaServerItem, String app, String stream, String callId); } diff --git a/src/main/java/com/genersoft/iot/vmp/media/service/IMediaServerService.java b/src/main/java/com/genersoft/iot/vmp/media/service/IMediaServerService.java index ceaafc4b..2e5ab1f8 100755 --- a/src/main/java/com/genersoft/iot/vmp/media/service/IMediaServerService.java +++ b/src/main/java/com/genersoft/iot/vmp/media/service/IMediaServerService.java @@ -75,5 +75,5 @@ public interface IMediaServerService { boolean deleteRecordDirectory(MediaServerItem mediaServerItem, String app, String stream, String date, String fileName); - List getMediaList(MediaServerItem mediaInfo, String app, String stream); + List getMediaList(MediaServerItem mediaInfo, String app, String stream, String callId); } diff --git a/src/main/java/com/genersoft/iot/vmp/media/service/impl/MediaServerServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/media/service/impl/MediaServerServiceImpl.java index 54e3330c..af5f1c55 100755 --- a/src/main/java/com/genersoft/iot/vmp/media/service/impl/MediaServerServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/media/service/impl/MediaServerServiceImpl.java @@ -1,6 +1,5 @@ package com.genersoft.iot.vmp.media.service.impl; -import com.alibaba.fastjson2.JSONObject; import com.baomidou.dynamic.datasource.annotation.DS; import com.genersoft.iot.vmp.common.CommonCallback; import com.genersoft.iot.vmp.common.StreamInfo; @@ -556,12 +555,12 @@ public class MediaServerServiceImpl implements IMediaServerService { } @Override - public List getMediaList(MediaServerItem mediaServerItem, String app, String stream) { + public List getMediaList(MediaServerItem mediaServerItem, String app, String stream, String callId) { IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaServerItem.getType()); if (mediaNodeServerService == null) { logger.info("[getMediaList] 失败, mediaServerItem的类型: {},未找到对应的实现类", mediaServerItem.getType()); return new ArrayList<>(); } - return mediaNodeServerService.getMediaList(mediaServerItem, app, stream); + return mediaNodeServerService.getMediaList(mediaServerItem, app, stream, callId); } } diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaNodeServerService.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaNodeServerService.java index 55161a92..6d55ac05 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaNodeServerService.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaNodeServerService.java @@ -148,7 +148,7 @@ public class ZLMMediaNodeServerService implements IMediaNodeServerService { } @Override - public List getMediaList(MediaServerItem mediaServerItem, String app, String stream) { + public List getMediaList(MediaServerItem mediaServerItem, String app, String stream, String callId) { List streamInfoList = new ArrayList<>(); JSONObject mediaList = zlmresTfulUtils.getMediaList(mediaServerItem, app, stream); if (mediaList != null) { @@ -160,10 +160,9 @@ public class ZLMMediaNodeServerService implements IMediaNodeServerService { JSONObject mediaJSON = data.getJSONObject(0); JSONArray tracks = mediaJSON.getJSONArray("tracks"); - if (authority) { - streamInfo = getStreamInfoByAppAndStream(mediaServerItem, app, stream, tracks, null, calld, true); - }else { - streamInfo = getStreamInfoByAppAndStream(mediaServerItem, app, stream, tracks, null,null, true); + StreamInfo streamInfo = getStreamInfoByAppAndStream(mediaServerItem, app, stream, tracks, null, callId, true); + if (streamInfo != null) { + streamInfoList.add(streamInfo); } } } diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java index a1c56ee8..dbf1a914 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java @@ -242,7 +242,7 @@ public class DeviceServiceImpl implements IDeviceService { if (sendRtpItem != null) { redisCatchStorage.deleteSendRTPServer(deviceId, sendRtpItem.getChannelId(), null, null); MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); - mediaServerService.stopSendRtp(mediaInfo, sendRtpItem.getApp(), sendRtpItem.getStream()); + mediaServerService.stopSendRtp(mediaInfo, sendRtpItem.getApp(), sendRtpItem.getStream(), null); } audioBroadcastManager.del(deviceId, audioBroadcastCatch.getChannelId()); diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java index 67c46b32..b568ae23 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java @@ -1,14 +1,12 @@ package com.genersoft.iot.vmp.service.impl; -import com.alibaba.fastjson2.JSONArray; -import com.alibaba.fastjson2.JSONObject; import com.genersoft.iot.vmp.common.StreamInfo; import com.genersoft.iot.vmp.conf.MediaConfig; import com.genersoft.iot.vmp.media.bean.Track; +import com.genersoft.iot.vmp.media.service.IMediaServerService; import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo; -import com.genersoft.iot.vmp.media.service.IMediaServerService; import com.genersoft.iot.vmp.service.IMediaService; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import org.springframework.beans.factory.annotation.Autowired; @@ -53,7 +51,7 @@ public class MediaServiceImpl implements IMediaService { if (streamAuthorityInfo != null) { calld = streamAuthorityInfo.getCallId(); } - List streamInfoList = mediaServerService.getMediaList(mediaInfo, app, stream); + List streamInfoList = mediaServerService.getMediaList(mediaInfo, app, stream, calld); if (streamInfoList.isEmpty()) { return null; }else { diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java index 14f0fe2a..b9fd1dfa 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java @@ -122,7 +122,7 @@ public class StreamPushServiceImpl implements IStreamPushService { streamPushItem.setStream(item.getStream()); streamPushItem.setAliveSecond(item.getAliveSecond()); streamPushItem.setOriginSock(item.getOriginSock()); - streamPushItem.setTotalReaderCount(item.getTotalReaderCount()); + streamPushItem.setTotalReaderCount(item.getTotalReaderCount() + ""); streamPushItem.setOriginType(item.getOriginType()); streamPushItem.setOriginTypeStr(item.getOriginTypeStr()); streamPushItem.setOriginUrl(item.getOriginUrl()); diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisStreamMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisStreamMsgListener.java index f5f29487..5c332fd0 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisStreamMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisStreamMsgListener.java @@ -72,7 +72,7 @@ public class RedisStreamMsgListener implements MessageListener { onStreamChangedHookParam.setMediaServerId(mediaServerId); onStreamChangedHookParam.setCreateStamp(System.currentTimeMillis()/1000); onStreamChangedHookParam.setAliveSecond(0L); - onStreamChangedHookParam.setTotalReaderCount("0"); + onStreamChangedHookParam.setTotalReaderCount(0); onStreamChangedHookParam.setOriginType(0); onStreamChangedHookParam.setOriginTypeStr("0"); onStreamChangedHookParam.setOriginTypeStr("unknown"); diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/bean/StreamContent.java b/src/main/java/com/genersoft/iot/vmp/vmanager/bean/StreamContent.java index 2252a252..f1872ca7 100755 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/bean/StreamContent.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/bean/StreamContent.java @@ -171,7 +171,7 @@ public class StreamContent { } this.mediaServerId = streamInfo.getMediaServerId(); - this.track = streamInfo.getTracks(); + this.track = streamInfo.getTrack(); this.startTime = streamInfo.getStartTime(); this.endTime = streamInfo.getEndTime(); this.progress = streamInfo.getProgress(); @@ -389,12 +389,12 @@ public class StreamContent { this.mediaServerId = mediaServerId; } - public Object getTracks() { - return tracks; + public Track getTrack() { + return track; } - public void setTracks(Object tracks) { - this.tracks = tracks; + public void setTrack(Track track) { + this.track = track; } public String getStartTime() {