【修改说明】修改不合理类型&新增参考关系解析用例&更改json管理方式

Signed-off-by: qihaonan <qihaonan3@huawei.com>
This commit is contained in:
qihaonan 2024-10-30 07:50:26 +00:00
parent 9f005142db
commit 49229abed1
19 changed files with 20 additions and 53 deletions

1
.gitattributes vendored
View File

@ -1,2 +1 @@
test/unittest/resources/reference_parser_test/mp4/*.mp4 filter=lfs diff=lfs merge=lfs -text
test/unittest/resources/reference_parser_test/json/*.json filter=lfs diff=lfs merge=lfs -text

View File

@ -39,7 +39,7 @@
namespace {
constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { LOG_CORE, LOG_DOMAIN_DEMUXER, "FfmpegReferenceParser" };
constexpr int32_t REFERENCE_PARSER_TIMEOUT_MS = 20000;
constexpr int64_t REFERENCE_PARSER_TIMEOUT_MS = 20000;
}
namespace OHOS {
@ -247,7 +247,8 @@ Status FFmpegDemuxerPlugin::ParserRefInfoLoop(AVPacket *pkt, uint32_t curStreamI
return Status::ERROR_UNKNOWN;
}
InsertIframePtsMap(pkt, parserCurGopId_, parserRefVideoStreamIdx_, iFramePtsMap_);
FALSE_RETURN_V_NOLOG(pkt->stream_index == parserRefVideoStreamIdx_ || ffmpegRet == AVERROR_EOF, Status::OK);
FALSE_RETURN_V_MSG_D(pkt->stream_index == parserRefVideoStreamIdx_ || ffmpegRet == AVERROR_EOF, Status::OK,
"eos or not video");
int64_t dts = AvTime2Us(
ConvertTimeFromFFmpeg(pkt->dts, parserRefFormatContext_->streams[parserRefVideoStreamIdx_]->time_base));
Status result = referenceParser_->ParserNalUnits(pkt->data, pkt->size, curStreamId, dts);
@ -376,7 +377,7 @@ Status FFmpegDemuxerPlugin::ParserRefInfo()
auto now =
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch());
auto duration = now - std::chrono::milliseconds(start.count());
FALSE_RETURN_V_MSG_W(duration < std::chrono::milliseconds(REFERENCE_PARSER_TIMEOUT_MS), Status::ERROR_UNKNOWN,
FALSE_RETURN_V_MSG_W(duration.count() < REFERENCE_PARSER_TIMEOUT_MS, Status::ERROR_UNKNOWN,
"reference parser timeout");
}

View File

@ -1034,7 +1034,22 @@ HWTEST_F(InnerParsercNdkTest, DEMUXER_REFERENCE_HDR_0010, TestSize.Level1)
}
shared_ptr<InnerDemuxerParserSample> parserSample = make_shared<InnerDemuxerParserSample>(g_file_hdr_1_hevc);
parserSample->InitParameter(MP4Scene::HDR_1_HEVC);
ASSERT_TRUE(parserSample->RunSeekScene(WorkPts::END_PTS));
ASSERT_TRUE(parserSample->RunSeekScene(WorkPts::RANDOM_PTS));
}
/**
* @tc.number : DEMUXER_REFERENCE_HDR_0011
* @tc.name : Randomly generating Pts corresponding to the N existing positions frame in HDR sequence
* @tc.desc : func test
*/
HWTEST_F(InnerParsercNdkTest, DEMUXER_REFERENCE_HDR_0011, TestSize.Level1)
{
if (access(HEVC_LIB_PATH.c_str(), F_OK) != 0) {
return;
}
shared_ptr<InnerDemuxerParserSample> parserSample = make_shared<InnerDemuxerParserSample>(g_file_hdr_1_hevc);
parserSample->InitParameter(MP4Scene::HDR_1_HEVC);
ASSERT_TRUE(parserSample->RunSpeedScene(WorkPts::RANDOM_PTS));
}
/**

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.