diff options
author | Benny Wong <Benny.Wong@motorola.com> | 2009-07-15 18:44:27 -0500 |
---|---|---|
committer | Rebecca Schultz Zavin <rebecca@android.com> | 2009-07-16 14:31:20 -0700 |
commit | 6d2090e2148996f98a5e9bc7e359e41c226f4efb (patch) | |
tree | f585f655447a5df7b791fe01f26b97c836cc5014 /libs/ui | |
parent | f47042614e80891a3439d418e7061f642d9d593d (diff) | |
download | frameworks_base-6d2090e2148996f98a5e9bc7e359e41c226f4efb.zip frameworks_base-6d2090e2148996f98a5e9bc7e359e41c226f4efb.tar.gz frameworks_base-6d2090e2148996f98a5e9bc7e359e41c226f4efb.tar.bz2 |
Hardware overlay support
Enable hardware overlay support for camera and video playback use cases
Diffstat (limited to 'libs/ui')
-rw-r--r-- | libs/ui/Overlay.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libs/ui/Overlay.cpp b/libs/ui/Overlay.cpp index a092f8d..4854d6a 100644 --- a/libs/ui/Overlay.cpp +++ b/libs/ui/Overlay.cpp @@ -59,6 +59,18 @@ status_t Overlay::queueBuffer(overlay_buffer_t buffer) return mOverlayData->queueBuffer(mOverlayData, buffer); } +status_t Overlay::setCrop(uint32_t x, uint32_t y, uint32_t w, uint32_t h) +{ + if (mStatus != NO_ERROR) return mStatus; + return mOverlayData->setCrop(mOverlayData, x, y, w, h); +} + +status_t Overlay::getCrop(uint32_t* x, uint32_t* y, uint32_t* w, uint32_t* h) +{ + if (mStatus != NO_ERROR) return mStatus; + return mOverlayData->getCrop(mOverlayData, x, y, w, h); +} + int32_t Overlay::getBufferCount() const { if (mStatus != NO_ERROR) return mStatus; @@ -73,6 +85,15 @@ void* Overlay::getBufferAddress(overlay_buffer_t buffer) void Overlay::destroy() { if (mStatus != NO_ERROR) return; + + // Must delete the objects in reverse creation order, thus the + // data side must be closed first and then the destroy send to + // the control side. + if (mOverlayData) { + overlay_data_close(mOverlayData); + mOverlayData = NULL; + } + mOverlayRef->mOverlayChannel->destroy(); } |