From f580806d893c4631f5324ff0af5c2db68a40ef42 Mon Sep 17 00:00:00 2001 From: Robert Shih Date: Mon, 22 Dec 2014 11:46:50 -0800 Subject: HLS: QCom enhancements This commit consists of: http://go/pag/c/188753 Add NULL check for empty playlist http://go/pag/c/188754 Fix deadlock for low duration clips http://go/pag/c/188757 Create a copy of last enqueued metadata http://go/pag/c/188755 Propagate target duration to LiveSession http://go/pag/c/188762 Decouple block size from bandwidth estimate http://go/pag/c/188756 Reduce memcpy calls for chunked content http://go/pag/c/188758 Dont resume if we have almost fetched till stop time Bug: 18821145 Change-Id: I7fd650999c6c50bbadffd65adee9020e669dfe62 --- media/libstagefright/HTTPBase.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'media/libstagefright/HTTPBase.cpp') diff --git a/media/libstagefright/HTTPBase.cpp b/media/libstagefright/HTTPBase.cpp index 32291c8..0c2ff15 100644 --- a/media/libstagefright/HTTPBase.cpp +++ b/media/libstagefright/HTTPBase.cpp @@ -36,7 +36,8 @@ HTTPBase::HTTPBase() mTotalTransferBytes(0), mPrevBandwidthMeasureTimeUs(0), mPrevEstimatedBandWidthKbps(0), - mBandWidthCollectFreqMs(5000) { + mBandWidthCollectFreqMs(5000), + mMaxBandwidthHistoryItems(100) { } void HTTPBase::addBandwidthMeasurement( @@ -50,7 +51,7 @@ void HTTPBase::addBandwidthMeasurement( mTotalTransferBytes += numBytes; mBandwidthHistory.push_back(entry); - if (++mNumBandwidthHistoryItems > 100) { + if (++mNumBandwidthHistoryItems > mMaxBandwidthHistoryItems) { BandwidthEntry *entry = &*mBandwidthHistory.begin(); mTotalTransferTimeUs -= entry->mDelayUs; mTotalTransferBytes -= entry->mNumBytes; @@ -104,6 +105,10 @@ status_t HTTPBase::setBandwidthStatCollectFreq(int32_t freqMs) { return OK; } +void HTTPBase::setBandwidthHistorySize(size_t numHistoryItems) { + mMaxBandwidthHistoryItems = numHistoryItems; +} + // static void HTTPBase::RegisterSocketUserTag(int sockfd, uid_t uid, uint32_t kTag) { int res = qtaguid_tagSocket(sockfd, kTag, uid); -- cgit v1.1