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

Commit 7892ceab authored by Praveen Chavan's avatar Praveen Chavan Committed by Pawin Vongmasa
Browse files

CCodec: Detect pipeline fullness based on pending inputs

Indicate pipeline fullness if there are
{inputDelay + pipelineDelay + smoothnessFactor} pending inputs
in the pipeline to avoid allocating more input.

Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 131217771

Change-Id: Ie08e59d1c6eecce5f07b98b899a0affd8602b04a
parent ceb7cc1f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -121,6 +121,13 @@ bool PipelineWatcher::pipelineFull() const {
              sizeWithInputReleased);
        return true;
    }

    size_t sizeWithInputsPending = mFramesInPipeline.size() - sizeWithInputReleased;
    if (sizeWithInputsPending > mPipelineDelay + mInputDelay + mSmoothnessFactor) {
        ALOGV("pipelineFull: too many inputs pending (%zu) in pipeline, with inputs released (%zu)",
              sizeWithInputsPending, sizeWithInputReleased);
        return true;
    }
    ALOGV("pipeline has room (total: %zu, input released: %zu)",
          mFramesInPipeline.size(), sizeWithInputReleased);
    return false;