summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2012-06-22 14:42:00 -0700
committerJamie Gennis <jgennis@google.com>2012-06-22 14:43:59 -0700
commit2cd25a9056cc150b9fd3ac9b0bca37a1334ffd47 (patch)
tree47ec6f6b47b28af67095707b65bbfef4d7dd0dbe /include
parenteb15716b59020f342df62bce5b293f0603b94861 (diff)
downloadframeworks_av-2cd25a9056cc150b9fd3ac9b0bca37a1334ffd47.zip
frameworks_av-2cd25a9056cc150b9fd3ac9b0bca37a1334ffd47.tar.gz
frameworks_av-2cd25a9056cc150b9fd3ac9b0bca37a1334ffd47.tar.bz2
SurfaceMediaSource: keep refs to current buffers
This change fixes a bug in SurfaceMediaSource where it would not keep a reference to all of the Gralloc buffers that the video encoder is currently using. Bug: 6655597 Change-Id: Ifd99976cc7ae57ed724bbf2bbcff357a39497391
Diffstat (limited to 'include')
-rw-r--r--include/media/stagefright/SurfaceMediaSource.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/include/media/stagefright/SurfaceMediaSource.h b/include/media/stagefright/SurfaceMediaSource.h
index e25d444..4a8e221 100644
--- a/include/media/stagefright/SurfaceMediaSource.h
+++ b/include/media/stagefright/SurfaceMediaSource.h
@@ -79,10 +79,6 @@ public:
MediaBuffer **buffer, const ReadOptions *options = NULL);
virtual sp<MetaData> getFormat();
- // Pass the metadata over to the buffer, call when you have the lock
- void passMetadataBufferLocked(MediaBuffer **buffer);
- bool checkBufferMatchesSlot(int slot, MediaBuffer *buffer);
-
// Get / Set the frame rate used for encoding. Default fps = 30
status_t setFrameRate(int32_t fps) ;
int32_t getFrameRate( ) const;
@@ -105,9 +101,6 @@ public:
// when a new frame becomes available.
void setFrameAvailableListener(const sp<FrameAvailableListener>& listener);
- // getCurrentBuffer returns the buffer associated with the current image.
- sp<GraphicBuffer> getCurrentBuffer() const;
-
// dump our state in a String
void dump(String8& result) const;
void dump(String8& result, const char* prefix, char* buffer,
@@ -165,11 +158,12 @@ private:
// reset mCurrentTexture to INVALID_BUFFER_SLOT.
int mCurrentSlot;
- // mCurrentBuf is the graphic buffer of the current slot to be used by
- // buffer consumer. It's possible that this buffer is not associated
- // with any buffer slot, so we must track it separately in order to
- // properly use IGraphicBufferAlloc::freeAllGraphicBuffersExcept.
- sp<GraphicBuffer> mCurrentBuf;
+ // mCurrentBuffers is a list of the graphic buffers that are being used by
+ // buffer consumer (i.e. the video encoder). It's possible that these
+ // buffers are not associated with any buffer slots, so we must track them
+ // separately. Buffers are added to this list in read, and removed from
+ // this list in signalBufferReturned
+ Vector<sp<GraphicBuffer> > mCurrentBuffers;
// mCurrentTimestamp is the timestamp for the current texture. It
// gets set to mLastQueuedTimestamp each time updateTexImage is called.