fix:调整为callkit实现
This commit is contained in:
parent
4e08f57c48
commit
87905dacb7
@ -36,6 +36,7 @@ import 'package:star_lock/talk/starChart/views/native/talk_view_native_decode_st
|
|||||||
import 'package:star_lock/talk/starChart/views/talkView/talk_view_state.dart';
|
import 'package:star_lock/talk/starChart/views/talkView/talk_view_state.dart';
|
||||||
import 'package:star_lock/tools/G711Tool.dart';
|
import 'package:star_lock/tools/G711Tool.dart';
|
||||||
import 'package:star_lock/tools/bugly/bugly_tool.dart';
|
import 'package:star_lock/tools/bugly/bugly_tool.dart';
|
||||||
|
import 'package:star_lock/tools/callkit_handler.dart';
|
||||||
import 'package:star_lock/tools/commonDataManage.dart';
|
import 'package:star_lock/tools/commonDataManage.dart';
|
||||||
import 'package:star_lock/tools/storage.dart';
|
import 'package:star_lock/tools/storage.dart';
|
||||||
import 'package:video_decode_plugin/nalu_utils.dart';
|
import 'package:video_decode_plugin/nalu_utils.dart';
|
||||||
@ -159,6 +160,9 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
|
|||||||
// 拒绝
|
// 拒绝
|
||||||
StartChartManage().startTalkRejectMessageTimer();
|
StartChartManage().startTalkRejectMessageTimer();
|
||||||
}
|
}
|
||||||
|
if (Platform.isIOS) {
|
||||||
|
CallKitHandler.endCall();
|
||||||
|
}
|
||||||
VideoDecodePlugin.releaseDecoder();
|
VideoDecodePlugin.releaseDecoder();
|
||||||
Get.back();
|
Get.back();
|
||||||
}
|
}
|
||||||
@ -172,7 +176,6 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
|
|||||||
int frameSeqI,
|
int frameSeqI,
|
||||||
ScpMessage scpMessage,
|
ScpMessage scpMessage,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
// 动态回绕阈值判断,frameSeq较小时阈值也小
|
// 动态回绕阈值判断,frameSeq较小时阈值也小
|
||||||
if (!_pendingStreamReset &&
|
if (!_pendingStreamReset &&
|
||||||
_lastFrameSeq != null &&
|
_lastFrameSeq != null &&
|
||||||
@ -181,7 +184,8 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
|
|||||||
int dynamicThreshold = _getFrameSeqRolloverThreshold(_lastFrameSeq!);
|
int dynamicThreshold = _getFrameSeqRolloverThreshold(_lastFrameSeq!);
|
||||||
if ((_lastFrameSeq! - frameSeq) > dynamicThreshold) {
|
if ((_lastFrameSeq! - frameSeq) > dynamicThreshold) {
|
||||||
// 检测到新流I帧,frameSeq大幅回绕,进入loading并重置所有本地状态
|
// 检测到新流I帧,frameSeq大幅回绕,进入loading并重置所有本地状态
|
||||||
AppLog.log('检测到新流I帧,frameSeq大幅回绕,进入loading并重置: frameSeq=$frameSeq, lastFrameSeq=$_lastFrameSeq, 阈值=$dynamicThreshold');
|
AppLog.log(
|
||||||
|
'检测到新流I帧,frameSeq大幅回绕,进入loading并重置: frameSeq=$frameSeq, lastFrameSeq=$_lastFrameSeq, 阈值=$dynamicThreshold');
|
||||||
Future.microtask(() => state.isLoading.value = true);
|
Future.microtask(() => state.isLoading.value = true);
|
||||||
_pendingStreamReset = true;
|
_pendingStreamReset = true;
|
||||||
// 先暂停帧处理定时器,防止竞态
|
// 先暂停帧处理定时器,防止竞态
|
||||||
@ -198,7 +202,8 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
|
|||||||
// 继续往下执行
|
// 继续往下执行
|
||||||
} else {
|
} else {
|
||||||
// 小幅度乱序,直接丢弃
|
// 小幅度乱序,直接丢弃
|
||||||
AppLog.log('检测到I帧乱序(未超过回绕阈值$dynamicThreshold),丢弃: frameSeq=$frameSeq, lastFrameSeq=$_lastFrameSeq');
|
AppLog.log(
|
||||||
|
'检测到I帧乱序(未超过回绕阈值$dynamicThreshold),丢弃: frameSeq=$frameSeq, lastFrameSeq=$_lastFrameSeq');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user