summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/AwesomePlayer.cpp
diff options
context:
space:
mode:
authorJeffrey Tinker <jtinker@google.com>2012-08-23 01:56:53 -0700
committerJeffrey Tinker <jtinker@google.com>2012-08-23 01:56:53 -0700
commitf10f36d34812bae602ff018fb503ad07eaf550b1 (patch)
treeb6b7ce250b453bd8713c9e6acfb4cef9f7f7a9fe /media/libstagefright/AwesomePlayer.cpp
parentcd3ed11664d16939f1f5763a896d7fc75dd3642e (diff)
downloadframeworks_av-f10f36d34812bae602ff018fb503ad07eaf550b1.zip
frameworks_av-f10f36d34812bae602ff018fb503ad07eaf550b1.tar.gz
frameworks_av-f10f36d34812bae602ff018fb503ad07eaf550b1.tar.bz2
Send current bandwidth info event when buffering occurs
There is a dependent change in vendor/widevine repo. Change-Id: If063f4b1c8857e5bfc7be54ab0f97a4ed169b303 related-to-bug: 5883234
Diffstat (limited to 'media/libstagefright/AwesomePlayer.cpp')
-rw-r--r--media/libstagefright/AwesomePlayer.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index e18fcbc..04f78eb 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -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) {
@@ -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);