summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-03-30 12:33:56 -0700
committerChong Zhang <chz@google.com>2015-03-30 12:35:24 -0700
commit765f27c2376e83766d9e1d8f8136025c5437ce49 (patch)
tree7af72968414ed25f58f27cf1aa7f4f0a865364b7 /media
parent46bd6b5bb8f1dfd26977a04ee6fcf9641321ca29 (diff)
downloadframeworks_av-765f27c2376e83766d9e1d8f8136025c5437ce49.zip
frameworks_av-765f27c2376e83766d9e1d8f8136025c5437ce49.tar.gz
frameworks_av-765f27c2376e83766d9e1d8f8136025c5437ce49.tar.bz2
fix build break in clang
Change-Id: Iff2ca5d1e800d30943de12191bfe6c43d6a2c7f6
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/httplive/LiveSession.cpp29
-rw-r--r--media/libstagefright/httplive/LiveSession.h12
2 files changed, 26 insertions, 15 deletions
diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp
index 4ac2fb2..118c174 100644
--- a/media/libstagefright/httplive/LiveSession.cpp
+++ b/media/libstagefright/httplive/LiveSession.cpp
@@ -50,6 +50,17 @@
namespace android {
+// static
+// Bandwidth Switch Mark Defaults
+const int64_t LiveSession::kUpSwitchMarkUs = 25000000ll;
+const int64_t LiveSession::kDownSwitchMarkUs = 18000000ll;
+const int64_t LiveSession::kUpSwitchMarginUs = 5000000ll;
+
+// Buffer Prepare/Ready/Underflow Marks
+const int64_t LiveSession::kReadyMarkUs = 5000000ll;
+const int64_t LiveSession::kPrepareMarkUs = 1500000ll;
+const int64_t LiveSession::kUnderflowMarkUs = 1000000ll;
+
struct LiveSession::BandwidthEstimator : public RefBase {
BandwidthEstimator();
@@ -153,9 +164,9 @@ LiveSession::LiveSession(
mRealTimeBaseUs(0ll),
mReconfigurationInProgress(false),
mSwitchInProgress(false),
- mUpSwitchMark(kUpSwitchMark),
- mDownSwitchMark(kDownSwitchMark),
- mUpSwitchMargin(kUpSwitchMargin),
+ mUpSwitchMark(kUpSwitchMarkUs),
+ mDownSwitchMark(kDownSwitchMarkUs),
+ mUpSwitchMargin(kUpSwitchMarginUs),
mFirstTimeUsValid(false),
mFirstTimeUs(0),
mLastSeekTimeUs(0) {
@@ -563,9 +574,9 @@ void LiveSession::onMessageReceived(const sp<AMessage> &msg) {
{
int64_t targetDurationUs;
CHECK(msg->findInt64("targetDurationUs", &targetDurationUs));
- mUpSwitchMark = min(kUpSwitchMark, targetDurationUs * 3);
- mDownSwitchMark = min(kDownSwitchMark, targetDurationUs * 9 / 4);
- mUpSwitchMargin = min(kUpSwitchMargin, targetDurationUs);
+ mUpSwitchMark = min(kUpSwitchMarkUs, targetDurationUs * 3);
+ mDownSwitchMark = min(kDownSwitchMarkUs, targetDurationUs * 9 / 4);
+ mUpSwitchMargin = min(kUpSwitchMarginUs, targetDurationUs);
break;
}
@@ -656,7 +667,7 @@ void LiveSession::onMessageReceived(const sp<AMessage> &msg) {
// If switching up, require a cushion bigger than kUnderflowMark
// to avoid buffering immediately after the switch.
// (If we don't have that cushion we'd rather cancel and try again.)
- int64_t delayUs = switchUp ? (kUnderflowMark + 1000000ll) : 0;
+ int64_t delayUs = switchUp ? (kUnderflowMarkUs + 1000000ll) : 0;
bool needResumeUntil = false;
sp<AMessage> stopParams = msg;
if (checkSwitchProgress(stopParams, delayUs, &needResumeUntil)) {
@@ -2068,13 +2079,13 @@ bool LiveSession::checkBuffering(
}
++activeCount;
- int64_t readyMark = mInPreparationPhase ? kPrepareMark : kReadyMark;
+ int64_t readyMark = mInPreparationPhase ? kPrepareMarkUs : kReadyMarkUs;
if (bufferedDurationUs > readyMark
|| mPacketSources[i]->isFinished(0)) {
++readyCount;
}
if (!mPacketSources[i]->isFinished(0)) {
- if (bufferedDurationUs < kUnderflowMark) {
+ if (bufferedDurationUs < kUnderflowMarkUs) {
++underflowCount;
}
if (bufferedDurationUs > mUpSwitchMark) {
diff --git a/media/libstagefright/httplive/LiveSession.h b/media/libstagefright/httplive/LiveSession.h
index d11675b..3d62cab 100644
--- a/media/libstagefright/httplive/LiveSession.h
+++ b/media/libstagefright/httplive/LiveSession.h
@@ -122,14 +122,14 @@ private:
};
// Bandwidth Switch Mark Defaults
- static const int64_t kUpSwitchMark = 25000000ll;
- static const int64_t kDownSwitchMark = 18000000ll;
- static const int64_t kUpSwitchMargin = 5000000ll;
+ static const int64_t kUpSwitchMarkUs;
+ static const int64_t kDownSwitchMarkUs;
+ static const int64_t kUpSwitchMarginUs;
// Buffer Prepare/Ready/Underflow Marks
- static const int64_t kReadyMark = 5000000ll;
- static const int64_t kPrepareMark = 1500000ll;
- static const int64_t kUnderflowMark = 1000000ll;
+ static const int64_t kReadyMarkUs;
+ static const int64_t kPrepareMarkUs;
+ static const int64_t kUnderflowMarkUs;
struct BandwidthEstimator;
struct BandwidthItem {