From cb5b766bb0a3ed992998a5bd66de0ee1d2223b81 Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Wed, 28 Mar 2012 16:38:37 -0700 Subject: Add ABuffer support to SkipCutBuffer Add support for ABuffer to SkipCutBuffer, and make it (re)allocate an appropriately sized buffer when needed, rather then relying on the caller to tell it ahead of time how big the buffers are going to be. Change-Id: I8b5c9ba5dd2fc13ef8870b7d4fe93a1bfdc7a626 --- include/media/stagefright/SkipCutBuffer.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/media/stagefright/SkipCutBuffer.h b/include/media/stagefright/SkipCutBuffer.h index 5c7cd47..27851ca 100644 --- a/include/media/stagefright/SkipCutBuffer.h +++ b/include/media/stagefright/SkipCutBuffer.h @@ -19,6 +19,7 @@ #define SKIP_CUT_BUFFER_H_ #include +#include namespace android { @@ -30,14 +31,14 @@ class SkipCutBuffer { public: // 'skip' is the number of bytes to skip from the beginning // 'cut' is the number of bytes to cut from the end - // 'output_size' is the size in bytes of the MediaBuffers that will be used - SkipCutBuffer(int32_t skip, int32_t cut, int32_t output_size); + SkipCutBuffer(int32_t skip, int32_t cut); virtual ~SkipCutBuffer(); // Submit one MediaBuffer for skipping and cutting. This may consume all or // some of the data in the buffer, or it may add data to it. // After this, the caller should continue processing the buffer as usual. void submit(MediaBuffer *buffer); + void submit(const sp& buffer); // same as above, but with an ABuffer void clear(); size_t size(); // how many bytes are currently stored in the buffer -- cgit v1.1