视频数据显示Error修复及图片处理优化
This commit is contained in:
parent
c0e907bafa
commit
a774b6a437
@ -3,7 +3,6 @@ import 'dart:math';
|
|||||||
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_voice_processor/flutter_voice_processor.dart';
|
import 'package:flutter_voice_processor/flutter_voice_processor.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:star_lock/talk/call/callTalk.dart';
|
import 'package:star_lock/talk/call/callTalk.dart';
|
||||||
|
|||||||
@ -40,16 +40,23 @@ class _LockMonitoringPageState extends State<LockMonitoringPage> {
|
|||||||
height: 1.sh,
|
height: 1.sh,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Obx(() => state.listPhotoData.value.isEmpty
|
Obx(() {
|
||||||
? Container(color: Colors.transparent)
|
if (state.listPhotoData.value.isEmpty ||
|
||||||
: Image.memory(
|
state.listPhotoData.value.length < 10) {
|
||||||
state.listPhotoData.value,
|
return Container(color: Colors.transparent);
|
||||||
// key: ValueKey<int>(state.listData.value.hashCode),
|
} else {
|
||||||
gaplessPlayback: true,
|
return Image.memory(
|
||||||
width: 1.sw,
|
state.listPhotoData.value,
|
||||||
height: 1.sh,
|
gaplessPlayback: true,
|
||||||
fit: BoxFit.cover,
|
width: 1.sw,
|
||||||
)),
|
height: 1.sh,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
return Container(color: Colors.transparent);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}),
|
||||||
Positioned(
|
Positioned(
|
||||||
top: ScreenUtil().statusBarHeight + 30.h,
|
top: ScreenUtil().statusBarHeight + 30.h,
|
||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
|
|||||||
@ -71,12 +71,7 @@ class CallTalk {
|
|||||||
// print('获取帧序号 getIframeIndex:$getIframeIndex');
|
// print('获取帧序号 getIframeIndex:$getIframeIndex');
|
||||||
|
|
||||||
// 获取帧长度 65
|
// 获取帧长度 65
|
||||||
// int alen = bb[POS_alen] & 0xff;
|
int alen = bb[POS_alen] + bb[POS_alen + 1] * 256;
|
||||||
// var alenList = bb.sublist(POS_alen, POS_alen + 4);
|
|
||||||
// int alen = ((0xff & alenList[(0)]) << 24 |
|
|
||||||
// (0xff & alenList[1]) << 16 |
|
|
||||||
// (0xff & alenList[2]) << 8 |
|
|
||||||
// (0xFF & alenList[3]));
|
|
||||||
// print('获取帧长度 alen:$alen');
|
// print('获取帧长度 alen:$alen');
|
||||||
|
|
||||||
// 当前包号 71
|
// 当前包号 71
|
||||||
@ -94,7 +89,7 @@ class CallTalk {
|
|||||||
iframe = IframeInfo();
|
iframe = IframeInfo();
|
||||||
iframe!.iframeIndex = getIframeIndex;
|
iframe!.iframeIndex = getIframeIndex;
|
||||||
iframe!.bagNum = getBagNum;
|
iframe!.bagNum = getBagNum;
|
||||||
// iframe!.cur_len = alen;
|
iframe!.cur_len = alen;
|
||||||
iframe!.bb = [];
|
iframe!.bb = [];
|
||||||
// growableList = iframe!.bb!.toList(growable: true);
|
// growableList = iframe!.bb!.toList(growable: true);
|
||||||
}
|
}
|
||||||
@ -107,12 +102,14 @@ class CallTalk {
|
|||||||
iframe!.bb!.addAll(getList);
|
iframe!.bb!.addAll(getList);
|
||||||
}
|
}
|
||||||
// print(
|
// print(
|
||||||
// 'iframe.bagNum: ${iframe!.bagNum} iframe.bagReceive: ${iframe!.bagReceive}');
|
// 'iframe.bagNum: ${iframe!.bagNum} iframe.bagReceive: ${iframe!.bagReceive}');
|
||||||
|
|
||||||
// 如果收到的包数等于总包数,说明这一帧数据已经接收完毕
|
// 如果收到的包数等于总包数,说明这一帧数据已经接收完毕
|
||||||
if (iframe!.bagNum == iframe!.bagReceive &&
|
if (iframe!.bagNum == iframe!.bagReceive &&
|
||||||
|
iframe!.bagReceive == getBagNum &&
|
||||||
getIframeIndex == iframe!.iframeIndex) {
|
getIframeIndex == iframe!.iframeIndex) {
|
||||||
// print('播放第${iframe!.iframeIndex}帧 一帧图片的hexStringData: ${Uint8List.fromList(growableList)}');
|
// print('播放第${iframe!.iframeIndex}帧 一帧图片的hexStringData: ${Uint8List.fromList(growableList)}');
|
||||||
|
// print('得到的一张图片的数据长度为${iframe!.bb!.length}');
|
||||||
eventBus.fire(GetTVDataRefreshUI(iframe!.bb!));
|
eventBus.fire(GetTVDataRefreshUI(iframe!.bb!));
|
||||||
} else {
|
} else {
|
||||||
// print('接收到的包数不等于总包数');
|
// print('接收到的包数不等于总包数');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user