648540858
2022-05-10 4a0f5cf76dac6d82a7c6c576012c37db203308ff
去除调试内容
2个文件已修改
19 ■■■■■ 已修改文件
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java
@@ -96,9 +96,9 @@
            param.put("src_port", sendRtpItem.getLocalPort());
            param.put("pt", sendRtpItem.getPt());
            param.put("use_ps", sendRtpItem.isUsePs() ? "1" : "0");
            param.put("only_audio", sendRtpItem.isOnlyAudio());
            zlmrtpServerFactory.startSendRtpStream(mediaInfo, param);
            param.put("only_audio", sendRtpItem.isOnlyAudio() ? "1" : "0");
            JSONObject jsonObject = zlmrtpServerFactory.startSendRtpStream(mediaInfo, param);
            System.out.println(jsonObject);
//            if (streamInfo == null) { // 流还没上来,对方就回复ack
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
@@ -671,6 +671,9 @@
            sendRtpItem.setStatus(1);
            sendRtpItem.setApp(app);
            sendRtpItem.setStreamId(stream);
            sendRtpItem.setPt(8);
            sendRtpItem.setUsePs(false);
            sendRtpItem.setOnlyAudio(true);
            redisCatchStorage.updateSendRTPSever(sendRtpItem);
            // hook监听等待设备推流上来
@@ -683,6 +686,8 @@
            subscribeKey.put("mediaServerId", mediaServerItem.getId());
            String finalSsrc = ssrc;
            String waiteStreamTimeoutTaskKey = "waite-stream-" + device.getDeviceId() + channelId;
            // 流已经存在时直接推流
            if (zlmrtpServerFactory.isStreamReady(mediaServerItem, app, stream)) {
                logger.info("发现已经在推流");
                dynamicTask.stop(waiteStreamTimeoutTaskKey);
@@ -714,12 +719,12 @@
                    throw new RuntimeException(e);
                }
            }else {
                // 流不存在时监听流上线
                // 设置等待推流的超时; 默认20s
                String finalChannelId = channelId;
                dynamicTask.startDelay(waiteStreamTimeoutTaskKey, ()->{
                    logger.info("等待推流超时: {}/{}", app, stream);
                    if (audioBroadcastManager.exit(device.getDeviceId(), finalChannelId)) {
                        audioBroadcastManager.del(device.getDeviceId(), finalChannelId);
                    if (audioBroadcastManager.exit(device.getDeviceId(), channelId)) {
                        audioBroadcastManager.del(device.getDeviceId(), channelId);
                    }else {
                        // 兼容海康使用了错误的通道ID的情况
                        audioBroadcastManager.delByDeviceId(device.getDeviceId());
@@ -741,7 +746,7 @@
                            redisCatchStorage.updateSendRTPSever(sendRtpItem);
                            StringBuffer content = new StringBuffer(200);
                            content.append("v=0\r\n");
                            content.append("o="+ finalChannelId +" 0 0 IN IP4 "+mediaServerItem.getSdpIp()+"\r\n");
                            content.append("o="+ channelId +" 0 0 IN IP4 "+mediaServerItem.getSdpIp()+"\r\n");
                            content.append("s=Play\r\n");
                            content.append("c=IN IP4 "+mediaServerItem.getSdpIp()+"\r\n");
                            content.append("t=0 0\r\n");