am c90e35c1: am 8d300280: Merge "Support "pausing" of MediaSources with the effect that they no longer pull on their upstream source until a subsequent read-with-seek." into kraken

This commit is contained in:
Andreas Huber
2010-06-10 12:43:53 -07:00
committed by Android Git Automerger
3 changed files with 31 additions and 1 deletions

View File

@@ -20,6 +20,7 @@
#include <sys/types.h>
#include <media/stagefright/MediaErrors.h>
#include <utils/RefBase.h>
namespace android {
@@ -83,6 +84,13 @@ struct MediaSource : public RefBase {
int64_t mLatenessUs;
};
// Causes this source to suspend pulling data from its upstream source
// until a subsequent read-with-seek. Currently only supported by
// OMXCodec.
virtual status_t pause() {
return ERROR_UNSUPPORTED;
}
protected:
virtual ~MediaSource();

View File

@@ -52,6 +52,8 @@ struct OMXCodec : public MediaSource,
virtual status_t read(
MediaBuffer **buffer, const ReadOptions *options = NULL);
virtual status_t pause();
void on_message(const omx_message &msg);
// from MediaBufferObserver
@@ -144,6 +146,8 @@ private:
Mutex mLock;
Condition mAsyncCompletion;
bool mPaused;
// A list of indices into mPortStatus[kPortIndexOutput] filled with data.
List<size_t> mFilledBuffers;
Condition mBufferFilled;