From 96dcc978430f0daf6d73fee96a01779ed537a0ce 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/SurfaceTextureClient.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'libs/gui/SurfaceTextureClient.cpp') diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp index ee14ac9006a4..43b330c79e77 100644 --- a/libs/gui/SurfaceTextureClient.cpp +++ b/libs/gui/SurfaceTextureClient.cpp @@ -143,8 +143,21 @@ int SurfaceTextureClient::queueBuffer(android_native_buffer_t* buffer) { int SurfaceTextureClient::query(int what, int* value) { LOGV("SurfaceTextureClient::query"); Mutex::Autolock lock(mMutex); - // XXX: Implement this! - return INVALID_OPERATION; + switch (what) { + case NATIVE_WINDOW_WIDTH: + case NATIVE_WINDOW_HEIGHT: + // XXX: How should SurfaceTexture behave if setBuffersGeometry didn't + // override the size? + *value = 0; + return NO_ERROR; + case NATIVE_WINDOW_FORMAT: + *value = DEFAULT_FORMAT; + return NO_ERROR; + case NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS: + *value = MIN_UNDEQUEUED_BUFFERS; + return NO_ERROR; + } + return BAD_VALUE; } int SurfaceTextureClient::perform(int operation, va_list args) -- cgit v1.2.3-59-g8ed1b