OSDN Git Service

Fix error BufferQueue attaching flow.
authorJammy Yu <jammy.yu@mstarsemi.com>
Thu, 23 Feb 2017 00:41:38 +0000 (16:41 -0800)
committerShuzhen Wang <shuzhenwang@google.com>
Tue, 16 May 2017 21:43:14 +0000 (14:43 -0700)
Fix error BufferQueue attaching flow. Because BufferQueue attaching
buffer flow doesn't set mNeedsReallocation to false, it will case
Surface client to request buffer for attached buffer to cause unsync
buffer states with ACodec. So, for attaching buffer by Producer, we
need to set mNeedsReallocation to false in BufferQueue. And Surface
client will not request buffer again for attached buffer to cause
some missing frames.

Bug: 38238747
Issue: 34897483
Test: GTS
Change-Id: I25f9fff4b5d1f7052ab3be612cf34879fd17c27c

libs/gui/BufferQueueProducer.cpp

index 8159aef..6a5593c 100644 (file)
@@ -732,6 +732,7 @@ status_t BufferQueueProducer::attachBuffer(int* outSlot,
     mSlots[*outSlot].mFence = Fence::NO_FENCE;
     mSlots[*outSlot].mRequestBufferCalled = true;
     mSlots[*outSlot].mAcquireCalled = false;
+    mSlots[*outSlot].mNeedsReallocation = false;
     mCore->mActiveBuffers.insert(found);
     VALIDATE_CONSISTENCY();