fix:调整为原有的864*480对讲视频
This commit is contained in:
parent
89eeb4f0b3
commit
e8e297d95b
@ -13,7 +13,7 @@ class TalkConstant {
|
|||||||
audioType: [AudioTypeE.G711],
|
audioType: [AudioTypeE.G711],
|
||||||
);
|
);
|
||||||
static TalkExpectReq H264Expect = TalkExpectReq(
|
static TalkExpectReq H264Expect = TalkExpectReq(
|
||||||
videoType: [VideoTypeE.H264_720P],
|
videoType: [VideoTypeE.H264],
|
||||||
audioType: [AudioTypeE.G711],
|
audioType: [AudioTypeE.G711],
|
||||||
);
|
);
|
||||||
static TalkExpectReq H264_720P_Expect = TalkExpectReq(
|
static TalkExpectReq H264_720P_Expect = TalkExpectReq(
|
||||||
|
|||||||
@ -81,9 +81,9 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
|
|||||||
state.isLoading.value = true;
|
state.isLoading.value = true;
|
||||||
// 创建解码器配置
|
// 创建解码器配置
|
||||||
final config = VideoDecoderConfig(
|
final config = VideoDecoderConfig(
|
||||||
width: 1280,
|
width: 864,
|
||||||
// 实际视频宽度
|
// 实际视频宽度
|
||||||
height: 720,
|
height: 480,
|
||||||
codecType: 'h264',
|
codecType: 'h264',
|
||||||
);
|
);
|
||||||
// 初始化解码器并获取textureId
|
// 初始化解码器并获取textureId
|
||||||
@ -209,7 +209,8 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
|
|||||||
final TalkDataH264Frame_FrameTypeE frameType = frameMap['frameType'];
|
final TalkDataH264Frame_FrameTypeE frameType = frameMap['frameType'];
|
||||||
final int frameSeq = frameMap['frameSeq'];
|
final int frameSeq = frameMap['frameSeq'];
|
||||||
final int frameSeqI = frameMap['frameSeqI'];
|
final int frameSeqI = frameMap['frameSeqI'];
|
||||||
int pts = DateTime.now().millisecondsSinceEpoch;
|
int pts = frameMap['pts'];
|
||||||
|
// int pts = DateTime.now().millisecondsSinceEpoch;
|
||||||
|
|
||||||
// if (frameType == TalkDataH264Frame_FrameTypeE.P) {
|
// if (frameType == TalkDataH264Frame_FrameTypeE.P) {
|
||||||
// // 以frameSeqI为I帧序号标识
|
// // 以frameSeqI为I帧序号标识
|
||||||
@ -224,12 +225,13 @@ class TalkViewNativeDecodeLogic extends BaseGetXController {
|
|||||||
// 实时写入h264文件
|
// 实时写入h264文件
|
||||||
// _appendH264FrameToFile(frameData, frameType);
|
// _appendH264FrameToFile(frameData, frameType);
|
||||||
|
|
||||||
final timestamp = DateTime.now().microsecondsSinceEpoch;
|
// final timestamp = DateTime.now().millisecondsSinceEpoch;
|
||||||
|
// final timestamp64 = timestamp is int ? timestamp : timestamp.toInt();
|
||||||
VideoDecodePlugin.sendFrame(
|
VideoDecodePlugin.sendFrame(
|
||||||
frameData: frameData,
|
frameData: frameData,
|
||||||
frameType: frameType == TalkDataH264Frame_FrameTypeE.I ? 0 : 1,
|
frameType: frameType == TalkDataH264Frame_FrameTypeE.I ? 0 : 1,
|
||||||
frameSeq: frameSeq,
|
frameSeq: frameSeq,
|
||||||
timestamp: timestamp,
|
timestamp: pts,
|
||||||
splitNalFromIFrame: true,
|
splitNalFromIFrame: true,
|
||||||
refIFrameSeq: frameSeqI,
|
refIFrameSeq: frameSeqI,
|
||||||
);
|
);
|
||||||
|
|||||||
@ -109,8 +109,8 @@ class TalkViewNativeDecodeState {
|
|||||||
|
|
||||||
// H264帧缓冲区相关
|
// H264帧缓冲区相关
|
||||||
final List<Map<String, dynamic>> h264FrameBuffer = <Map<String, dynamic>>[]; // H264帧缓冲区,存储帧数据和类型
|
final List<Map<String, dynamic>> h264FrameBuffer = <Map<String, dynamic>>[]; // H264帧缓冲区,存储帧数据和类型
|
||||||
final int maxFrameBufferSize = 15; // 最大缓冲区大小
|
final int maxFrameBufferSize = 30; // 最大缓冲区大小
|
||||||
final int targetFps = 25; // 目标解码帧率,只是为了快速填充native的缓冲区
|
final int targetFps = 30; // 目标解码帧率,只是为了快速填充native的缓冲区
|
||||||
Timer? frameProcessTimer; // 帧处理定时器
|
Timer? frameProcessTimer; // 帧处理定时器
|
||||||
bool isProcessingFrame = false; // 是否正在处理帧
|
bool isProcessingFrame = false; // 是否正在处理帧
|
||||||
int lastProcessedTimestamp = 0; // 上次处理帧的时间戳
|
int lastProcessedTimestamp = 0; // 上次处理帧的时间戳
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user