From 765f27c2376e83766d9e1d8f8136025c5437ce49 Mon Sep 17 00:00:00 2001 From: Chong Zhang Date: Mon, 30 Mar 2015 12:33:56 -0700 Subject: fix build break in clang Change-Id: Iff2ca5d1e800d30943de12191bfe6c43d6a2c7f6 --- media/libstagefright/httplive/LiveSession.cpp | 29 ++++++++++++++++++--------- media/libstagefright/httplive/LiveSession.h | 12 +++++------ 2 files changed, 26 insertions(+), 15 deletions(-) (limited to 'media') 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 &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 &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 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 { -- cgit v1.1