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

Commit 0bd49eb4 authored by Dan Stoza's avatar Dan Stoza Committed by android-build-merger
Browse files

Merge "Fix the execution point of onFrameAvailable/onFrameReplaced callbacks"...

Merge "Fix the execution point of onFrameAvailable/onFrameReplaced callbacks" am: 789ede37 am: 67322258
am: d76538a4

* commit 'd76538a4':
  Fix the execution point of onFrameAvailable/onFrameReplaced callbacks
parents 93b94d5e d76538a4
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -809,15 +809,6 @@ status_t BufferQueueProducer::queueBuffer(int slot,
        mCore->validateConsistencyLocked();
    } // Autolock scope

    // Wait without lock held
    if (mCore->mConnectedApi == NATIVE_WINDOW_API_EGL) {
        // Waiting here allows for two full buffers to be queued but not a
        // third. In the event that frames take varying time, this makes a
        // small trade-off in favor of latency rather than throughput.
        mLastQueueBufferFence->waitForever("Throttling EGL Production");
        mLastQueueBufferFence = fence;
    }

    // Don't send the GraphicBuffer through the callback, and don't send
    // the slot number, since the consumer shouldn't need it
    item.mGraphicBuffer.clear();
@@ -841,6 +832,15 @@ status_t BufferQueueProducer::queueBuffer(int slot,
        mCallbackCondition.broadcast();
    }

    // Wait without lock held
    if (mCore->mConnectedApi == NATIVE_WINDOW_API_EGL) {
        // Waiting here allows for two full buffers to be queued but not a
        // third. In the event that frames take varying time, this makes a
        // small trade-off in favor of latency rather than throughput.
        mLastQueueBufferFence->waitForever("Throttling EGL Production");
        mLastQueueBufferFence = fence;
    }

    return NO_ERROR;
}