请求历史媒体下载增加回复事件处理ssrc与下级不一致情况
parent
a0cdc7c59d
commit
c662a53098
|
@ -221,7 +221,6 @@ public interface ISIPCommander {
|
||||||
*
|
*
|
||||||
* @param device 视频设备
|
* @param device 视频设备
|
||||||
* @param channelId 通道id,非通道则是设备本身
|
* @param channelId 通道id,非通道则是设备本身
|
||||||
* @param frontCmd 上级平台的指令,如果存在则直接下发
|
|
||||||
* @param enabled 看守位使能:1 = 开启,0 = 关闭
|
* @param enabled 看守位使能:1 = 开启,0 = 关闭
|
||||||
* @param resetTime 自动归位时间间隔,开启看守位时使用,单位:秒(s)
|
* @param resetTime 自动归位时间间隔,开启看守位时使用,单位:秒(s)
|
||||||
* @param presetIndex 调用预置位编号,开启看守位时使用,取值范围0~255
|
* @param presetIndex 调用预置位编号,开启看守位时使用,取值范围0~255
|
||||||
|
|
|
@ -364,8 +364,7 @@ public class SIPCommander implements ISIPCommander {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void playbackStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId,
|
public void playbackStreamCmd(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId,
|
||||||
String startTime, String endTime,
|
String startTime, String endTime, InviteStreamCallback inviteStreamCallback, InviteStreamCallback hookEvent,
|
||||||
InviteStreamCallback inviteStreamCallback, InviteStreamCallback hookEvent,
|
|
||||||
SipSubscribe.Event okEvent, SipSubscribe.Event errorEvent) throws InvalidArgumentException, SipException, ParseException {
|
SipSubscribe.Event okEvent, SipSubscribe.Event errorEvent) throws InvalidArgumentException, SipException, ParseException {
|
||||||
|
|
||||||
|
|
||||||
|
@ -411,8 +410,7 @@ public class SIPCommander implements ISIPCommander {
|
||||||
content.append("a=setup:active\r\n");
|
content.append("a=setup:active\r\n");
|
||||||
content.append("a=connection:new\r\n");
|
content.append("a=connection:new\r\n");
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
{
|
|
||||||
if ("TCP-PASSIVE".equalsIgnoreCase(streamMode)) {
|
if ("TCP-PASSIVE".equalsIgnoreCase(streamMode)) {
|
||||||
content.append("m=video " + ssrcInfo.getPort() + " TCP/RTP/AVP 96 97 98 99\r\n");
|
content.append("m=video " + ssrcInfo.getPort() + " TCP/RTP/AVP 96 97 98 99\r\n");
|
||||||
} else if ("TCP-ACTIVE".equalsIgnoreCase(streamMode)) {
|
} else if ("TCP-ACTIVE".equalsIgnoreCase(streamMode)) {
|
||||||
|
@ -546,8 +544,7 @@ public class SIPCommander implements ISIPCommander {
|
||||||
|
|
||||||
HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed("rtp", ssrcInfo.getStream(), true, null, mediaServerItem.getId());
|
HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed("rtp", ssrcInfo.getStream(), true, null, mediaServerItem.getId());
|
||||||
// 添加订阅
|
// 添加订阅
|
||||||
subscribe.addSubscribe(hookSubscribe, (MediaServerItem mediaServerItemInUse, JSONObject json) ->
|
subscribe.addSubscribe(hookSubscribe, (MediaServerItem mediaServerItemInUse, JSONObject json) -> {
|
||||||
{
|
|
||||||
hookEvent.call(new InviteStreamInfo(mediaServerItem, json,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport()).getCallId(), "rtp", ssrcInfo.getStream()));
|
hookEvent.call(new InviteStreamInfo(mediaServerItem, json,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport()).getCallId(), "rtp", ssrcInfo.getStream()));
|
||||||
subscribe.removeSubscribe(hookSubscribe);
|
subscribe.removeSubscribe(hookSubscribe);
|
||||||
hookSubscribe.getContent().put("regist", false);
|
hookSubscribe.getContent().put("regist", false);
|
||||||
|
|
|
@ -258,8 +258,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
cmder.playStreamCmd(mediaServerItem, ssrcInfo, device, channelId, (MediaServerItem mediaServerItemInuse, JSONObject response) ->
|
cmder.playStreamCmd(mediaServerItem, ssrcInfo, device, channelId, (MediaServerItem mediaServerItemInuse, JSONObject response) -> {
|
||||||
{
|
|
||||||
logger.info("收到订阅消息: " + response.toJSONString());
|
logger.info("收到订阅消息: " + response.toJSONString());
|
||||||
dynamicTask.stop(timeOutTaskKey);
|
dynamicTask.stop(timeOutTaskKey);
|
||||||
|
|
||||||
|
@ -274,8 +273,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
logger.info("[请求截图]: " + fileName);
|
logger.info("[请求截图]: " + fileName);
|
||||||
zlmresTfulUtils.getSnap(mediaServerItemInuse, streamUrl, 15, 1, path, fileName);
|
zlmresTfulUtils.getSnap(mediaServerItemInuse, streamUrl, 15, 1, path, fileName);
|
||||||
|
|
||||||
}, (event) ->
|
}, (event) -> {
|
||||||
{
|
|
||||||
ResponseEvent responseEvent = (ResponseEvent) event.event;
|
ResponseEvent responseEvent = (ResponseEvent) event.event;
|
||||||
String contentString = new String(responseEvent.getResponse().getRawContent());
|
String contentString = new String(responseEvent.getResponse().getRawContent());
|
||||||
// 获取ssrc
|
// 获取ssrc
|
||||||
|
@ -324,8 +322,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, (event) ->
|
}, (event) -> {
|
||||||
{
|
|
||||||
dynamicTask.stop(timeOutTaskKey);
|
dynamicTask.stop(timeOutTaskKey);
|
||||||
mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream());
|
mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream());
|
||||||
// 释放ssrc
|
// 释放ssrc
|
||||||
|
@ -516,8 +513,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
cmder.playbackStreamCmd(mediaServerItem, ssrcInfo, device, channelId, startTime, endTime, infoCallBack,
|
cmder.playbackStreamCmd(mediaServerItem, ssrcInfo, device, channelId, startTime, endTime, infoCallBack,
|
||||||
hookEvent, eventResult ->
|
hookEvent, eventResult -> {
|
||||||
{
|
|
||||||
if (eventResult.type == SipSubscribe.EventResultType.response) {
|
if (eventResult.type == SipSubscribe.EventResultType.response) {
|
||||||
ResponseEvent responseEvent = (ResponseEvent) eventResult.event;
|
ResponseEvent responseEvent = (ResponseEvent) eventResult.event;
|
||||||
String contentString = new String(responseEvent.getResponse().getRawContent());
|
String contentString = new String(responseEvent.getResponse().getRawContent());
|
||||||
|
@ -586,7 +582,6 @@ public class PlayServiceImpl implements IPlayService {
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//获取录像下载的服务,配置文件中的record-assist-port不为0
|
|
||||||
MediaServerItem newMediaServerItem = getNewMediaServerItemHasAssist(device);
|
MediaServerItem newMediaServerItem = getNewMediaServerItemHasAssist(device);
|
||||||
if (newMediaServerItem == null) {
|
if (newMediaServerItem == null) {
|
||||||
PlayBackResult<StreamInfo> downloadResult = new PlayBackResult<>();
|
PlayBackResult<StreamInfo> downloadResult = new PlayBackResult<>();
|
||||||
|
|
Loading…
Reference in New Issue