Loading include/media/stagefright/DataSource.h +1 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public: kWantsPrefetching = 1, kStreamedFromLocalHost = 2, kIsCachingDataSource = 4, kIsHTTPBasedSource = 8, }; static sp<DataSource> CreateFromURI( Loading media/libstagefright/AwesomePlayer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -715,7 +715,7 @@ void AwesomePlayer::onBufferingUpdate() { void AwesomePlayer::sendCacheStats() { sp<MediaPlayerBase> listener = mListener.promote(); if (listener != NULL) { if (listener != NULL && mCachedSource != NULL) { int32_t kbps = 0; status_t err = mCachedSource->getEstimatedBandwidthKbps(&kbps); if (err == OK) { Loading media/libstagefright/NuCachedSource2.cpp +13 −5 Original line number Diff line number Diff line Loading @@ -203,14 +203,20 @@ NuCachedSource2::~NuCachedSource2() { } status_t NuCachedSource2::getEstimatedBandwidthKbps(int32_t *kbps) { if (mSource->flags() & kIsHTTPBasedSource) { HTTPBase* source = static_cast<HTTPBase *>(mSource.get()); return source->getEstimatedBandwidthKbps(kbps); } return ERROR_UNSUPPORTED; } status_t NuCachedSource2::setCacheStatCollectFreq(int32_t freqMs) { if (mSource->flags() & kIsHTTPBasedSource) { HTTPBase *source = static_cast<HTTPBase *>(mSource.get()); return source->setBandwidthStatCollectFreq(freqMs); } return ERROR_UNSUPPORTED; } status_t NuCachedSource2::initCheck() const { return mSource->initCheck(); Loading @@ -221,7 +227,9 @@ status_t NuCachedSource2::getSize(off64_t *size) { } uint32_t NuCachedSource2::flags() { return (mSource->flags() & ~kWantsPrefetching) | kIsCachingDataSource; // Remove HTTP related flags since NuCachedSource2 is not HTTP-based. uint32_t flags = mSource->flags() & ~(kWantsPrefetching | kIsHTTPBasedSource); return (flags | kIsCachingDataSource); } void NuCachedSource2::onMessageReceived(const sp<AMessage> &msg) { Loading media/libstagefright/NuHTTPDataSource.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -464,7 +464,7 @@ status_t NuHTTPDataSource::getSize(off64_t *size) { } uint32_t NuHTTPDataSource::flags() { return kWantsPrefetching; return kWantsPrefetching | kIsHTTPBasedSource; } // static Loading media/libstagefright/chromium_http/ChromiumHTTPDataSource.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -218,7 +218,7 @@ status_t ChromiumHTTPDataSource::getSize(off64_t *size) { } uint32_t ChromiumHTTPDataSource::flags() { return kWantsPrefetching; return kWantsPrefetching | kIsHTTPBasedSource; } // static Loading Loading
include/media/stagefright/DataSource.h +1 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public: kWantsPrefetching = 1, kStreamedFromLocalHost = 2, kIsCachingDataSource = 4, kIsHTTPBasedSource = 8, }; static sp<DataSource> CreateFromURI( Loading
media/libstagefright/AwesomePlayer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -715,7 +715,7 @@ void AwesomePlayer::onBufferingUpdate() { void AwesomePlayer::sendCacheStats() { sp<MediaPlayerBase> listener = mListener.promote(); if (listener != NULL) { if (listener != NULL && mCachedSource != NULL) { int32_t kbps = 0; status_t err = mCachedSource->getEstimatedBandwidthKbps(&kbps); if (err == OK) { Loading
media/libstagefright/NuCachedSource2.cpp +13 −5 Original line number Diff line number Diff line Loading @@ -203,14 +203,20 @@ NuCachedSource2::~NuCachedSource2() { } status_t NuCachedSource2::getEstimatedBandwidthKbps(int32_t *kbps) { if (mSource->flags() & kIsHTTPBasedSource) { HTTPBase* source = static_cast<HTTPBase *>(mSource.get()); return source->getEstimatedBandwidthKbps(kbps); } return ERROR_UNSUPPORTED; } status_t NuCachedSource2::setCacheStatCollectFreq(int32_t freqMs) { if (mSource->flags() & kIsHTTPBasedSource) { HTTPBase *source = static_cast<HTTPBase *>(mSource.get()); return source->setBandwidthStatCollectFreq(freqMs); } return ERROR_UNSUPPORTED; } status_t NuCachedSource2::initCheck() const { return mSource->initCheck(); Loading @@ -221,7 +227,9 @@ status_t NuCachedSource2::getSize(off64_t *size) { } uint32_t NuCachedSource2::flags() { return (mSource->flags() & ~kWantsPrefetching) | kIsCachingDataSource; // Remove HTTP related flags since NuCachedSource2 is not HTTP-based. uint32_t flags = mSource->flags() & ~(kWantsPrefetching | kIsHTTPBasedSource); return (flags | kIsCachingDataSource); } void NuCachedSource2::onMessageReceived(const sp<AMessage> &msg) { Loading
media/libstagefright/NuHTTPDataSource.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -464,7 +464,7 @@ status_t NuHTTPDataSource::getSize(off64_t *size) { } uint32_t NuHTTPDataSource::flags() { return kWantsPrefetching; return kWantsPrefetching | kIsHTTPBasedSource; } // static Loading
media/libstagefright/chromium_http/ChromiumHTTPDataSource.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -218,7 +218,7 @@ status_t ChromiumHTTPDataSource::getSize(off64_t *size) { } uint32_t ChromiumHTTPDataSource::flags() { return kWantsPrefetching; return kWantsPrefetching | kIsHTTPBasedSource; } // static Loading