Loading media/libstagefright/AwesomePlayer.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -756,8 +756,8 @@ void AwesomePlayer::onBufferingUpdate() { cachedDurationUs / 1E6); pause_l(); ensureCacheIsFetching_l(); sendCacheStats(); } sendCacheStats(); notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_START); } else if (eos || cachedDurationUs > kHighWaterMarkUs) { if (mFlags & CACHE_UNDERRUN) { Loading @@ -780,9 +780,14 @@ void AwesomePlayer::onBufferingUpdate() { void AwesomePlayer::sendCacheStats() { sp<MediaPlayerBase> listener = mListener.promote(); if (listener != NULL && mCachedSource != NULL) { if (listener != NULL) { int32_t kbps = 0; status_t err = mCachedSource->getEstimatedBandwidthKbps(&kbps); status_t err = UNKNOWN_ERROR; if (mCachedSource != NULL) { err = mCachedSource->getEstimatedBandwidthKbps(&kbps); } else if (mWVMExtractor != NULL) { err = mWVMExtractor->getEstimatedBandwidthKbps(&kbps); } if (err == OK) { listener->sendEvent( MEDIA_INFO, MEDIA_INFO_NETWORK_BANDWIDTH, kbps); Loading media/libstagefright/WVMExtractor.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,15 @@ int64_t WVMExtractor::getCachedDurationUs(status_t *finalStatus) { return mImpl->getCachedDurationUs(finalStatus); } status_t WVMExtractor::getEstimatedBandwidthKbps(int32_t *kbps) { if (mImpl == NULL) { return UNKNOWN_ERROR; } return mImpl->getEstimatedBandwidthKbps(kbps); } void WVMExtractor::setAdaptiveStreamingMode(bool adaptive) { if (mImpl != NULL) { mImpl->setAdaptiveStreamingMode(adaptive); Loading media/libstagefright/include/WVMExtractor.h +4 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ public: virtual ~WVMLoadableExtractor() {} virtual int64_t getCachedDurationUs(status_t *finalStatus) = 0; virtual status_t getEstimatedBandwidthKbps(int32_t *kbps) = 0; virtual void setAdaptiveStreamingMode(bool adaptive) = 0; virtual void setCryptoPluginMode(bool cryptoPluginMode) = 0; virtual void setUID(uid_t uid) = 0; Loading @@ -55,6 +56,9 @@ public: // *finalStatus == ERROR_END_OF_STREAM int64_t getCachedDurationUs(status_t *finalStatus); // Return the current estimated bandwidth status_t getEstimatedBandwidthKbps(int32_t *kbps); // Set to use adaptive streaming mode by the WV component. // If adaptive == true, adaptive streaming mode will be used. // Default mode is non-adaptive streaming mode. Loading Loading
media/libstagefright/AwesomePlayer.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -756,8 +756,8 @@ void AwesomePlayer::onBufferingUpdate() { cachedDurationUs / 1E6); pause_l(); ensureCacheIsFetching_l(); sendCacheStats(); } sendCacheStats(); notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_START); } else if (eos || cachedDurationUs > kHighWaterMarkUs) { if (mFlags & CACHE_UNDERRUN) { Loading @@ -780,9 +780,14 @@ void AwesomePlayer::onBufferingUpdate() { void AwesomePlayer::sendCacheStats() { sp<MediaPlayerBase> listener = mListener.promote(); if (listener != NULL && mCachedSource != NULL) { if (listener != NULL) { int32_t kbps = 0; status_t err = mCachedSource->getEstimatedBandwidthKbps(&kbps); status_t err = UNKNOWN_ERROR; if (mCachedSource != NULL) { err = mCachedSource->getEstimatedBandwidthKbps(&kbps); } else if (mWVMExtractor != NULL) { err = mWVMExtractor->getEstimatedBandwidthKbps(&kbps); } if (err == OK) { listener->sendEvent( MEDIA_INFO, MEDIA_INFO_NETWORK_BANDWIDTH, kbps); Loading
media/libstagefright/WVMExtractor.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,15 @@ int64_t WVMExtractor::getCachedDurationUs(status_t *finalStatus) { return mImpl->getCachedDurationUs(finalStatus); } status_t WVMExtractor::getEstimatedBandwidthKbps(int32_t *kbps) { if (mImpl == NULL) { return UNKNOWN_ERROR; } return mImpl->getEstimatedBandwidthKbps(kbps); } void WVMExtractor::setAdaptiveStreamingMode(bool adaptive) { if (mImpl != NULL) { mImpl->setAdaptiveStreamingMode(adaptive); Loading
media/libstagefright/include/WVMExtractor.h +4 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ public: virtual ~WVMLoadableExtractor() {} virtual int64_t getCachedDurationUs(status_t *finalStatus) = 0; virtual status_t getEstimatedBandwidthKbps(int32_t *kbps) = 0; virtual void setAdaptiveStreamingMode(bool adaptive) = 0; virtual void setCryptoPluginMode(bool cryptoPluginMode) = 0; virtual void setUID(uid_t uid) = 0; Loading @@ -55,6 +56,9 @@ public: // *finalStatus == ERROR_END_OF_STREAM int64_t getCachedDurationUs(status_t *finalStatus); // Return the current estimated bandwidth status_t getEstimatedBandwidthKbps(int32_t *kbps); // Set to use adaptive streaming mode by the WV component. // If adaptive == true, adaptive streaming mode will be used. // Default mode is non-adaptive streaming mode. Loading