diff options
author | Jamie Gennis <jgennis@google.com> | 2011-01-16 18:17:34 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-01-16 18:17:34 -0800 |
commit | d97ea28b48b49c02cb9c0af015d1f11e8855d47b (patch) | |
tree | ce88ae76c0bfd7e67c59ccbe488b4cc24629b002 /include | |
parent | ecd797b12fd19a6e3cfe0e92a4a5601d395bb753 (diff) | |
parent | cf18c4788af740773c9b2720a1c4ed5f45454b8e (diff) | |
download | frameworks_base-d97ea28b48b49c02cb9c0af015d1f11e8855d47b.zip frameworks_base-d97ea28b48b49c02cb9c0af015d1f11e8855d47b.tar.gz frameworks_base-d97ea28b48b49c02cb9c0af015d1f11e8855d47b.tar.bz2 |
am cf18c478: Merge "Implement SurfaceTexture frame-available callback." into honeycomb
* commit 'cf18c4788af740773c9b2720a1c4ed5f45454b8e':
Implement SurfaceTexture frame-available callback.
Diffstat (limited to 'include')
-rw-r--r-- | include/gui/SurfaceTexture.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h index 002e48b..79c33f5 100644 --- a/include/gui/SurfaceTexture.h +++ b/include/gui/SurfaceTexture.h @@ -40,6 +40,10 @@ public: enum { MIN_BUFFER_SLOTS = 3 }; enum { NUM_BUFFER_SLOTS = 32 }; + struct FrameAvailableListener : public virtual RefBase { + virtual void onFrameAvailable() = 0; + }; + // tex indicates the name OpenGL texture to which images are to be streamed. // This texture name cannot be changed once the SurfaceTexture is created. SurfaceTexture(GLuint tex); @@ -93,6 +97,10 @@ public: // functions. void getTransformMatrix(float mtx[16]); + // setFrameAvailableListener sets the listener object that will be notified + // when a new frame becomes available. + void setFrameAvailableListener(const sp<FrameAvailableListener>& l); + private: // freeAllBuffers frees the resources (both GraphicBuffer and EGLImage) for @@ -195,6 +203,11 @@ private: // to a buffer, but other processes do. Vector<sp<GraphicBuffer> > mAllocdBuffers; + // mFrameAvailableListener is the listener object that will be called when a + // new frame becomes available. If it is not NULL it will be called from + // queueBuffer. + sp<FrameAvailableListener> mFrameAvailableListener; + // mMutex is the mutex used to prevent concurrent access to the member // variables of SurfaceTexture objects. It must be locked whenever the // member variables are accessed. |