This commit is contained in:
sky.min 2026-01-14 16:32:26 +08:00
parent 6542f27437
commit 9219168df5
3 changed files with 24 additions and 45 deletions

View File

@ -93,13 +93,11 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
Future<void> _initVideoDecoder() async { Future<void> _initVideoDecoder() async {
try { try {
state.isLoading.value = true; state.isLoading.value = true;
// ios第一次点击监控没画面
//
int width = StartChartManage().videoWidth; int width = StartChartManage().videoWidth;
int height = StartChartManage().videoHeight; int height = StartChartManage().videoHeight;
// if(Platform.isIOS){
// ios第一次点击监控没画面
if (width == 0 || height == 0) { if (width == 0 || height == 0) {
int attempts = 0; int attempts = 0;
const maxAttempts = 20; // 2 (20 * 100ms) const maxAttempts = 20; // 2 (20 * 100ms)
@ -120,7 +118,7 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
AppLog.log('获取到视频参数: ${width}x$height'); AppLog.log('获取到视频参数: ${width}x$height');
} }
} }
}
// //
final config = VideoDecoderConfig( final config = VideoDecoderConfig(
width: width, width: width,
@ -128,7 +126,6 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
height: height, height: height,
codecType: 'h264', codecType: 'h264',
); );
AppLog.log('解码器配置的宽高为:${config.width}x${config.height}');
// textureId // textureId
final textureId = await VideoDecodePlugin.initDecoder(config); final textureId = await VideoDecodePlugin.initDecoder(config);
if (textureId != null) { if (textureId != null) {
@ -272,7 +269,8 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
// //
state.frameProcessTimer?.cancel(); state.frameProcessTimer?.cancel();
// 使 //
// final int intervalMs = (1000 / state.targetFps).round();
final int intervalMs = state.frameProcessIntervalMs; final int intervalMs = state.frameProcessIntervalMs;
// //

View File

@ -41,7 +41,7 @@ class TalkViewLogic extends BaseGetXController {
final LockDetailState lockDetailState = Get.put(LockDetailLogic()).state; final LockDetailState lockDetailState = Get.put(LockDetailLogic()).state;
int bufferSize = 3; // int bufferSize = 8; //
int audioBufferSize = 2; // 2 int audioBufferSize = 2; // 2
bool _isFirstAudioFrame = true; // bool _isFirstAudioFrame = true; //

View File

@ -504,25 +504,6 @@ class H264WebViewLogic extends BaseGetXController {
return result; return result;
} }
//
List<int> _applyDenoise(List<int> pcmData) {
// 使
const int noiseThreshold = 150; //
List<int> result = List<int>.filled(pcmData.length, 0);
for (int i = 0; i < pcmData.length; i++) {
// 0
if (pcmData[i].abs() < noiseThreshold) {
result[i] = 0;
} else {
result[i] = pcmData[i];
}
}
return result;
}
/// ///
void udpHangUpAction() async { void udpHangUpAction() async {
if (state.talkStatus.value == TalkStatus.answeredSuccessfully) { if (state.talkStatus.value == TalkStatus.answeredSuccessfully) {