Loading include/gui/BufferQueue.h +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ public: enum { NUM_BUFFER_SLOTS = 32 }; enum { NO_CONNECTED_API = 0 }; enum { INVALID_BUFFER_SLOT = -1 }; enum { STALE_BUFFER_SLOT = 1 }; enum { STALE_BUFFER_SLOT = 1, NO_BUFFER_AVAILABLE }; // ConsumerListener is the interface through which the BufferQueue notifies // the consumer of events that the consumer may wish to react to. Because Loading libs/gui/BufferQueue.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -851,8 +851,7 @@ status_t BufferQueue::acquireBuffer(BufferItem *buffer) { ATRACE_INT(mConsumerName.string(), mQueue.size()); } else { // should be a better return code? return -EINVAL; return NO_BUFFER_AVAILABLE; } return OK; Loading libs/gui/SurfaceTexture.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -211,7 +211,8 @@ status_t SurfaceTexture::updateTexImage() { // In asynchronous mode the list is guaranteed to be one buffer // deep, while in synchronous mode we use the oldest buffer. if (mBufferQueue->acquireBuffer(&item) == NO_ERROR) { err = mBufferQueue->acquireBuffer(&item); if (err == NO_ERROR) { int buf = item.mBuf; // This buffer was newly allocated, so we need to clean up on our side if (item.mGraphicBuffer != NULL) { Loading Loading @@ -247,7 +248,6 @@ status_t SurfaceTexture::updateTexImage() { glBindTexture(mTexTarget, mTexName); glEGLImageTargetTexture2DOES(mTexTarget, (GLeglImageOES)image); status_t err = OK; while ((error = glGetError()) != GL_NO_ERROR) { ST_LOGE("updateTexImage: error binding external texture image %p " "(slot %d): %#04x", image, buf, error); Loading Loading @@ -293,8 +293,12 @@ status_t SurfaceTexture::updateTexImage() { mCurrentTimestamp = item.mTimestamp; computeCurrentTransformMatrix(); } else { if (err < 0) { ALOGE("updateTexImage failed on acquire %d", err); } // We always bind the texture even if we don't update its contents. glBindTexture(mTexTarget, mTexName); return OK; } return err; Loading libs/gui/SurfaceTextureClient.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -200,23 +200,6 @@ int SurfaceTextureClient::getSlotFromBufferLocked( android_native_buffer_t* buffer) const { bool dumpedState = false; for (int i = 0; i < NUM_BUFFER_SLOTS; i++) { // XXX: Dump the slots whenever we hit a NULL entry while searching for // a buffer. if (mSlots[i] == NULL) { if (!dumpedState) { ALOGD("getSlotFromBufferLocked: encountered NULL buffer in slot %d " "looking for buffer %p", i, buffer->handle); for (int j = 0; j < NUM_BUFFER_SLOTS; j++) { if (mSlots[j] == NULL) { ALOGD("getSlotFromBufferLocked: %02d: NULL", j); } else { ALOGD("getSlotFromBufferLocked: %02d: %p", j, mSlots[j]->handle); } } dumpedState = true; } } if (mSlots[i] != NULL && mSlots[i]->handle == buffer->handle) { return i; } Loading Loading
include/gui/BufferQueue.h +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ public: enum { NUM_BUFFER_SLOTS = 32 }; enum { NO_CONNECTED_API = 0 }; enum { INVALID_BUFFER_SLOT = -1 }; enum { STALE_BUFFER_SLOT = 1 }; enum { STALE_BUFFER_SLOT = 1, NO_BUFFER_AVAILABLE }; // ConsumerListener is the interface through which the BufferQueue notifies // the consumer of events that the consumer may wish to react to. Because Loading
libs/gui/BufferQueue.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -851,8 +851,7 @@ status_t BufferQueue::acquireBuffer(BufferItem *buffer) { ATRACE_INT(mConsumerName.string(), mQueue.size()); } else { // should be a better return code? return -EINVAL; return NO_BUFFER_AVAILABLE; } return OK; Loading
libs/gui/SurfaceTexture.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -211,7 +211,8 @@ status_t SurfaceTexture::updateTexImage() { // In asynchronous mode the list is guaranteed to be one buffer // deep, while in synchronous mode we use the oldest buffer. if (mBufferQueue->acquireBuffer(&item) == NO_ERROR) { err = mBufferQueue->acquireBuffer(&item); if (err == NO_ERROR) { int buf = item.mBuf; // This buffer was newly allocated, so we need to clean up on our side if (item.mGraphicBuffer != NULL) { Loading Loading @@ -247,7 +248,6 @@ status_t SurfaceTexture::updateTexImage() { glBindTexture(mTexTarget, mTexName); glEGLImageTargetTexture2DOES(mTexTarget, (GLeglImageOES)image); status_t err = OK; while ((error = glGetError()) != GL_NO_ERROR) { ST_LOGE("updateTexImage: error binding external texture image %p " "(slot %d): %#04x", image, buf, error); Loading Loading @@ -293,8 +293,12 @@ status_t SurfaceTexture::updateTexImage() { mCurrentTimestamp = item.mTimestamp; computeCurrentTransformMatrix(); } else { if (err < 0) { ALOGE("updateTexImage failed on acquire %d", err); } // We always bind the texture even if we don't update its contents. glBindTexture(mTexTarget, mTexName); return OK; } return err; Loading
libs/gui/SurfaceTextureClient.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -200,23 +200,6 @@ int SurfaceTextureClient::getSlotFromBufferLocked( android_native_buffer_t* buffer) const { bool dumpedState = false; for (int i = 0; i < NUM_BUFFER_SLOTS; i++) { // XXX: Dump the slots whenever we hit a NULL entry while searching for // a buffer. if (mSlots[i] == NULL) { if (!dumpedState) { ALOGD("getSlotFromBufferLocked: encountered NULL buffer in slot %d " "looking for buffer %p", i, buffer->handle); for (int j = 0; j < NUM_BUFFER_SLOTS; j++) { if (mSlots[j] == NULL) { ALOGD("getSlotFromBufferLocked: %02d: NULL", j); } else { ALOGD("getSlotFromBufferLocked: %02d: %p", j, mSlots[j]->handle); } } dumpedState = true; } } if (mSlots[i] != NULL && mSlots[i]->handle == buffer->handle) { return i; } Loading