summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-03-17 16:27:56 -0700
committerChong Zhang <chz@google.com>2015-03-27 15:36:39 -0700
commit7c8708046117e03c0d38006bdd9685139df3ac6b (patch)
treee921d42722d2c627e3c002560dadd5ea501e3919 /media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
parent514d7af22c5d6526309e71fadcff42b072c30241 (diff)
downloadframeworks_av-7c8708046117e03c0d38006bdd9685139df3ac6b.zip
frameworks_av-7c8708046117e03c0d38006bdd9685139df3ac6b.tar.gz
frameworks_av-7c8708046117e03c0d38006bdd9685139df3ac6b.tar.bz2
HLS: faster switching and pause/resume on low buffer
- when upswitching, discard excessive buffering on low bandwidth variant, switch to new variant earlier - when downswitching, report newly found IDR positions continuously, and switch as soon as new fetcher passes playback position. This allows us to skip time-consuming resumeUntil() of old fetcher most of the time - implement pause/resume on low buffering, and notify buffering percentage - buffering parameter tuning, separate pause/resume/ready buffer level and up/down switch buffer level, boost up fetcher buffering significantly bug: 19567254 Change-Id: I750dfcc6f861d78d16a71f501beb86d8129cb048
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp')
-rw-r--r--media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
index d01e83a..0476c9b 100644
--- a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
@@ -281,6 +281,34 @@ void NuPlayer::HTTPLiveSource::onSessionNotify(const sp<AMessage> &msg) {
break;
}
+ case LiveSession::kWhatBufferingStart:
+ {
+ sp<AMessage> notify = dupNotify();
+ notify->setInt32("what", kWhatPauseOnBufferingStart);
+ notify->post();
+ break;
+ }
+
+ case LiveSession::kWhatBufferingEnd:
+ {
+ sp<AMessage> notify = dupNotify();
+ notify->setInt32("what", kWhatResumeOnBufferingEnd);
+ notify->post();
+ break;
+ }
+
+
+ case LiveSession::kWhatBufferingUpdate:
+ {
+ sp<AMessage> notify = dupNotify();
+ int32_t percentage;
+ CHECK(msg->findInt32("percentage", &percentage));
+ notify->setInt32("what", kWhatBufferingUpdate);
+ notify->setInt32("percentage", percentage);
+ notify->post();
+ break;
+ }
+
case LiveSession::kWhatError:
{
break;