Loading include/media/stagefright/DataSource.h +2 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,8 @@ public: return String8(); } virtual String8 getMIMEType() const; protected: virtual ~DataSource() {} Loading media/libstagefright/AwesomePlayer.cpp +24 −16 Original line number Diff line number Diff line Loading @@ -1693,6 +1693,13 @@ status_t AwesomePlayer::finishSetDataSource_l() { dataSource = mCachedSource; String8 contentType = dataSource->getMIMEType(); if (strncasecmp(contentType.string(), "audio/", 6)) { // We're not doing this for streams that appear to be audio-only // streams to ensure that even low bandwidth streams start // playing back fairly instantly. // We're going to prefill the cache before trying to instantiate // the extractor below, as the latter is an operation that otherwise // could block on the datasource for a significant amount of time. Loading @@ -1715,6 +1722,7 @@ status_t AwesomePlayer::finishSetDataSource_l() { } mLock.lock(); } if (mFlags & PREPARE_CANCELLED) { LOGI("Prepare cancelled while waiting for initial cache fill."); Loading media/libstagefright/DataSource.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -144,4 +144,8 @@ sp<DataSource> DataSource::CreateFromURI( return source; } String8 DataSource::getMIMEType() const { return String8("application/octet-stream"); } } // namespace android media/libstagefright/NuCachedSource2.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -493,4 +493,8 @@ String8 NuCachedSource2::getUri() { return mSource->getUri(); } String8 NuCachedSource2::getMIMEType() const { return mSource->getMIMEType(); } } // namespace android media/libstagefright/NuHTTPDataSource.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ status_t NuHTTPDataSource::connect( unsigned port; mUri = uri; mContentType = String8("application/octet-stream"); bool https; if (!ParseURL(uri, &host, &port, &path, &https)) { Loading Loading @@ -265,6 +266,15 @@ status_t NuHTTPDataSource::connect( } } { AString value; if (mHTTP.find_header_value("Content-Type", &value)) { mContentType = String8(value.c_str()); } else { mContentType = String8("application/octet-stream"); } } applyTimeoutResponse(); if (offset == 0) { Loading Loading @@ -564,4 +574,8 @@ String8 NuHTTPDataSource::getUri() { return mUri; } String8 NuHTTPDataSource::getMIMEType() const { return mContentType; } } // namespace android Loading
include/media/stagefright/DataSource.h +2 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,8 @@ public: return String8(); } virtual String8 getMIMEType() const; protected: virtual ~DataSource() {} Loading
media/libstagefright/AwesomePlayer.cpp +24 −16 Original line number Diff line number Diff line Loading @@ -1693,6 +1693,13 @@ status_t AwesomePlayer::finishSetDataSource_l() { dataSource = mCachedSource; String8 contentType = dataSource->getMIMEType(); if (strncasecmp(contentType.string(), "audio/", 6)) { // We're not doing this for streams that appear to be audio-only // streams to ensure that even low bandwidth streams start // playing back fairly instantly. // We're going to prefill the cache before trying to instantiate // the extractor below, as the latter is an operation that otherwise // could block on the datasource for a significant amount of time. Loading @@ -1715,6 +1722,7 @@ status_t AwesomePlayer::finishSetDataSource_l() { } mLock.lock(); } if (mFlags & PREPARE_CANCELLED) { LOGI("Prepare cancelled while waiting for initial cache fill."); Loading
media/libstagefright/DataSource.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -144,4 +144,8 @@ sp<DataSource> DataSource::CreateFromURI( return source; } String8 DataSource::getMIMEType() const { return String8("application/octet-stream"); } } // namespace android
media/libstagefright/NuCachedSource2.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -493,4 +493,8 @@ String8 NuCachedSource2::getUri() { return mSource->getUri(); } String8 NuCachedSource2::getMIMEType() const { return mSource->getMIMEType(); } } // namespace android
media/libstagefright/NuHTTPDataSource.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,7 @@ status_t NuHTTPDataSource::connect( unsigned port; mUri = uri; mContentType = String8("application/octet-stream"); bool https; if (!ParseURL(uri, &host, &port, &path, &https)) { Loading Loading @@ -265,6 +266,15 @@ status_t NuHTTPDataSource::connect( } } { AString value; if (mHTTP.find_header_value("Content-Type", &value)) { mContentType = String8(value.c_str()); } else { mContentType = String8("application/octet-stream"); } } applyTimeoutResponse(); if (offset == 0) { Loading Loading @@ -564,4 +574,8 @@ String8 NuHTTPDataSource::getUri() { return mUri; } String8 NuHTTPDataSource::getMIMEType() const { return mContentType; } } // namespace android