summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/DataSource.cpp
diff options
context:
space:
mode:
authorApurupa Pattapu <apurupa@codeaurora.org>2015-07-07 12:27:10 -0700
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:24:30 -0600
commit0c4d3ced0a20b5cef6c51410754b40d4254f596b (patch)
treed6fd24c95573ca43af5c96325fb7bd61664b8836 /media/libstagefright/DataSource.cpp
parentdaef932059bbeaf1b88a8871f348be128fdf0bfe (diff)
downloadframeworks_av-0c4d3ced0a20b5cef6c51410754b40d4254f596b.zip
frameworks_av-0c4d3ced0a20b5cef6c51410754b40d4254f596b.tar.gz
frameworks_av-0c4d3ced0a20b5cef6c51410754b40d4254f596b.tar.bz2
Stagefright: Extensions for HTTP progressive streaming.
- Extend NuPlayer setDataSource for streaming - Create ExtendedCachedSource only for MediaPlayer streaming usecases by passing a flag to DataSource to use extended cache - Add extension for MediaHTTP Change-Id: Ic87c3744bf905eb8742863951b809e38d0a60339
Diffstat (limited to 'media/libstagefright/DataSource.cpp')
-rw-r--r--media/libstagefright/DataSource.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/media/libstagefright/DataSource.cpp b/media/libstagefright/DataSource.cpp
index fdd6d96..85d0292 100644
--- a/media/libstagefright/DataSource.cpp
+++ b/media/libstagefright/DataSource.cpp
@@ -193,7 +193,8 @@ sp<DataSource> DataSource::CreateFromURI(
const char *uri,
const KeyedVector<String8, String8> *headers,
String8 *contentType,
- HTTPBase *httpSource) {
+ HTTPBase *httpSource,
+ bool useExtendedCache) {
if (contentType != NULL) {
*contentType = "";
}
@@ -217,7 +218,7 @@ sp<DataSource> DataSource::CreateFromURI(
ALOGE("Failed to make http connection from http service!");
return NULL;
}
- httpSource = new MediaHTTP(conn);
+ httpSource = AVFactory::get()->createMediaHTTP(conn);
}
String8 tmp;
@@ -249,10 +250,17 @@ sp<DataSource> DataSource::CreateFromURI(
*contentType = httpSource->getMIMEType();
}
- source = new NuCachedSource2(
- httpSource,
- cacheConfig.isEmpty() ? NULL : cacheConfig.string(),
- disconnectAtHighwatermark);
+ if (useExtendedCache) {
+ source = AVFactory::get()->createCachedSource(
+ httpSource,
+ cacheConfig.isEmpty() ? NULL : cacheConfig.string(),
+ disconnectAtHighwatermark);
+ } else {
+ source = new NuCachedSource2(
+ httpSource,
+ cacheConfig.isEmpty() ? NULL : cacheConfig.string(),
+ disconnectAtHighwatermark);
+ }
} else {
// We do not want that prefetching, caching, datasource wrapper
// in the widevine:// case.
@@ -281,7 +289,7 @@ sp<DataSource> DataSource::CreateMediaHTTP(const sp<IMediaHTTPService> &httpServ
if (conn == NULL) {
return NULL;
} else {
- return new MediaHTTP(conn);
+ return AVFactory::get()->createMediaHTTP(conn);
}
}