diff options
author | Dan Stoza <stoza@google.com> | 2015-12-08 09:08:13 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-12-08 09:08:13 -0800 |
commit | 67322258c0a42852bee446a5a99f8b64e1953683 (patch) | |
tree | 10401565a1ca8c9064a4d38c8ec244bfc5877072 | |
parent | bc432368f410d628d21435c9f8fbcdf6bb68ef95 (diff) | |
parent | 789ede379d2f19ce284866c72bcaad7e8255b1cc (diff) | |
download | native-67322258c0a42852bee446a5a99f8b64e1953683.tar.gz |
Merge "Fix the execution point of onFrameAvailable/onFrameReplaced callbacks"
am: 789ede379d
* commit '789ede379d2f19ce284866c72bcaad7e8255b1cc':
Fix the execution point of onFrameAvailable/onFrameReplaced callbacks
-rw-r--r-- | libs/gui/BufferQueueProducer.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp index 87e5b4d279..a941e2d29a 100644 --- a/libs/gui/BufferQueueProducer.cpp +++ b/libs/gui/BufferQueueProducer.cpp @@ -696,15 +696,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(); @@ -728,6 +719,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; } |