diff options
Diffstat (limited to 'media/libstagefright/include')
-rw-r--r-- | media/libstagefright/include/LiveSource.h | 7 | ||||
-rw-r--r-- | media/libstagefright/include/M3UParser.h | 2 | ||||
-rw-r--r-- | media/libstagefright/include/MPEG2TSExtractor.h | 12 | ||||
-rw-r--r-- | media/libstagefright/include/NuCachedSource2.h | 6 |
4 files changed, 23 insertions, 4 deletions
diff --git a/media/libstagefright/include/LiveSource.h b/media/libstagefright/include/LiveSource.h index 5e89581..55dd45e 100644 --- a/media/libstagefright/include/LiveSource.h +++ b/media/libstagefright/include/LiveSource.h @@ -40,6 +40,11 @@ struct LiveSource : public DataSource { return kWantsPrefetching; } + bool getDuration(int64_t *durationUs) const; + + bool isSeekable() const; + bool seekTo(int64_t seekTimeUs); + protected: virtual ~LiveSource(); @@ -53,6 +58,7 @@ private: AString mMasterURL; AString mURL; status_t mInitCheck; + int64_t mDurationUs; sp<M3UParser> mPlaylist; int32_t mFirstItemSequenceNumber; @@ -72,6 +78,7 @@ private: bool switchToNext(); bool loadPlaylist(bool fetchMaster); + void determineSeekability(); DISALLOW_EVIL_CONSTRUCTORS(LiveSource); }; diff --git a/media/libstagefright/include/M3UParser.h b/media/libstagefright/include/M3UParser.h index 69199ab..bd9eebe 100644 --- a/media/libstagefright/include/M3UParser.h +++ b/media/libstagefright/include/M3UParser.h @@ -32,6 +32,7 @@ struct M3UParser : public RefBase { bool isExtM3U() const; bool isVariantPlaylist() const; + bool isComplete() const; sp<AMessage> meta(); @@ -52,6 +53,7 @@ private: AString mBaseURI; bool mIsExtM3U; bool mIsVariantPlaylist; + bool mIsComplete; sp<AMessage> mMeta; Vector<Item> mItems; diff --git a/media/libstagefright/include/MPEG2TSExtractor.h b/media/libstagefright/include/MPEG2TSExtractor.h index 1bf4cd1..d83b538 100644 --- a/media/libstagefright/include/MPEG2TSExtractor.h +++ b/media/libstagefright/include/MPEG2TSExtractor.h @@ -15,6 +15,7 @@ struct ATSParser; struct DataSource; struct MPEG2TSSource; struct String8; +struct LiveSource; struct MPEG2TSExtractor : public MediaExtractor { MPEG2TSExtractor(const sp<DataSource> &source); @@ -25,16 +26,19 @@ struct MPEG2TSExtractor : public MediaExtractor { virtual sp<MetaData> getMetaData(); - virtual uint32_t flags() const { - return CAN_PAUSE; - } + virtual uint32_t flags() const; + + void setLiveSource(const sp<LiveSource> &liveSource); + void seekTo(int64_t seekTimeUs); private: friend struct MPEG2TSSource; - Mutex mLock; + mutable Mutex mLock; sp<DataSource> mDataSource; + sp<LiveSource> mLiveSource; + sp<ATSParser> mParser; Vector<sp<AnotherPacketSource> > mSourceImpls; diff --git a/media/libstagefright/include/NuCachedSource2.h b/media/libstagefright/include/NuCachedSource2.h index 3a20c16..1fb2088 100644 --- a/media/libstagefright/include/NuCachedSource2.h +++ b/media/libstagefright/include/NuCachedSource2.h @@ -42,6 +42,9 @@ struct NuCachedSource2 : public DataSource { size_t cachedSize(); size_t approxDataRemaining(bool *eos); + void suspend(); + void clearCacheAndResume(); + protected: virtual ~NuCachedSource2(); @@ -61,6 +64,7 @@ private: enum { kWhatFetchMore = 'fetc', kWhatRead = 'read', + kWhatSuspend = 'susp', }; sp<DataSource> mSource; @@ -78,10 +82,12 @@ private: sp<AMessage> mAsyncResult; bool mFetching; int64_t mLastFetchTimeUs; + bool mSuspended; void onMessageReceived(const sp<AMessage> &msg); void onFetch(); void onRead(const sp<AMessage> &msg); + void onSuspend(); void fetchInternal(); ssize_t readInternal(off_t offset, void *data, size_t size); |