diff options
author | Santhosh Behara <santhoshbehara@codeaurora.org> | 2015-09-29 11:24:21 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-10-12 00:05:02 -0700 |
commit | 97850dba0c3393126501991b8fa7431b7f130062 (patch) | |
tree | 38661814ac5474baf0a0fc897af454cc44c09f74 /media/libstagefright/httplive | |
parent | bae519fff60ceb8ceeb22c8d322cb8073e2a43d0 (diff) | |
download | frameworks_av-97850dba0c3393126501991b8fa7431b7f130062.zip frameworks_av-97850dba0c3393126501991b8fa7431b7f130062.tar.gz frameworks_av-97850dba0c3393126501991b8fa7431b7f130062.tar.bz2 |
httplive: Add default implementation in HLS for custom changes
Add getSeqNumberInLiveStreaming() function in PlayListFetcher
Make getBandwidthIndex() function to be virtual.
Change-Id: I5e2bc7a42e0d4a16d5b5ea5f2ec3d78a7d019ad3
Diffstat (limited to 'media/libstagefright/httplive')
-rw-r--r-- | media/libstagefright/httplive/LiveSession.h | 2 | ||||
-rw-r--r-- | media/libstagefright/httplive/PlaylistFetcher.cpp | 4 | ||||
-rw-r--r-- | media/libstagefright/httplive/PlaylistFetcher.h | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/media/libstagefright/httplive/LiveSession.h b/media/libstagefright/httplive/LiveSession.h index 4667c71..0d504e4 100644 --- a/media/libstagefright/httplive/LiveSession.h +++ b/media/libstagefright/httplive/LiveSession.h @@ -276,7 +276,7 @@ protected: float getAbortThreshold( ssize_t currentBWIndex, ssize_t targetBWIndex) const; void addBandwidthMeasurement(size_t numBytes, int64_t delayUs); - size_t getBandwidthIndex(int32_t bandwidthBps); + virtual size_t getBandwidthIndex(int32_t bandwidthBps); ssize_t getLowestValidBandwidthIndex() const; HLSTime latestMediaSegmentStartTime() const; diff --git a/media/libstagefright/httplive/PlaylistFetcher.cpp b/media/libstagefright/httplive/PlaylistFetcher.cpp index 5ad29c3..023de93 100644 --- a/media/libstagefright/httplive/PlaylistFetcher.cpp +++ b/media/libstagefright/httplive/PlaylistFetcher.cpp @@ -975,7 +975,9 @@ bool PlaylistFetcher::initDownloadState( if (mSegmentStartTimeUs < 0) { if (!mPlaylist->isComplete() && !mPlaylist->isEvent()) { // If this is a live session, start 3 segments from the end on connect - mSeqNumber = lastSeqNumberInPlaylist - 3; + if (!getSeqNumberInLiveStreaming()) { + mSeqNumber = lastSeqNumberInPlaylist - 3; + } if (mSeqNumber < firstSeqNumberInPlaylist) { mSeqNumber = firstSeqNumberInPlaylist; } diff --git a/media/libstagefright/httplive/PlaylistFetcher.h b/media/libstagefright/httplive/PlaylistFetcher.h index 74cc0dd..6b60b65 100644 --- a/media/libstagefright/httplive/PlaylistFetcher.h +++ b/media/libstagefright/httplive/PlaylistFetcher.h @@ -249,6 +249,7 @@ protected: void updateDuration(); void updateTargetDuration(); virtual bool checkSwitchBandwidth() { return false; } + virtual bool getSeqNumberInLiveStreaming() { return false; } DISALLOW_EVIL_CONSTRUCTORS(PlaylistFetcher); }; |