diff options
author | Jamie Gennis <jgennis@google.com> | 2011-07-19 12:08:33 -0700 |
---|---|---|
committer | Jamie Gennis <jgennis@google.com> | 2011-07-22 14:20:41 -0700 |
commit | 7b305fffc39d0fe0926e7fd2d7f6a524fbce62b7 (patch) | |
tree | 4cede8cb10a7b51bf2198e3ddbb4d2f20b44ea4b /libs/gui/SurfaceTextureClient.cpp | |
parent | 6e50219aee68ae6e76943f969374dae1b27154b3 (diff) | |
download | frameworks_native-7b305fffc39d0fe0926e7fd2d7f6a524fbce62b7.zip frameworks_native-7b305fffc39d0fe0926e7fd2d7f6a524fbce62b7.tar.gz frameworks_native-7b305fffc39d0fe0926e7fd2d7f6a524fbce62b7.tar.bz2 |
SurfaceTexture: add the abandon method.
This change adds the 'abandon' method to the SurfaceTexture C++ class.
This method may be used to put the SurfaceTexture in an abandoned state,
causing all ISurfaceTexture methods to fail.
Change-Id: Ibd261f7b73f44e2bec36a8508bf92113cfb7cf95
Diffstat (limited to 'libs/gui/SurfaceTextureClient.cpp')
-rw-r--r-- | libs/gui/SurfaceTextureClient.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp index 688b99b..df0ad5a 100644 --- a/libs/gui/SurfaceTextureClient.cpp +++ b/libs/gui/SurfaceTextureClient.cpp @@ -148,10 +148,11 @@ int SurfaceTextureClient::dequeueBuffer(android_native_buffer_t** buffer) { } if ((result & ISurfaceTexture::BUFFER_NEEDS_REALLOCATION) || gbuf == 0) { - gbuf = mSurfaceTexture->requestBuffer(buf); - if (gbuf == 0) { - LOGE("dequeueBuffer: ISurfaceTexture::requestBuffer failed"); - return NO_MEMORY; + result = mSurfaceTexture->requestBuffer(buf, &gbuf); + if (result != NO_ERROR) { + LOGE("dequeueBuffer: ISurfaceTexture::requestBuffer failed: %d", + result); + return result; } mQueryWidth = gbuf->width; mQueryHeight = gbuf->height; |