临时提交

pull/1411/head
648540858 2024-03-21 18:21:30 +08:00
parent f96250ef45
commit 913099291b
9 changed files with 18 additions and 22 deletions

View File

@ -27,5 +27,5 @@ public interface IMediaNodeServerService {
boolean deleteRecordDirectory(MediaServerItem mediaServerItem, String app, String stream, String date, String fileName); boolean deleteRecordDirectory(MediaServerItem mediaServerItem, String app, String stream, String date, String fileName);
List<StreamInfo> getMediaList(MediaServerItem mediaServerItem, String app, String stream); List<StreamInfo> getMediaList(MediaServerItem mediaServerItem, String app, String stream, String callId);
} }

View File

@ -75,5 +75,5 @@ public interface IMediaServerService {
boolean deleteRecordDirectory(MediaServerItem mediaServerItem, String app, String stream, String date, String fileName); boolean deleteRecordDirectory(MediaServerItem mediaServerItem, String app, String stream, String date, String fileName);
List<StreamInfo> getMediaList(MediaServerItem mediaInfo, String app, String stream); List<StreamInfo> getMediaList(MediaServerItem mediaInfo, String app, String stream, String callId);
} }

View File

@ -1,6 +1,5 @@
package com.genersoft.iot.vmp.media.service.impl; package com.genersoft.iot.vmp.media.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.genersoft.iot.vmp.common.CommonCallback; import com.genersoft.iot.vmp.common.CommonCallback;
import com.genersoft.iot.vmp.common.StreamInfo; import com.genersoft.iot.vmp.common.StreamInfo;
@ -556,12 +555,12 @@ public class MediaServerServiceImpl implements IMediaServerService {
} }
@Override @Override
public List<StreamInfo> getMediaList(MediaServerItem mediaServerItem, String app, String stream) { public List<StreamInfo> getMediaList(MediaServerItem mediaServerItem, String app, String stream, String callId) {
IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaServerItem.getType()); IMediaNodeServerService mediaNodeServerService = nodeServerServiceMap.get(mediaServerItem.getType());
if (mediaNodeServerService == null) { if (mediaNodeServerService == null) {
logger.info("[getMediaList] 失败, mediaServerItem的类型 {},未找到对应的实现类", mediaServerItem.getType()); logger.info("[getMediaList] 失败, mediaServerItem的类型 {},未找到对应的实现类", mediaServerItem.getType());
return new ArrayList<>(); return new ArrayList<>();
} }
return mediaNodeServerService.getMediaList(mediaServerItem, app, stream); return mediaNodeServerService.getMediaList(mediaServerItem, app, stream, callId);
} }
} }

View File

@ -148,7 +148,7 @@ public class ZLMMediaNodeServerService implements IMediaNodeServerService {
} }
@Override @Override
public List<StreamInfo> getMediaList(MediaServerItem mediaServerItem, String app, String stream) { public List<StreamInfo> getMediaList(MediaServerItem mediaServerItem, String app, String stream, String callId) {
List<StreamInfo> streamInfoList = new ArrayList<>(); List<StreamInfo> streamInfoList = new ArrayList<>();
JSONObject mediaList = zlmresTfulUtils.getMediaList(mediaServerItem, app, stream); JSONObject mediaList = zlmresTfulUtils.getMediaList(mediaServerItem, app, stream);
if (mediaList != null) { if (mediaList != null) {
@ -160,10 +160,9 @@ public class ZLMMediaNodeServerService implements IMediaNodeServerService {
JSONObject mediaJSON = data.getJSONObject(0); JSONObject mediaJSON = data.getJSONObject(0);
JSONArray tracks = mediaJSON.getJSONArray("tracks"); JSONArray tracks = mediaJSON.getJSONArray("tracks");
if (authority) { StreamInfo streamInfo = getStreamInfoByAppAndStream(mediaServerItem, app, stream, tracks, null, callId, true);
streamInfo = getStreamInfoByAppAndStream(mediaServerItem, app, stream, tracks, null, calld, true); if (streamInfo != null) {
}else { streamInfoList.add(streamInfo);
streamInfo = getStreamInfoByAppAndStream(mediaServerItem, app, stream, tracks, null,null, true);
} }
} }
} }

View File

@ -242,7 +242,7 @@ public class DeviceServiceImpl implements IDeviceService {
if (sendRtpItem != null) { if (sendRtpItem != null) {
redisCatchStorage.deleteSendRTPServer(deviceId, sendRtpItem.getChannelId(), null, null); redisCatchStorage.deleteSendRTPServer(deviceId, sendRtpItem.getChannelId(), null, null);
MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); 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()); audioBroadcastManager.del(deviceId, audioBroadcastCatch.getChannelId());

View File

@ -1,14 +1,12 @@
package com.genersoft.iot.vmp.service.impl; 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.common.StreamInfo;
import com.genersoft.iot.vmp.conf.MediaConfig; import com.genersoft.iot.vmp.conf.MediaConfig;
import com.genersoft.iot.vmp.media.bean.Track; 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.ZLMRESTfulUtils;
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo; 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.service.IMediaService;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -53,7 +51,7 @@ public class MediaServiceImpl implements IMediaService {
if (streamAuthorityInfo != null) { if (streamAuthorityInfo != null) {
calld = streamAuthorityInfo.getCallId(); calld = streamAuthorityInfo.getCallId();
} }
List<StreamInfo> streamInfoList = mediaServerService.getMediaList(mediaInfo, app, stream); List<StreamInfo> streamInfoList = mediaServerService.getMediaList(mediaInfo, app, stream, calld);
if (streamInfoList.isEmpty()) { if (streamInfoList.isEmpty()) {
return null; return null;
}else { }else {

View File

@ -122,7 +122,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
streamPushItem.setStream(item.getStream()); streamPushItem.setStream(item.getStream());
streamPushItem.setAliveSecond(item.getAliveSecond()); streamPushItem.setAliveSecond(item.getAliveSecond());
streamPushItem.setOriginSock(item.getOriginSock()); streamPushItem.setOriginSock(item.getOriginSock());
streamPushItem.setTotalReaderCount(item.getTotalReaderCount()); streamPushItem.setTotalReaderCount(item.getTotalReaderCount() + "");
streamPushItem.setOriginType(item.getOriginType()); streamPushItem.setOriginType(item.getOriginType());
streamPushItem.setOriginTypeStr(item.getOriginTypeStr()); streamPushItem.setOriginTypeStr(item.getOriginTypeStr());
streamPushItem.setOriginUrl(item.getOriginUrl()); streamPushItem.setOriginUrl(item.getOriginUrl());

View File

@ -72,7 +72,7 @@ public class RedisStreamMsgListener implements MessageListener {
onStreamChangedHookParam.setMediaServerId(mediaServerId); onStreamChangedHookParam.setMediaServerId(mediaServerId);
onStreamChangedHookParam.setCreateStamp(System.currentTimeMillis()/1000); onStreamChangedHookParam.setCreateStamp(System.currentTimeMillis()/1000);
onStreamChangedHookParam.setAliveSecond(0L); onStreamChangedHookParam.setAliveSecond(0L);
onStreamChangedHookParam.setTotalReaderCount("0"); onStreamChangedHookParam.setTotalReaderCount(0);
onStreamChangedHookParam.setOriginType(0); onStreamChangedHookParam.setOriginType(0);
onStreamChangedHookParam.setOriginTypeStr("0"); onStreamChangedHookParam.setOriginTypeStr("0");
onStreamChangedHookParam.setOriginTypeStr("unknown"); onStreamChangedHookParam.setOriginTypeStr("unknown");

View File

@ -171,7 +171,7 @@ public class StreamContent {
} }
this.mediaServerId = streamInfo.getMediaServerId(); this.mediaServerId = streamInfo.getMediaServerId();
this.track = streamInfo.getTracks(); this.track = streamInfo.getTrack();
this.startTime = streamInfo.getStartTime(); this.startTime = streamInfo.getStartTime();
this.endTime = streamInfo.getEndTime(); this.endTime = streamInfo.getEndTime();
this.progress = streamInfo.getProgress(); this.progress = streamInfo.getProgress();
@ -389,12 +389,12 @@ public class StreamContent {
this.mediaServerId = mediaServerId; this.mediaServerId = mediaServerId;
} }
public Object getTracks() { public Track getTrack() {
return tracks; return track;
} }
public void setTracks(Object tracks) { public void setTrack(Track track) {
this.tracks = tracks; this.track = track;
} }
public String getStartTime() { public String getStartTime() {