diff options
author | Robert Shih <robertshih@google.com> | 2014-10-01 19:41:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-01 19:41:34 +0000 |
commit | 3af67d03bbc30c368821caf8b74ae7fb91ee7db7 (patch) | |
tree | 6f71a15d1a29af4964d8b71d4d120ed97f0778c3 /media/libstagefright | |
parent | 1f4b162e0bee6bcb0c9de464087db286270f5525 (diff) | |
parent | 360d6d0924f99b82ebacb5cfb6f7bca95e11b4ee (diff) | |
download | frameworks_av-3af67d03bbc30c368821caf8b74ae7fb91ee7db7.zip frameworks_av-3af67d03bbc30c368821caf8b74ae7fb91ee7db7.tar.gz frameworks_av-3af67d03bbc30c368821caf8b74ae7fb91ee7db7.tar.bz2 |
Merge "GenericSource: support disconnect before NuCachedSource2 is created" into lmp-dev
Diffstat (limited to 'media/libstagefright')
-rw-r--r-- | media/libstagefright/DataSource.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/media/libstagefright/DataSource.cpp b/media/libstagefright/DataSource.cpp index a72cbd5..c99db84 100644 --- a/media/libstagefright/DataSource.cpp +++ b/media/libstagefright/DataSource.cpp @@ -186,7 +186,8 @@ sp<DataSource> DataSource::CreateFromURI( const sp<IMediaHTTPService> &httpService, const char *uri, const KeyedVector<String8, String8> *headers, - String8 *contentType) { + String8 *contentType, + HTTPBase *httpSource) { if (contentType != NULL) { *contentType = ""; } @@ -204,14 +205,15 @@ sp<DataSource> DataSource::CreateFromURI( return NULL; } - sp<IMediaHTTPConnection> conn = httpService->makeHTTPConnection(); - if (conn == NULL) { - ALOGE("Failed to make http connection from http service!"); - return NULL; + if (httpSource == NULL) { + sp<IMediaHTTPConnection> conn = httpService->makeHTTPConnection(); + if (conn == NULL) { + ALOGE("Failed to make http connection from http service!"); + return NULL; + } + httpSource = new MediaHTTP(conn); } - sp<HTTPBase> httpSource = new MediaHTTP(conn); - String8 tmp; if (isWidevine) { tmp = String8("http://"); @@ -264,6 +266,19 @@ sp<DataSource> DataSource::CreateFromURI( return source; } +sp<DataSource> DataSource::CreateMediaHTTP(const sp<IMediaHTTPService> &httpService) { + if (httpService == NULL) { + return NULL; + } + + sp<IMediaHTTPConnection> conn = httpService->makeHTTPConnection(); + if (conn == NULL) { + return NULL; + } else { + return new MediaHTTP(conn); + } +} + String8 DataSource::getMIMEType() const { return String8("application/octet-stream"); } |