diff options
author | Andreas Huber <andih@google.com> | 2010-06-10 15:15:43 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-06-10 15:15:43 -0700 |
commit | fbdb5f1bb6c2ad96c36086a20715119fdb3dc4de (patch) | |
tree | e62fcbecb75395c8f5a04263b3982da9215390d5 | |
parent | 8f86451314445f0d915d0e2e63bc07fa04a36b5b (diff) | |
parent | 82f8fd6a4928ca52703caaffb7629c0be3c8089a (diff) | |
download | frameworks_base-fbdb5f1bb6c2ad96c36086a20715119fdb3dc4de.zip frameworks_base-fbdb5f1bb6c2ad96c36086a20715119fdb3dc4de.tar.gz frameworks_base-fbdb5f1bb6c2ad96c36086a20715119fdb3dc4de.tar.bz2 |
Merge "Switch LiveSource to use the new http data source instead of the old one." into kraken
-rw-r--r-- | media/libstagefright/httplive/LiveSource.cpp | 11 | ||||
-rw-r--r-- | media/libstagefright/include/LiveSource.h | 4 |
2 files changed, 6 insertions, 9 deletions
diff --git a/media/libstagefright/httplive/LiveSource.cpp b/media/libstagefright/httplive/LiveSource.cpp index 9e3aa7b..001afc4 100644 --- a/media/libstagefright/httplive/LiveSource.cpp +++ b/media/libstagefright/httplive/LiveSource.cpp @@ -18,12 +18,10 @@ #include <utils/Log.h> #include "include/LiveSource.h" - -#include "include/HTTPStream.h" #include "include/M3UParser.h" +#include "include/NuHTTPDataSource.h" #include <media/stagefright/foundation/ABuffer.h> -#include <media/stagefright/HTTPDataSource.h> #include <media/stagefright/MediaDebug.h> namespace android { @@ -33,6 +31,7 @@ LiveSource::LiveSource(const char *url) mInitCheck(NO_INIT), mPlaylistIndex(0), mLastFetchTimeUs(-1), + mSource(new NuHTTPDataSource), mSourceSize(0), mOffsetBias(0) { if (switchToNext()) { @@ -115,8 +114,7 @@ bool LiveSource::switchToNext() { CHECK(mPlaylist->itemAt(mPlaylistIndex, &uri)); LOGI("switching to %s", uri.c_str()); - mSource = new HTTPDataSource(uri.c_str()); - if (mSource->connect() != OK + if (mSource->connect(uri.c_str()) != OK || mSource->getSize(&mSourceSize) != OK) { return false; } @@ -156,8 +154,7 @@ ssize_t LiveSource::readAt(off_t offset, void *data, size_t size) { status_t LiveSource::fetchM3U(const char *url, sp<ABuffer> *out) { *out = NULL; - mSource = new HTTPDataSource(url); - status_t err = mSource->connect(); + status_t err = mSource->connect(url); if (err != OK) { return err; diff --git a/media/libstagefright/include/LiveSource.h b/media/libstagefright/include/LiveSource.h index 3218633..c55508c 100644 --- a/media/libstagefright/include/LiveSource.h +++ b/media/libstagefright/include/LiveSource.h @@ -26,7 +26,7 @@ namespace android { struct ABuffer; -struct HTTPDataSource; +struct NuHTTPDataSource; struct M3UParser; struct LiveSource : public DataSource { @@ -52,7 +52,7 @@ private: size_t mPlaylistIndex; int64_t mLastFetchTimeUs; - sp<HTTPDataSource> mSource; + sp<NuHTTPDataSource> mSource; off_t mSourceSize; off_t mOffsetBias; |