Merge "aaudio: minor cleanup in clock model" into rvc-dev

gugelfrei
TreeHugger Robot 4 years ago committed by Android (Google) Code Review
commit ef0ade40f3

@ -47,6 +47,7 @@ IsochronousClockModel::IsochronousClockModel()
, mMarkerNanoTime(0)
, mSampleRate(48000)
, mFramesPerBurst(48)
, mBurstPeriodNanos(0) // this will be updated before use
, mMaxMeasuredLatenessNanos(0)
, mLatenessForDriftNanos(kInitialLatenessForDriftNanos)
, mState(STATE_STOPPED)
@ -57,9 +58,6 @@ IsochronousClockModel::IsochronousClockModel()
}
}
IsochronousClockModel::~IsochronousClockModel() {
}
void IsochronousClockModel::setPositionAndTime(int64_t framePosition, int64_t nanoTime) {
ALOGV("setPositionAndTime, %lld, %lld", (long long) framePosition, (long long) nanoTime);
mMarkerFramePosition = framePosition;
@ -186,7 +184,7 @@ void IsochronousClockModel::processTimestamp(int64_t framePosition, int64_t nano
// Calculate upper region that will trigger a drift forwards.
mLatenessForDriftNanos = mMaxMeasuredLatenessNanos - (mMaxMeasuredLatenessNanos >> 4);
} else { // decrease
// If these is an outlier in lateness then mMaxMeasuredLatenessNanos can go high
// If this is an outlier in lateness then mMaxMeasuredLatenessNanos can go high
// and stay there. So we slowly reduce mMaxMeasuredLatenessNanos for better
// long term stability. The two opposing forces will keep mMaxMeasuredLatenessNanos
// within a reasonable range.

@ -35,7 +35,7 @@ class IsochronousClockModel {
public:
IsochronousClockModel();
virtual ~IsochronousClockModel();
virtual ~IsochronousClockModel() = default;
void start(int64_t nanoTime);
void stop(int64_t nanoTime);
@ -130,6 +130,7 @@ public:
private:
int32_t getLateTimeOffsetNanos() const;
void update();
enum clock_model_state_t {
STATE_STOPPED,
@ -164,7 +165,6 @@ private:
// distribution of timestamps relative to earliest
std::unique_ptr<android::audio_utils::Histogram> mHistogramMicros;
void update();
};
} /* namespace aaudio */

Loading…
Cancel
Save