summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2013-02-05 13:59:56 -0800
committerAndreas Huber <andih@google.com>2013-02-05 14:09:08 -0800
commit9575c96b6e418914e2ffc6741ecc8d71e3968dbe (patch)
tree1fafdf4d3150799cf9a4266919bf069b7f007c91 /media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
parent84ca0414fedea2dfe51607b422f6227e1c4f0d7f (diff)
downloadframeworks_av-9575c96b6e418914e2ffc6741ecc8d71e3968dbe.zip
frameworks_av-9575c96b6e418914e2ffc6741ecc8d71e3968dbe.tar.gz
frameworks_av-9575c96b6e418914e2ffc6741ecc8d71e3968dbe.tar.bz2
Support for a "preparation" state that can take care of lengthy
operations in NuPlayer and its sources. Sources also can publish their flags now and the mediaplayer UI will be able to pick up on these. Change-Id: I4f2b7e5d105dcb4b6c9132cd0e8799efa0c6a14b
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp')
-rw-r--r--media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp35
1 files changed, 21 insertions, 14 deletions
diff --git a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
index d38ee62..ae67906 100644
--- a/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/HTTPLiveSource.cpp
@@ -66,7 +66,7 @@ NuPlayer::HTTPLiveSource::~HTTPLiveSource() {
}
}
-void NuPlayer::HTTPLiveSource::start() {
+void NuPlayer::HTTPLiveSource::prepareAsync() {
mLiveLooper = new ALooper;
mLiveLooper->setName("http live");
mLiveLooper->start();
@@ -81,6 +81,26 @@ void NuPlayer::HTTPLiveSource::start() {
mURL.c_str(), mExtraHeaders.isEmpty() ? NULL : &mExtraHeaders);
mTSParser = new ATSParser;
+
+ notifyVideoSizeChanged(0, 0);
+
+ uint32_t flags = FLAG_CAN_PAUSE;
+ if (mLiveSession->isSeekable()) {
+ flags |= FLAG_CAN_SEEK;
+ flags |= FLAG_CAN_SEEK_BACKWARD;
+ flags |= FLAG_CAN_SEEK_FORWARD;
+ }
+
+ if (mLiveSession->hasDynamicDuration()) {
+ flags |= FLAG_DYNAMIC_DURATION;
+ }
+
+ notifyFlagsChanged(flags);
+
+ notifyPrepared();
+}
+
+void NuPlayer::HTTPLiveSource::start() {
}
sp<MetaData> NuPlayer::HTTPLiveSource::getFormatMeta(bool audio) {
@@ -194,18 +214,5 @@ status_t NuPlayer::HTTPLiveSource::seekTo(int64_t seekTimeUs) {
return OK;
}
-uint32_t NuPlayer::HTTPLiveSource::flags() const {
- uint32_t flags = 0;
- if (mLiveSession->isSeekable()) {
- flags |= FLAG_SEEKABLE;
- }
-
- if (mLiveSession->hasDynamicDuration()) {
- flags |= FLAG_DYNAMIC_DURATION;
- }
-
- return flags;
-}
-
} // namespace android