修复CSEQ重置错误 #1449
parent
de390d3982
commit
c69b64c756
|
@ -18,6 +18,7 @@ import com.genersoft.iot.vmp.service.*;
|
||||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||||
|
import com.genersoft.iot.vmp.utils.MediaServerUtils;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.OtherPsSendInfo;
|
import com.genersoft.iot.vmp.vmanager.bean.OtherPsSendInfo;
|
||||||
import com.genersoft.iot.vmp.vmanager.bean.OtherRtpSendInfo;
|
import com.genersoft.iot.vmp.vmanager.bean.OtherRtpSendInfo;
|
||||||
|
@ -26,12 +27,10 @@ import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.ObjectUtils;
|
|
||||||
|
|
||||||
import javax.sip.InvalidArgumentException;
|
import javax.sip.InvalidArgumentException;
|
||||||
import javax.sip.SipException;
|
import javax.sip.SipException;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -101,7 +100,7 @@ public class MediaServiceImpl implements IMediaService {
|
||||||
}
|
}
|
||||||
if (userSetting.getPushAuthority()) {
|
if (userSetting.getPushAuthority()) {
|
||||||
// 对于推流进行鉴权
|
// 对于推流进行鉴权
|
||||||
Map<String, String> paramMap = urlParamToMap(params);
|
Map<String, String> paramMap = MediaServerUtils.urlParamToMap(params);
|
||||||
// 推流鉴权
|
// 推流鉴权
|
||||||
if (params == null) {
|
if (params == null) {
|
||||||
logger.info("推流鉴权失败: 缺少必要参数:sign=md5(user表的pushKey)");
|
logger.info("推流鉴权失败: 缺少必要参数:sign=md5(user表的pushKey)");
|
||||||
|
@ -210,24 +209,6 @@ public class MediaServiceImpl implements IMediaService {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, String> urlParamToMap(String params) {
|
|
||||||
HashMap<String, String> map = new HashMap<>();
|
|
||||||
if (ObjectUtils.isEmpty(params)) {
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
String[] paramsArray = params.split("&");
|
|
||||||
if (paramsArray.length == 0) {
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
for (String param : paramsArray) {
|
|
||||||
String[] paramArray = param.split("=");
|
|
||||||
if (paramArray.length == 2) {
|
|
||||||
map.put(paramArray[0], paramArray[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean closeStreamOnNoneReader(String mediaServerId, String app, String stream, String schema) {
|
public boolean closeStreamOnNoneReader(String mediaServerId, String app, String stream, String schema) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
|
|
@ -82,12 +82,8 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resetAllCSEQ() {
|
public void resetAllCSEQ() {
|
||||||
String scanKey = VideoManagerConstants.SIP_CSEQ_PREFIX + userSetting.getServerId() + "_*";
|
String key = VideoManagerConstants.SIP_CSEQ_PREFIX + userSetting.getServerId();
|
||||||
List<Object> keys = RedisUtil.scan(redisTemplate, scanKey);
|
redisTemplate.opsForValue().set(key, 1);
|
||||||
for (Object o : keys) {
|
|
||||||
String key = (String) o;
|
|
||||||
redisTemplate.opsForValue().set(key, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -97,9 +97,9 @@ enable_ts=1
|
||||||
fmp4_demand=0
|
fmp4_demand=0
|
||||||
hls_demand=0
|
hls_demand=0
|
||||||
hls_save_path=./www
|
hls_save_path=./www
|
||||||
modify_stamp=0
|
modify_stamp=2
|
||||||
mp4_as_player=0
|
mp4_as_player=0
|
||||||
mp4_max_second=3600
|
mp4_max_second=300
|
||||||
mp4_save_path=./www
|
mp4_save_path=./www
|
||||||
rtmp_demand=0
|
rtmp_demand=0
|
||||||
rtsp_demand=0
|
rtsp_demand=0
|
||||||
|
@ -163,4 +163,16 @@ pktBufSize=8192
|
||||||
port=9000
|
port=9000
|
||||||
timeoutSec=5
|
timeoutSec=5
|
||||||
|
|
||||||
|
|
||||||
|
[transcode]
|
||||||
|
acodec=pcma
|
||||||
|
decoder_h264=h264_qsv,h264_videotoolbox,h264_bm,libopenh264
|
||||||
|
decoder_h265=hevc_qsv,hevc_videotoolbox,hevc_bm
|
||||||
|
enable_ffmpeg_log=0
|
||||||
|
encoder_h264=h264_qsv,h264_videotoolbox,h264_bm,libx264,libopenh264
|
||||||
|
encoder_h265=hevc_qsv,hevc_videotoolbox,hevc_bm,libx265
|
||||||
|
filter=
|
||||||
|
suffix=transport
|
||||||
|
vcodec=H264
|
||||||
|
|
||||||
; } ---
|
; } ---
|
||||||
|
|
Loading…
Reference in New Issue