优化下级平台自定义ssrc的情况,优化国标录像下载流程

This commit is contained in:
648540858
2023-04-14 14:59:22 +08:00
parent 1f02cb9178
commit d46fc9de82
9 changed files with 141 additions and 20 deletions

View File

@@ -276,6 +276,10 @@ public class ZLMRESTfulUtils {
return sendPost(mediaServerItem, "closeRtpServer",param, null);
}
public void closeRtpServer(MediaServerItem mediaServerItem, Map<String, Object> param, RequestCallback callback) {
sendPost(mediaServerItem, "closeRtpServer",param, callback);
}
public JSONObject listRtpServer(MediaServerItem mediaServerItem) {
return sendPost(mediaServerItem, "listRtpServer",null, null);
}

View File

@@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.media.zlm;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.common.CommonCallback;
import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
import com.genersoft.iot.vmp.media.zlm.dto.*;
@@ -164,6 +165,31 @@ public class ZLMRTPServerFactory {
return result;
}
public void closeRtpServer(MediaServerItem serverItem, String streamId, CommonCallback<Boolean> callback) {
if (serverItem == null) {
callback.run(false);
return;
}
Map<String, Object> param = new HashMap<>();
param.put("stream_id", streamId);
zlmresTfulUtils.closeRtpServer(serverItem, param, jsonObject -> {
if (jsonObject != null ) {
if (jsonObject.getInteger("code") == 0) {
callback.run(jsonObject.getInteger("hit") == 1);
return;
}else {
logger.error("关闭RTP Server 失败: " + jsonObject.getString("msg"));
}
}else {
// 检查ZLM状态
logger.error("关闭RTP Server 失败: 请检查ZLM服务");
}
callback.run(false);
});
}
/**
* 创建一个国标推流