summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive/LiveSession.h
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2014-02-14 12:21:50 -0800
committerRobert Shih <robertshih@google.com>2014-02-20 13:22:35 -0800
commit8ca002eedc747dd854b61cbe364b52c06869273f (patch)
treee73f8513ea311757dcfa9702ebb060e528655688 /media/libstagefright/httplive/LiveSession.h
parente9841c60ab2b954b97628801bd3bb2f84a69a35e (diff)
downloadframeworks_av-8ca002eedc747dd854b61cbe364b52c06869273f.zip
frameworks_av-8ca002eedc747dd854b61cbe364b52c06869273f.tar.gz
frameworks_av-8ca002eedc747dd854b61cbe364b52c06869273f.tar.bz2
LiveSession refactor
Change-Id: Ia91dce109835e042f72934376d4838b4cc72cb10
Diffstat (limited to 'media/libstagefright/httplive/LiveSession.h')
-rw-r--r--media/libstagefright/httplive/LiveSession.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/media/libstagefright/httplive/LiveSession.h b/media/libstagefright/httplive/LiveSession.h
index 00569be..973f2fa 100644
--- a/media/libstagefright/httplive/LiveSession.h
+++ b/media/libstagefright/httplive/LiveSession.h
@@ -44,10 +44,17 @@ struct LiveSession : public AHandler {
uint32_t flags,
const sp<IMediaHTTPService> &httpService);
+ enum StreamIndex {
+ kAudioIndex = 0,
+ kVideoIndex = 1,
+ kSubtitleIndex = 2,
+ kMaxStreams = 3,
+ };
+
enum StreamType {
- STREAMTYPE_AUDIO = 1,
- STREAMTYPE_VIDEO = 2,
- STREAMTYPE_SUBTITLES = 4,
+ STREAMTYPE_AUDIO = 1 << kAudioIndex,
+ STREAMTYPE_VIDEO = 1 << kVideoIndex,
+ STREAMTYPE_SUBTITLES = 1 << kSubtitleIndex,
};
status_t dequeueAccessUnit(StreamType stream, sp<ABuffer> *accessUnit);
@@ -107,6 +114,19 @@ private:
bool mIsPrepared;
};
+ struct StreamItem {
+ const char *mType;
+ AString mUri;
+ StreamItem() : mType("") {}
+ StreamItem(const char *type) : mType(type) {}
+ AString uriKey() {
+ AString key(mType);
+ key.append("URI");
+ return key;
+ }
+ };
+ StreamItem mStreams[kMaxStreams];
+
sp<AMessage> mNotify;
uint32_t mFlags;
sp<IMediaHTTPService> mHTTPService;
@@ -124,7 +144,6 @@ private:
sp<M3UParser> mPlaylist;
KeyedVector<AString, FetcherInfo> mFetcherInfos;
- AString mAudioURI, mVideoURI, mSubtitleURI;
uint32_t mStreamMask;
KeyedVector<StreamType, sp<AnotherPacketSource> > mPacketSources;
@@ -172,6 +191,7 @@ private:
size_t getBandwidthIndex();
static int SortByBandwidth(const BandwidthItem *, const BandwidthItem *);
+ static StreamType indexToType(int idx);
void changeConfiguration(
int64_t timeUs, size_t bandwidthIndex, bool pickTrack = false);