summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive/LiveSession.h
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2015-04-08 09:06:54 -0700
committerRobert Shih <robertshih@google.com>2015-04-16 19:01:15 -0700
commit0852843d304006e3ab333081fddda13b07193de8 (patch)
treef60be26aad988e89bc135a86f6e4ae8853c69a49 /media/libstagefright/httplive/LiveSession.h
parent3d66eb4128aebef31bb0fa44c4d53d6122294a26 (diff)
downloadframeworks_av-0852843d304006e3ab333081fddda13b07193de8.zip
frameworks_av-0852843d304006e3ab333081fddda13b07193de8.tar.gz
frameworks_av-0852843d304006e3ab333081fddda13b07193de8.tar.bz2
stagefright: initial timed id3 support in hls
Change-Id: I00a8a786b3f4b74742c34770edd94e937abe20a8
Diffstat (limited to 'media/libstagefright/httplive/LiveSession.h')
-rw-r--r--media/libstagefright/httplive/LiveSession.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/media/libstagefright/httplive/LiveSession.h b/media/libstagefright/httplive/LiveSession.h
index ed74bc2..86d0498 100644
--- a/media/libstagefright/httplive/LiveSession.h
+++ b/media/libstagefright/httplive/LiveSession.h
@@ -23,6 +23,8 @@
#include <utils/String8.h>
+#include "mpeg2ts/ATSParser.h"
+
namespace android {
struct ABuffer;
@@ -47,12 +49,15 @@ struct LiveSession : public AHandler {
kVideoIndex = 1,
kSubtitleIndex = 2,
kMaxStreams = 3,
+ kMetaDataIndex = 3,
+ kNumSources = 4,
};
enum StreamType {
STREAMTYPE_AUDIO = 1 << kAudioIndex,
STREAMTYPE_VIDEO = 1 << kVideoIndex,
STREAMTYPE_SUBTITLES = 1 << kSubtitleIndex,
+ STREAMTYPE_METADATA = 1 << kMetaDataIndex,
};
enum SeekMode {
@@ -66,6 +71,7 @@ struct LiveSession : public AHandler {
uint32_t flags,
const sp<IMediaHTTPService> &httpService);
+ int64_t calculateMediaTimeUs(int64_t firstTimeUs, int64_t timeUs, int32_t discontinuitySeq);
status_t dequeueAccessUnit(StreamType stream, sp<ABuffer> *accessUnit);
status_t getStreamFormat(StreamType stream, sp<AMessage> *format);
@@ -92,6 +98,7 @@ struct LiveSession : public AHandler {
static const char *getKeyForStream(StreamType type);
static const char *getNameForStream(StreamType type);
+ static ATSParser::SourceType getSourceTypeForStream(StreamType type);
enum {
kWhatStreamsChanged,
@@ -101,6 +108,7 @@ struct LiveSession : public AHandler {
kWhatBufferingStart,
kWhatBufferingEnd,
kWhatBufferingUpdate,
+ kWhatMetadataDetected,
};
protected:
@@ -233,6 +241,8 @@ private:
bool mFirstTimeUsValid;
int64_t mFirstTimeUs;
int64_t mLastSeekTimeUs;
+ bool mHasMetadata;
+
KeyedVector<size_t, int64_t> mDiscontinuityAbsStartTimesUs;
KeyedVector<size_t, int64_t> mDiscontinuityOffsetTimesUs;
@@ -268,6 +278,11 @@ private:
sp<M3UParser> fetchPlaylist(
const char *url, uint8_t *curPlaylistHash, bool *unchanged);
+ bool UriIsSameAsIndex( const AString &uri, int32_t index, bool newUri);
+ sp<AnotherPacketSource> getPacketSourceForStreamIndex(size_t trackIndex, bool newUri);
+ sp<AnotherPacketSource> getMetadataSource(
+ sp<AnotherPacketSource> sources[kNumSources], uint32_t streamMask, bool newUri);
+
bool resumeFetcher(
const AString &uri, uint32_t streamMask,
int64_t timeUs = -1ll, bool newUri = false);