fix:增加视频分辨率判断

This commit is contained in:
liyi 2025-05-13 10:19:43 +08:00
parent 06fc544f1a
commit a7a70f41b1
2 changed files with 87 additions and 10 deletions

View File

@ -15,6 +15,7 @@ import 'package:star_lock/talk/starChart/proto/generic.pb.dart';
import 'package:star_lock/talk/starChart/proto/talk_accept.pb.dart'; import 'package:star_lock/talk/starChart/proto/talk_accept.pb.dart';
import 'package:star_lock/talk/starChart/proto/talk_expect.pb.dart'; import 'package:star_lock/talk/starChart/proto/talk_expect.pb.dart';
import 'package:star_lock/tools/commonDataManage.dart'; import 'package:star_lock/tools/commonDataManage.dart';
import 'package:star_lock/tools/storage.dart';
import '../../star_chart_manage.dart'; import '../../star_chart_manage.dart';
@ -34,7 +35,7 @@ class UdpTalkAcceptHandler extends ScpMessageBaseHandle
// //
startChartManage.stopTalkAcceptTimer(); startChartManage.stopTalkAcceptTimer();
// //
_handleSendExpect(); _handleSendExpect(lockPeerID: scpMessage.FromPeerId!);
// //
stopRingtone(); stopRingtone();
// //
@ -79,11 +80,33 @@ class UdpTalkAcceptHandler extends ScpMessageBaseHandle
} }
/// ///
void _handleSendExpect() { void _handleSendExpect({
required String lockPeerID,
}) async {
final LockListInfoItemEntity currentKeyInfo = final LockListInfoItemEntity currentKeyInfo =
CommonDataManage().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;
}
}
}
}
});
}
// 使H264MJPEG // 使H264MJPEG
if (isH264) { if (isH264) {

View File

@ -37,7 +37,10 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
startChartManage.ToPeerId = scpMessage.FromPeerId!; startChartManage.ToPeerId = scpMessage.FromPeerId!;
startChartManage.lockPeerId = scpMessage.FromPeerId!; startChartManage.lockPeerId = scpMessage.FromPeerId!;
// //
_talkRequestEvent(talkObjectName: talkReq.callerName); _talkRequestEvent(
talkObjectName: talkReq.callerName,
lockPeerID: scpMessage.FromPeerId!,
);
// //
replySuccessMessage(scpMessage); replySuccessMessage(scpMessage);
@ -78,9 +81,12 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
void handleRealTimeData(ScpMessage scpMessage) {} void handleRealTimeData(ScpMessage scpMessage) {}
// //
void _talkRequestEvent({required String talkObjectName}) { void _talkRequestEvent({
required String talkObjectName,
required String lockPeerID,
}) async {
// //
_handleRequestSendExpect(); _handleRequestSendExpect(lockPeerID: lockPeerID);
// //
//test:使 //test:使
playRingtone(); playRingtone();
@ -88,6 +94,33 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
// _showTalkRequestNotification(talkObjectName: talkObjectName); // _showTalkRequestNotification(talkObjectName: talkObjectName);
// //
talkStatus.setPassiveCallWaitingAnswer(); talkStatus.setPassiveCallWaitingAnswer();
//
final LockListInfoItemEntity currentKeyInfo =
CommonDataManage().currentKeyInfo;
var isWifiLockType = currentKeyInfo.lockFeature?.wifiLockType == 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) {
isWifiLockType = lockInfo.lockFeature?.wifiLockType == 1;
}
}
}
}
});
}
if (isWifiLockType) {
Get.toNamed(Routers.imageTransmissionView);
return;
}
if (startChartManage if (startChartManage
.getDefaultTalkExpect() .getDefaultTalkExpect()
.videoType .videoType
@ -170,12 +203,33 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
} }
/// app收到的对讲请求后 /// app收到的对讲请求后
void _handleRequestSendExpect() { void _handleRequestSendExpect({
required String lockPeerID,
}) async {
final LockListInfoItemEntity currentKeyInfo = final LockListInfoItemEntity currentKeyInfo =
CommonDataManage().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;
}
}
}
}
});
}
// 使H264MJPEG // 使H264MJPEG
if (isH264) { if (isH264) {
// H264H264视频和G711音频期望 // H264H264视频和G711音频期望