merge in honeycomb-mr1-release history after reset to honeycomb-mr1
diff --git a/media/libstagefright/NuHTTPDataSource.cpp b/media/libstagefright/NuHTTPDataSource.cpp
index bee0d5e..62fb732 100644
--- a/media/libstagefright/NuHTTPDataSource.cpp
+++ b/media/libstagefright/NuHTTPDataSource.cpp
@@ -100,6 +100,7 @@
mNumBandwidthHistoryItems(0),
mTotalTransferTimeUs(0),
mTotalTransferBytes(0),
+ mPrevBandwidthMeasureTimeUs(0),
mDecryptHandle(NULL),
mDrmManagerClient(NULL) {
}
@@ -534,6 +535,16 @@
mTotalTransferBytes -= entry->mNumBytes;
mBandwidthHistory.erase(mBandwidthHistory.begin());
--mNumBandwidthHistoryItems;
+ int64_t timeNowUs = ALooper::GetNowUs();
+ if (timeNowUs - mPrevBandwidthMeasureTimeUs > 2000000LL) {
+ if (mPrevBandwidthMeasureTimeUs != 0) {
+ double estimatedBandwidth =
+ ((double)mTotalTransferBytes * 8E3 / mTotalTransferTimeUs);
+ LOGI("estimated avg bandwidth is %8.2f kbps in the past %lld us",
+ estimatedBandwidth, timeNowUs - mPrevBandwidthMeasureTimeUs);
+ }
+ mPrevBandwidthMeasureTimeUs = timeNowUs;
+ }
}
}
diff --git a/media/libstagefright/include/NuHTTPDataSource.h b/media/libstagefright/include/NuHTTPDataSource.h
index 2569568..0d68234 100644
--- a/media/libstagefright/include/NuHTTPDataSource.h
+++ b/media/libstagefright/include/NuHTTPDataSource.h
@@ -97,6 +97,7 @@
size_t mNumBandwidthHistoryItems;
int64_t mTotalTransferTimeUs;
size_t mTotalTransferBytes;
+ int64_t mPrevBandwidthMeasureTimeUs;
DecryptHandle *mDecryptHandle;
DrmManagerClient *mDrmManagerClient;