diff options
author | Jamie Gennis <jgennis@google.com> | 2011-01-16 18:15:36 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-16 18:15:36 -0800 |
commit | cf18c4788af740773c9b2720a1c4ed5f45454b8e (patch) | |
tree | cedb4dece79a0f609bf38744e2fbceabcf786957 /libs | |
parent | 41424adec8382af9064baf1d8bde29d7349a6155 (diff) | |
parent | 376590d668e22a918439877b55faf075427b13f3 (diff) | |
download | frameworks_base-cf18c4788af740773c9b2720a1c4ed5f45454b8e.zip frameworks_base-cf18c4788af740773c9b2720a1c4ed5f45454b8e.tar.gz frameworks_base-cf18c4788af740773c9b2720a1c4ed5f45454b8e.tar.bz2 |
Merge "Implement SurfaceTexture frame-available callback." into honeycomb
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gui/SurfaceTexture.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp index 88f1728..1dadd53 100644 --- a/libs/gui/SurfaceTexture.cpp +++ b/libs/gui/SurfaceTexture.cpp @@ -166,6 +166,9 @@ status_t SurfaceTexture::queueBuffer(int buf) { mLastQueued = buf; mLastQueuedCrop = mNextCrop; mLastQueuedTransform = mNextTransform; + if (mFrameAvailableListener != 0) { + mFrameAvailableListener->onFrameAvailable(); + } return OK; } @@ -294,6 +297,13 @@ void SurfaceTexture::getTransformMatrix(float mtx[16]) { mtxMul(mtx, mtxFlipV, mtxBeforeFlipV); } +void SurfaceTexture::setFrameAvailableListener( + const sp<FrameAvailableListener>& l) { + LOGV("SurfaceTexture::setFrameAvailableListener"); + Mutex::Autolock lock(mMutex); + mFrameAvailableListener = l; +} + void SurfaceTexture::freeAllBuffers() { for (int i = 0; i < NUM_BUFFER_SLOTS; i++) { mSlots[i].mGraphicBuffer = 0; |