Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26434251 authored by Manisha Jajoo's avatar Manisha Jajoo Committed by Pawin Vongmasa
Browse files

VTS: Disable timestamp validation for Video Decoders

This patch disables timestamp validation for decoders when the
output is not in display order.

Test: atest VtsHalMediaC2V1_0TargetVideoDecTest

Bug: 157571989
Change-Id: If5b287b5ce4ed731f80e8ad979a16c84cb67ad2b
parent 19d51164
Loading
Loading
Loading
Loading
+35 −21
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ class Codec2VideoDecHidlTestBase : public ::testing::Test {
        mFramesReceived = 0;
        mTimestampUs = 0u;
        mWorkResult = C2_OK;
        mReorderDepth = -1;
        mTimestampDevTest = false;
        mMd5Offset = 0;
        mMd5Enable = false;
@@ -211,18 +212,29 @@ class Codec2VideoDecHidlTestBase : public ::testing::Test {
        for (std::unique_ptr<C2Work>& work : workItems) {
            if (!work->worklets.empty()) {
                // For decoder components current timestamp always exceeds
                // previous timestamp
                // previous timestamp if output is in display order
                typedef std::unique_lock<std::mutex> ULock;
                mWorkResult |= work->result;
                bool codecConfig = ((work->worklets.front()->output.flags &
                                     C2FrameData::FLAG_CODEC_CONFIG) != 0);
                if (!codecConfig && !work->worklets.front()->output.buffers.empty()) {
                    if (mReorderDepth < 0) {
                        C2PortReorderBufferDepthTuning::output reorderBufferDepth;
                        mComponent->query({&reorderBufferDepth}, {}, C2_MAY_BLOCK,
                                          nullptr);
                        mReorderDepth = reorderBufferDepth.value;
                        if (mReorderDepth > 0) {
                            // TODO: Add validation for reordered output
                            mTimestampDevTest = false;
                        }
                    }
                    if (mTimestampDevTest) {
                        EXPECT_GE((work->worklets.front()->output.ordinal.timestamp.peeku()),
                                  mTimestampUs);
                        mTimestampUs = work->worklets.front()->output.ordinal.timestamp.peeku();

                        ULock l(mQueueLock);
                    if (mTimestampDevTest) {
                        {
                            bool tsHit = false;
                            std::list<uint64_t>::iterator it = mTimestampUslist.begin();
                            while (it != mTimestampUslist.end()) {
@@ -242,6 +254,7 @@ class Codec2VideoDecHidlTestBase : public ::testing::Test {
                                }
                            }
                        }
                    }
                    if (mMd5Enable) {
                        compareMd5Chksm(work);
                    }
@@ -281,6 +294,7 @@ class Codec2VideoDecHidlTestBase : public ::testing::Test {
    standardComp mCompName;

    int32_t mWorkResult;
    int32_t mReorderDepth;
    uint32_t mFramesReceived;
    C2BlockPool::local_id_t mBlockPoolId;
    std::shared_ptr<C2BlockPool> mLinearPool;