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

Commit 7b21efcf authored by Wei Jia's avatar Wei Jia Committed by Android (Google) Code Review
Browse files

Merge "stagefright: make BufferQueueProducer not re-allocate buffer when...

Merge "stagefright: make BufferQueueProducer not re-allocate buffer when trying to dequeue a buffer on devices not supporting meta data buffer mode." into mnc-dev
parents 291a39b9 3298d6fa
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;
}