优化拉流代理
This commit is contained in:
@@ -749,13 +749,12 @@ public class MediaServerServiceImpl implements IMediaServerService {
|
||||
|
||||
@Override
|
||||
public StreamInfo getStreamInfoByAppAndStreamWithCheck(String app, String stream, String mediaServerId, String addr, boolean authority) {
|
||||
StreamInfo streamInfo = null;
|
||||
if (mediaServerId == null) {
|
||||
mediaServerId = mediaConfig.getId();
|
||||
}
|
||||
MediaServer mediaInfo = getOne(mediaServerId);
|
||||
if (mediaInfo == null) {
|
||||
return null;
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到使用的媒体节点");
|
||||
}
|
||||
String calld = null;
|
||||
StreamAuthorityInfo streamAuthorityInfo = redisCatchStorage.getStreamAuthorityInfo(app, stream);
|
||||
|
||||
@@ -210,7 +210,9 @@ public class ZLMMediaNodeServerService implements IMediaNodeServerService {
|
||||
streamInfoResult.setRtc(addr, mediaServer.getHttpPort(),mediaServer.getHttpSSlPort(), app, stream, callIdParam, isPlay);
|
||||
|
||||
streamInfoResult.setMediaInfo(mediaInfo);
|
||||
streamInfoResult.setOriginType(mediaInfo.getOriginType());
|
||||
if (mediaInfo != null) {
|
||||
streamInfoResult.setOriginType(mediaInfo.getOriginType());
|
||||
}
|
||||
return streamInfoResult;
|
||||
}
|
||||
|
||||
|
||||
@@ -266,14 +266,14 @@ public class ZLMRESTfulUtils {
|
||||
return sendPost(mediaServerItem, "getRtpInfo",param, null);
|
||||
}
|
||||
|
||||
public JSONObject addFFmpegSource(MediaServer mediaServerItem, String src_url, String dst_url, Integer timeout_ms,
|
||||
public JSONObject addFFmpegSource(MediaServer mediaServerItem, String src_url, String dst_url, Integer timeout_sec,
|
||||
boolean enable_audio, boolean enable_mp4, String ffmpeg_cmd_key){
|
||||
log.info(src_url);
|
||||
log.info(dst_url);
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("src_url", src_url);
|
||||
param.put("dst_url", dst_url);
|
||||
param.put("timeout_ms", timeout_ms);
|
||||
param.put("timeout_ms", timeout_sec*1000);
|
||||
param.put("enable_mp4", enable_mp4);
|
||||
param.put("ffmpeg_cmd_key", ffmpeg_cmd_key);
|
||||
return sendPost(mediaServerItem, "addFFmpegSource",param, null);
|
||||
|
||||
Reference in New Issue
Block a user