Loading media/libaaudio/src/client/IsochronousClockModel.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -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) Loading @@ -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; Loading Loading @@ -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. Loading media/libaaudio/src/client/IsochronousClockModel.h +2 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class IsochronousClockModel { public: IsochronousClockModel(); virtual ~IsochronousClockModel(); virtual ~IsochronousClockModel() = default; void start(int64_t nanoTime); void stop(int64_t nanoTime); Loading Loading @@ -130,6 +130,7 @@ public: private: int32_t getLateTimeOffsetNanos() const; void update(); enum clock_model_state_t { STATE_STOPPED, Loading Loading @@ -164,7 +165,6 @@ private: // distribution of timestamps relative to earliest std::unique_ptr<android::audio_utils::Histogram> mHistogramMicros; void update(); }; } /* namespace aaudio */ Loading Loading
media/libaaudio/src/client/IsochronousClockModel.cpp +2 −4 Original line number Diff line number Diff line Loading @@ -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) Loading @@ -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; Loading Loading @@ -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. Loading
media/libaaudio/src/client/IsochronousClockModel.h +2 −2 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class IsochronousClockModel { public: IsochronousClockModel(); virtual ~IsochronousClockModel(); virtual ~IsochronousClockModel() = default; void start(int64_t nanoTime); void stop(int64_t nanoTime); Loading Loading @@ -130,6 +130,7 @@ public: private: int32_t getLateTimeOffsetNanos() const; void update(); enum clock_model_state_t { STATE_STOPPED, Loading Loading @@ -164,7 +165,6 @@ private: // distribution of timestamps relative to earliest std::unique_ptr<android::audio_utils::Histogram> mHistogramMicros; void update(); }; } /* namespace aaudio */ Loading