diff options
| author | 2011-07-19 12:08:33 -0700 | |
|---|---|---|
| committer | 2011-07-22 14:20:41 -0700 | |
| commit | 5ef59bc764d6bcd0ccf0a266d7d9ab792668a3e9 (patch) | |
| tree | aa5b98091b69c5f5d65618acd90b0e6ebf543ec3 /libs/gui/SurfaceTextureClient.cpp | |
| parent | b71a4beb1afb3f91201cd416e8e56733ba17913e (diff) | |
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 688b99b7533f..df0ad5abe3e2 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; |