Loading include/gui/BufferQueue.h +2 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,8 @@ public: BufferQueue(bool allowSynchronousMode = true); virtual ~BufferQueue(); virtual int query(int what, int* value); // setBufferCount updates the number of available buffer slots. After // calling this all buffer slots are both unallocated and owned by the // BufferQueue object (i.e. they are not owned by the client). Loading include/gui/SurfaceTexture.h +1 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ public: virtual ~SurfaceTexture(); virtual int query(int what, int* value); // updateTexImage sets the image contents of the target texture to that of // the most recently queued buffer. Loading libs/gui/BufferQueue.cpp +31 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,37 @@ status_t BufferQueue::setBufferCount(int bufferCount) { return OK; } int BufferQueue::query(int what, int* outValue) { Mutex::Autolock lock(mMutex); if (mAbandoned) { ST_LOGE("query: SurfaceTexture has been abandoned!"); return NO_INIT; } int value; switch (what) { case NATIVE_WINDOW_WIDTH: value = mDefaultWidth; break; case NATIVE_WINDOW_HEIGHT: value = mDefaultHeight; break; case NATIVE_WINDOW_FORMAT: value = mPixelFormat; break; case NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS: value = mSynchronousMode ? (MIN_UNDEQUEUED_BUFFERS-1) : MIN_UNDEQUEUED_BUFFERS; break; default: return BAD_VALUE; } outValue[0] = value; return NO_ERROR; } status_t BufferQueue::requestBuffer(int slot, sp<GraphicBuffer>* buf) { ST_LOGV("requestBuffer: slot=%d", slot); Mutex::Autolock lock(mMutex); Loading libs/gui/SurfaceTexture.cpp +0 −29 Original line number Diff line number Diff line Loading @@ -416,36 +416,7 @@ bool SurfaceTexture::isSynchronousMode() const { return mSynchronousMode; } int SurfaceTexture::query(int what, int* outValue) { Mutex::Autolock lock(mMutex); if (mAbandoned) { ST_LOGE("query: SurfaceTexture has been abandoned!"); return NO_INIT; } int value; switch (what) { case NATIVE_WINDOW_WIDTH: value = mDefaultWidth; break; case NATIVE_WINDOW_HEIGHT: value = mDefaultHeight; break; case NATIVE_WINDOW_FORMAT: value = mPixelFormat; break; case NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS: value = mSynchronousMode ? (MIN_UNDEQUEUED_BUFFERS-1) : MIN_UNDEQUEUED_BUFFERS; break; default: return BAD_VALUE; } outValue[0] = value; return NO_ERROR; } void SurfaceTexture::abandon() { Mutex::Autolock lock(mMutex); Loading Loading
include/gui/BufferQueue.h +2 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,8 @@ public: BufferQueue(bool allowSynchronousMode = true); virtual ~BufferQueue(); virtual int query(int what, int* value); // setBufferCount updates the number of available buffer slots. After // calling this all buffer slots are both unallocated and owned by the // BufferQueue object (i.e. they are not owned by the client). Loading
include/gui/SurfaceTexture.h +1 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ public: virtual ~SurfaceTexture(); virtual int query(int what, int* value); // updateTexImage sets the image contents of the target texture to that of // the most recently queued buffer. Loading
libs/gui/BufferQueue.cpp +31 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,37 @@ status_t BufferQueue::setBufferCount(int bufferCount) { return OK; } int BufferQueue::query(int what, int* outValue) { Mutex::Autolock lock(mMutex); if (mAbandoned) { ST_LOGE("query: SurfaceTexture has been abandoned!"); return NO_INIT; } int value; switch (what) { case NATIVE_WINDOW_WIDTH: value = mDefaultWidth; break; case NATIVE_WINDOW_HEIGHT: value = mDefaultHeight; break; case NATIVE_WINDOW_FORMAT: value = mPixelFormat; break; case NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS: value = mSynchronousMode ? (MIN_UNDEQUEUED_BUFFERS-1) : MIN_UNDEQUEUED_BUFFERS; break; default: return BAD_VALUE; } outValue[0] = value; return NO_ERROR; } status_t BufferQueue::requestBuffer(int slot, sp<GraphicBuffer>* buf) { ST_LOGV("requestBuffer: slot=%d", slot); Mutex::Autolock lock(mMutex); Loading
libs/gui/SurfaceTexture.cpp +0 −29 Original line number Diff line number Diff line Loading @@ -416,36 +416,7 @@ bool SurfaceTexture::isSynchronousMode() const { return mSynchronousMode; } int SurfaceTexture::query(int what, int* outValue) { Mutex::Autolock lock(mMutex); if (mAbandoned) { ST_LOGE("query: SurfaceTexture has been abandoned!"); return NO_INIT; } int value; switch (what) { case NATIVE_WINDOW_WIDTH: value = mDefaultWidth; break; case NATIVE_WINDOW_HEIGHT: value = mDefaultHeight; break; case NATIVE_WINDOW_FORMAT: value = mPixelFormat; break; case NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS: value = mSynchronousMode ? (MIN_UNDEQUEUED_BUFFERS-1) : MIN_UNDEQUEUED_BUFFERS; break; default: return BAD_VALUE; } outValue[0] = value; return NO_ERROR; } void SurfaceTexture::abandon() { Mutex::Autolock lock(mMutex); Loading