From e2f8400ddcc8bdf70caaeb763daad2cee7875771 Mon Sep 17 00:00:00 2001 From: liyi Date: Thu, 15 May 2025 16:47:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4=E5=AF=B9=E8=AE=B2?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=A1=B9=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handle/impl/udp_talk_request_handler.dart | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart b/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart index 7ce19cf6..5b72e229 100644 --- a/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart +++ b/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart @@ -59,8 +59,11 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle // 收到对讲请求的应答 startChartManage.FromPeerId = scpMessage.ToPeerId!; startChartManage.ToPeerId = scpMessage.FromPeerId!; + startChartManage.lockPeerId = scpMessage.FromPeerId!; // 处理预期数据格式 - _handleResponseSendExpect(); + _handleResponseSendExpect( + lockPeerID: scpMessage.FromPeerId!, + ); // 发送预期数据 startChartManage.startTalkExpectTimer(); // 停止发送对讲请求 @@ -247,12 +250,33 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle } /// app主动发请求,收到回复后发送的预期数据 - void _handleResponseSendExpect() { + void _handleResponseSendExpect({ + required String lockPeerID, + }) async { final LockListInfoItemEntity currentKeyInfo = CommonDataManage().currentKeyInfo; - final isH264 = currentKeyInfo.lockFeature?.isH264 == 1; - final isMJpeg = currentKeyInfo.lockFeature?.isMJpeg == 1; + var isH264 = currentKeyInfo.lockFeature?.isH264 == 1; + var isMJpeg = currentKeyInfo.lockFeature?.isMJpeg == 1; + + final LockListInfoGroupEntity? lockListInfoGroupEntity = + await Storage.getLockMainListData(); + if (lockListInfoGroupEntity != null) { + lockListInfoGroupEntity!.groupList?.forEach((element) { + final lockList = element.lockList; + if (lockList != null && lockList.length != 0) { + for (var lockInfo in lockList) { + final peerId = lockInfo.network?.peerId; + if (peerId != null && peerId != '') { + if (peerId == lockPeerID) { + isH264 = lockInfo.lockFeature?.isH264 == 1; + isMJpeg = lockInfo.lockFeature?.isMJpeg == 1; + } + } + } + } + }); + } // 优先使用H264,其次是MJPEG if (isH264) { // 锁支持H264,发送H264视频和G711音频期望