From 3298d6fa642c11c5b004bdfc375252ff4c4536e3 Mon Sep 17 00:00:00 2001 From: Wei Jia Date: Tue, 28 Apr 2015 18:39:17 -0700 Subject: 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 --- media/libstagefright/ACodec.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index c7df5a0..5a58d42 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -806,6 +806,11 @@ status_t ACodec::allocateOutputBuffersFromNativeWindow() { return err; mNumUndequeuedBuffers = minUndequeuedBuffers; + if (!mStoreMetaDataInOutputBuffers) { + static_cast(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(mNativeWindow.get()) + ->getIGraphicBufferProducer()->allowAllocation(false); + } + return err; } -- cgit v1.1