fix:增加视频分辨率判断
This commit is contained in:
parent
06fc544f1a
commit
a7a70f41b1
@ -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_expect.pb.dart';
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../../star_chart_manage.dart';
|
||||
|
||||
@ -34,7 +35,7 @@ class UdpTalkAcceptHandler extends ScpMessageBaseHandle
|
||||
// 停止同意接听的重发
|
||||
startChartManage.stopTalkAcceptTimer();
|
||||
// 接听之后增加期望音频的接收
|
||||
_handleSendExpect();
|
||||
_handleSendExpect(lockPeerID: scpMessage.FromPeerId!);
|
||||
// 停止播放铃声
|
||||
stopRingtone();
|
||||
// 设置状态为接听成功
|
||||
@ -79,11 +80,33 @@ class UdpTalkAcceptHandler extends ScpMessageBaseHandle
|
||||
}
|
||||
|
||||
/// 收到同意接听回复之后增加音频的期望数据
|
||||
void _handleSendExpect() {
|
||||
void _handleSendExpect({
|
||||
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) {
|
||||
|
||||
@ -37,7 +37,10 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
|
||||
startChartManage.ToPeerId = scpMessage.FromPeerId!;
|
||||
startChartManage.lockPeerId = scpMessage.FromPeerId!;
|
||||
// 处理收到接听请求后的事件
|
||||
_talkRequestEvent(talkObjectName: talkReq.callerName);
|
||||
_talkRequestEvent(
|
||||
talkObjectName: talkReq.callerName,
|
||||
lockPeerID: scpMessage.FromPeerId!,
|
||||
);
|
||||
|
||||
// 回复成功
|
||||
replySuccessMessage(scpMessage);
|
||||
@ -78,9 +81,12 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
|
||||
void handleRealTimeData(ScpMessage scpMessage) {}
|
||||
|
||||
// 来电事件的处理
|
||||
void _talkRequestEvent({required String talkObjectName}) {
|
||||
void _talkRequestEvent({
|
||||
required String talkObjectName,
|
||||
required String lockPeerID,
|
||||
}) async {
|
||||
// 发送预期数据、通知锁板需要获取视频数据
|
||||
_handleRequestSendExpect();
|
||||
_handleRequestSendExpect(lockPeerID: lockPeerID);
|
||||
// 播放铃声
|
||||
//test:使用自定义铃声
|
||||
playRingtone();
|
||||
@ -88,6 +94,33 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
|
||||
// _showTalkRequestNotification(talkObjectName: talkObjectName);
|
||||
// 设置为等待接听状态
|
||||
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
|
||||
.getDefaultTalkExpect()
|
||||
.videoType
|
||||
@ -170,12 +203,33 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
|
||||
}
|
||||
|
||||
/// app收到的对讲请求后,发送的预期数据
|
||||
void _handleRequestSendExpect() {
|
||||
void _handleRequestSendExpect({
|
||||
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音频期望
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user