summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/httplive/LiveSession.cpp
diff options
context:
space:
mode:
authorLeena Winterrowd <lenhardw@codeaurora.org>2015-01-29 08:41:27 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-01-29 08:41:27 +0000
commit1eda9bfba04043c380666ba1ee86fd285b8ffbca (patch)
treeebf4401bd53fd91460b29eda1919179b75191767 /media/libstagefright/httplive/LiveSession.cpp
parent00dfe8432618c1d512557b2ed5910c44fc293948 (diff)
parentce25d85ad22e6df4b861d17e9e67cb6d0e62c363 (diff)
downloadframeworks_av-1eda9bfba04043c380666ba1ee86fd285b8ffbca.zip
frameworks_av-1eda9bfba04043c380666ba1ee86fd285b8ffbca.tar.gz
frameworks_av-1eda9bfba04043c380666ba1ee86fd285b8ffbca.tar.bz2
am ce25d85a: am a93fd2be: stagefright: httplive: Decouple block size from bandwidth estimate
* commit 'ce25d85ad22e6df4b861d17e9e67cb6d0e62c363': stagefright: httplive: Decouple block size from bandwidth estimate
Diffstat (limited to 'media/libstagefright/httplive/LiveSession.cpp')
-rw-r--r--media/libstagefright/httplive/LiveSession.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp
index c906aa8..190188a 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -49,6 +49,9 @@
namespace android {
+// Number of recently-read bytes to use for bandwidth estimation
+const size_t LiveSession::kBandwidthHistoryBytes = 200 * 1024;
+
LiveSession::LiveSession(
const sp<AMessage> &notify, uint32_t flags,
const sp<IMediaHTTPService> &httpService)
@@ -84,6 +87,13 @@ LiveSession::LiveSession(
mPacketSources2.add(indexToType(i), new AnotherPacketSource(NULL /* meta */));
mBuffering[i] = false;
}
+
+ size_t numHistoryItems = kBandwidthHistoryBytes /
+ PlaylistFetcher::kDownloadBlockSize + 1;
+ if (numHistoryItems < 5) {
+ numHistoryItems = 5;
+ }
+ mHTTPDataSource->setBandwidthHistorySize(numHistoryItems);
}
LiveSession::~LiveSession() {