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

Commit 3298d6fa authored by Wei Jia's avatar Wei Jia
Browse files

stagefright: make BufferQueueProducer not re-allocate buffer when trying to...

stagefright: make BufferQueueProducer not re-allocate buffer when trying to dequeue a buffer on devices not supporting meta data buffer mode.

Bug: 19666434
Change-Id: Id676486d6d4543af7c4da9553134082ab67a9699
parent 4275065e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -806,6 +806,11 @@ status_t ACodec::allocateOutputBuffersFromNativeWindow() {
        return err;
    mNumUndequeuedBuffers = minUndequeuedBuffers;

    if (!mStoreMetaDataInOutputBuffers) {
        static_cast<Surface*>(mNativeWindow.get())
                ->getIGraphicBufferProducer()->allowAllocation(true);
    }

    ALOGV("[%s] Allocating %u buffers from a native window of size %u on "
         "output port",
         mComponentName.c_str(), bufferCount, bufferSize);
@@ -864,6 +869,11 @@ status_t ACodec::allocateOutputBuffersFromNativeWindow() {
        }
    }

    if (!mStoreMetaDataInOutputBuffers) {
        static_cast<Surface*>(mNativeWindow.get())
                ->getIGraphicBufferProducer()->allowAllocation(false);
    }

    return err;
}