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

Commit c8d8dc9a authored by Sungtak Lee's avatar Sungtak Lee Committed by android-build-merger
Browse files

codec2: increase max dequeue output buffer count

am: e151ed6e

Change-Id: Ieb52b79b124931d115c78bcf411e97024a9a9a99
parents 5b08ddf7 e151ed6e
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ CCodecBufferChannel::CCodecBufferChannel(
      mFirstValidFrameIndex(0u),
      mMetaMode(MODE_NONE),
      mInputMetEos(false) {
    mOutputSurface.lock()->maxDequeueBuffers = kSmoothnessFactor + kRenderingDepth;
    mOutputSurface.lock()->maxDequeueBuffers = 2 * kSmoothnessFactor + kRenderingDepth;
    {
        Mutexed<Input>::Locked input(mInput);
        input->buffers.reset(new DummyInputBuffers(""));
@@ -948,7 +948,8 @@ status_t CCodecBufferChannel::start(
        uint32_t outputGeneration;
        {
            Mutexed<OutputSurface>::Locked output(mOutputSurface);
            output->maxDequeueBuffers = numOutputSlots + reorderDepth.value + kRenderingDepth;
            output->maxDequeueBuffers = numOutputSlots + numInputSlots +
                    reorderDepth.value + kRenderingDepth;
            outputSurface = output->surface ?
                    output->surface->getIGraphicBufferProducer() : nullptr;
            if (outputSurface) {
@@ -1332,9 +1333,10 @@ bool CCodecBufferChannel::handleWork(
                    ALOGV("[%s] onWorkDone: updated reorder depth to %u",
                          mName, reorderDepth.value);
                    size_t numOutputSlots = mOutput.lock()->numSlots;
                    size_t numInputSlots = mInput.lock()->numSlots;
                    Mutexed<OutputSurface>::Locked output(mOutputSurface);
                    output->maxDequeueBuffers =
                        numOutputSlots + reorderDepth.value + kRenderingDepth;
                    output->maxDequeueBuffers = numOutputSlots + numInputSlots +
                            reorderDepth.value + kRenderingDepth;
                    if (output->surface) {
                        output->surface->setMaxDequeuedBufferCount(output->maxDequeueBuffers);
                    }
@@ -1382,6 +1384,7 @@ bool CCodecBufferChannel::handleWork(

                        bool outputBuffersChanged = false;
                        size_t numOutputSlots = 0;
                        size_t numInputSlots = mInput.lock()->numSlots;
                        {
                            Mutexed<Output>::Locked output(mOutput);
                            output->outputDelay = outputDelay.value;
@@ -1406,7 +1409,8 @@ bool CCodecBufferChannel::handleWork(

                        uint32_t depth = mReorderStash.lock()->depth();
                        Mutexed<OutputSurface>::Locked output(mOutputSurface);
                        output->maxDequeueBuffers = numOutputSlots + depth + kRenderingDepth;
                        output->maxDequeueBuffers = numOutputSlots + numInputSlots +
                                depth + kRenderingDepth;
                        if (output->surface) {
                            output->surface->setMaxDequeuedBufferCount(output->maxDequeueBuffers);
                        }
+1 −1
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ PipelineWatcher::Clock::duration PipelineWatcher::elapsed(
              std::chrono::duration_cast<std::chrono::milliseconds>(elapsed).count());
        durations.push_back(elapsed);
    }
    std::nth_element(durations.begin(), durations.end(), durations.begin() + n,
    std::nth_element(durations.begin(), durations.begin() + n, durations.end(),
                     std::greater<Clock::duration>());
    return durations[n];
}