diff options
author | Chong Zhang <chz@google.com> | 2015-07-13 18:44:44 -0700 |
---|---|---|
committer | Chong Zhang <chz@google.com> | 2015-07-14 16:53:48 -0700 |
commit | 5ef659e010e90175eb5282d9642a02f6105189bf (patch) | |
tree | dac0a68371f9a752ba4bb3527b3cd1d60a79c9ac /media/libstagefright/httplive/LiveSession.h | |
parent | 672d9ca1f0a35f3bda02ddfe81e0e10cebba99c3 (diff) | |
download | frameworks_av-5ef659e010e90175eb5282d9642a02f6105189bf.zip frameworks_av-5ef659e010e90175eb5282d9642a02f6105189bf.tar.gz frameworks_av-5ef659e010e90175eb5282d9642a02f6105189bf.tar.bz2 |
HLS: temporarily blacklist a variant if failed to fetch
- abort high bandwidth immediately when bandwidth is fluctuating
- use short-term bandwidth estimate for downswitch if bandwidth
is not stable
- discard bandwidth samples that's too old in absolute time
- if already underflow, switch to lowest bandwidth to catch up
- if error happened during bandwidth switch (likely due to new
variant link is broken), switch to lowest bandwidth to catch up
bug: 21754330
Change-Id: Ifd16d75e261cefb93b989829bf35a36783142ae0
Diffstat (limited to 'media/libstagefright/httplive/LiveSession.h')
-rw-r--r-- | media/libstagefright/httplive/LiveSession.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/media/libstagefright/httplive/LiveSession.h b/media/libstagefright/httplive/LiveSession.h index 21be413..90d56d0 100644 --- a/media/libstagefright/httplive/LiveSession.h +++ b/media/libstagefright/httplive/LiveSession.h @@ -146,6 +146,7 @@ private: struct BandwidthItem { size_t mPlaylistIndex; unsigned long mBandwidth; + int64_t mLastFailureUs; }; struct FetcherInfo { @@ -199,6 +200,7 @@ private: ssize_t mCurBandwidthIndex; ssize_t mOrigBandwidthIndex; int32_t mLastBandwidthBps; + bool mLastBandwidthStable; sp<BandwidthEstimator> mBandwidthEstimator; sp<M3UParser> mPlaylist; @@ -268,8 +270,10 @@ private: ssize_t currentBWIndex, ssize_t targetBWIndex) const; void addBandwidthMeasurement(size_t numBytes, int64_t delayUs); size_t getBandwidthIndex(int32_t bandwidthBps); + ssize_t getLowestValidBandwidthIndex() const; HLSTime latestMediaSegmentStartTime() const; + static bool isBandwidthValid(const BandwidthItem &item); static int SortByBandwidth(const BandwidthItem *, const BandwidthItem *); static StreamType indexToType(int idx); static ssize_t typeToIndex(int32_t type); @@ -287,6 +291,7 @@ private: sp<AMessage> &msg, int64_t delayUs, bool *needResumeUntil); bool switchBandwidthIfNeeded(bool bufferHigh, bool bufferLow); + bool tryBandwidthFallback(); void schedulePollBuffering(); void cancelPollBuffering(); |