From 01a619f9e31694312f6badc0f3c7f8518e5d8420 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 03 三月 2022 16:55:20 +0800
Subject: [PATCH] Merge branch 'wvp-28181-2.0' into wvp-pro-record
---
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java | 27 ++++++++++++++++++---------
1 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java
index 64812b6..60ea11b 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java
@@ -28,10 +28,8 @@
import java.util.HashMap;
import java.util.Map;
-/**
- * @description: BYE璇锋眰澶勭悊鍣�
- * @author: lawrencehj
- * @date: 2021骞�3鏈�9鏃�
+/**
+ * SIP鍛戒护绫诲瀷锛� BYE璇锋眰
*/
@Component
public class ByeRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor {
@@ -89,20 +87,31 @@
MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId());
zlmrtpServerFactory.stopSendRtpStream(mediaInfo, param);
redisCatchStorage.deleteSendRTPServer(platformGbId, channelId);
- if (zlmrtpServerFactory.totalReaderCount(mediaInfo, sendRtpItem.getApp(), streamId) == 0) {
+ int totalReaderCount = zlmrtpServerFactory.totalReaderCount(mediaInfo, sendRtpItem.getApp(), streamId);
+ if (totalReaderCount == 0) {
logger.info(streamId + "鏃犲叾瀹冭鐪嬭�咃紝閫氱煡璁惧鍋滄鎺ㄦ祦");
cmder.streamByeCmd(sendRtpItem.getDeviceId(), channelId);
+ }else if (totalReaderCount == -1){
+ logger.warn(streamId + " 鏌ユ壘鍏跺畠瑙傜湅鑰呭け璐�");
}
}
// 鍙兘鏄澶囦富鍔ㄥ仠姝�
Device device = storager.queryVideoDeviceByChannelId(platformGbId);
if (device != null) {
- StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(device.getDeviceId(), channelId);
- if (streamInfo != null) {
- redisCatchStorage.stopPlay(streamInfo);
+ if (sendRtpItem.isPlay()) {
+ StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(device.getDeviceId(), channelId);
+ if (streamInfo != null) {
+ redisCatchStorage.stopPlay(streamInfo);
+ }
+ }else {
+ StreamInfo streamInfo = redisCatchStorage.queryPlaybackByDevice(device.getDeviceId(), channelId);
+ if (streamInfo != null) {
+ redisCatchStorage.stopPlayback(streamInfo);
+ }
}
+
storager.stopPlay(device.getDeviceId(), channelId);
- mediaServerService.closeRTPServer(device, channelId);
+ mediaServerService.closeRTPServer(device, channelId, streamInfo.getStream());
}
}
} catch (SipException e) {
--
Gitblit v1.8.0