fix:调整为原有的864*480对讲视频

This commit is contained in:
liyi 2025-05-06 11:42:16 +08:00
parent 357eaac746
commit 07d20dfbf2
3 changed files with 10 additions and 8 deletions

View File

@ -13,7 +13,7 @@ class TalkConstant {
audioType: [AudioTypeE.G711],
);
static TalkExpectReq H264Expect = TalkExpectReq(
videoType: [VideoTypeE.H264_720P],
videoType: [VideoTypeE.H264],
audioType: [AudioTypeE.G711],
);
static TalkExpectReq H264_720P_Expect = TalkExpectReq(

View File

@ -81,9 +81,9 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
state.isLoading.value = true;
//
final config = VideoDecoderConfig(
width: 1280,
width: 864,
//
height: 720,
height: 480,
codecType: 'h264',
);
// textureId
@ -209,7 +209,8 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
final TalkDataH264Frame_FrameTypeE frameType = frameMap['frameType'];
final int frameSeq = frameMap['frameSeq'];
final int frameSeqI = frameMap['frameSeqI'];
int pts = DateTime.now().millisecondsSinceEpoch;
int pts = frameMap['pts'];
// int pts = DateTime.now().millisecondsSinceEpoch;
// if (frameType == TalkDataH264Frame_FrameTypeE.P) {
// // frameSeqI为I帧序号标识
@ -224,12 +225,13 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
// h264文件
// _appendH264FrameToFile(frameData, frameType);
final timestamp = DateTime.now().microsecondsSinceEpoch;
// final timestamp = DateTime.now().millisecondsSinceEpoch;
// final timestamp64 = timestamp is int ? timestamp : timestamp.toInt();
VideoDecodePlugin.sendFrame(
frameData: frameData,
frameType: frameType == TalkDataH264Frame_FrameTypeE.I ? 0 : 1,
frameSeq: frameSeq,
timestamp: timestamp,
timestamp: pts,
splitNalFromIFrame: true,
refIFrameSeq: frameSeqI,
);

View File

@ -109,8 +109,8 @@ class TalkViewNativeDecodeState {
// H264帧缓冲区相关
final List<Map<String, dynamic>> h264FrameBuffer = <Map<String, dynamic>>[]; // H264帧缓冲区
final int maxFrameBufferSize = 15; //
final int targetFps = 25; // ,native的缓冲区
final int maxFrameBufferSize = 30; //
final int targetFps = 30; // ,native的缓冲区
Timer? frameProcessTimer; //
bool isProcessingFrame = false; //
int lastProcessedTimestamp = 0; //