diff options
author | Ramkumar Radhakrishnan <ramkumar@codeaurora.org> | 2012-11-06 20:44:04 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-03-10 22:55:58 -0700 |
commit | bbef29560e318cbdb0d4107b7fce6a2a64fd641b (patch) | |
tree | fa25faa6fdf12cc6de6dd74b24ca9405088cc891 /include/gui/BufferQueue.h | |
parent | 31152b94cd0471a3853fb658e9aff507d4eec384 (diff) | |
download | frameworks_native-bbef29560e318cbdb0d4107b7fce6a2a64fd641b.tar.gz frameworks_native-bbef29560e318cbdb0d4107b7fce6a2a64fd641b.tar.bz2 frameworks_native-bbef29560e318cbdb0d4107b7fce6a2a64fd641b.zip |
libgui: Add support to update buffer geometry.
Add native window properties NATIVE_WINDOW_UPDATE_BUFFERS_GEOMETRY
to the perform function of SurfaceTextureClient and SurfaceTexture
to update the width, height and format of the buffer dynamically
from the client before queue buffer call.
Change-Id: I62447fcf523b507d534085cd0835f55a978c4ead
Diffstat (limited to 'include/gui/BufferQueue.h')
-rw-r--r-- | include/gui/BufferQueue.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/gui/BufferQueue.h b/include/gui/BufferQueue.h index 02598b01a..cd38cfeb4 100644 --- a/include/gui/BufferQueue.h +++ b/include/gui/BufferQueue.h @@ -33,6 +33,23 @@ namespace android { // ---------------------------------------------------------------------------- +#ifdef QCOM_BSP +/* + * Structure to hold the buffer geometry + */ +struct QBufGeometry { + int mWidth; + int mHeight; + int mFormat; + QBufGeometry(): mWidth(0), mHeight(0), mFormat(0) {} + void set(int w, int h, int f) { + mWidth = w; + mHeight = h; + mFormat = f; + } +}; +#endif + class BufferQueue : public BnSurfaceTexture { public: enum { MIN_UNDEQUEUED_BUFFERS = 2 }; @@ -156,6 +173,11 @@ public: // to calculate the size for the buffer. this will take effect from next // dequeue buffer. virtual status_t setBuffersSize(int size); + + // update buffer width, height and format for a native buffer + // dynamically from the client which will take effect in the next + // queue buffer. + virtual status_t updateBuffersGeometry(int w, int h, int f); #endif // connect attempts to connect a producer client API to the BufferQueue. @@ -547,6 +569,11 @@ private: // mTransformHint is used to optimize for screen rotations uint32_t mTransformHint; + +#ifdef QCOM_BSP + // holds the updated buffer geometry info of the new video resolution. + QBufGeometry mNextBufferInfo; +#endif }; // ---------------------------------------------------------------------------- |