From 9d4d6c101d90d4a1d1ca9413cf3eb89d1f1898d6 Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Sun, 27 Feb 2011 14:10:20 -0800 Subject: Add the MIN_UNDEQUEUED_BUFFERS query to ANW. This change adds a new query to ANativeWindow for getting the minimum number of buffers that must be left un-dequeued during the steady-state operation of the ANativeWindow. Change-Id: Ie8c461fc26b02ecde02ddb4f95bf763662cf1551 Related-Bug: 3356050 --- libs/gui/SurfaceTexture.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libs/gui/SurfaceTexture.cpp') diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp index 223cf091e7..3bed959861 100644 --- a/libs/gui/SurfaceTexture.cpp +++ b/libs/gui/SurfaceTexture.cpp @@ -96,6 +96,11 @@ SurfaceTexture::~SurfaceTexture() { status_t SurfaceTexture::setBufferCount(int bufferCount) { LOGV("SurfaceTexture::setBufferCount"); + + if (bufferCount < MIN_BUFFER_SLOTS) { + return BAD_VALUE; + } + Mutex::Autolock lock(mMutex); freeAllBuffers(); mBufferCount = bufferCount; -- cgit v1.2.3-59-g8ed1b