summaryrefslogtreecommitdiff
path: root/services/audioflinger/AudioFlinger.h
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-05-10 14:48:07 -0700
committerGlenn Kasten <gkasten@google.com>2012-05-14 08:56:45 -0700
commit09474df67278c0cd621b57c4aef1deaec4d8447f (patch)
treeeafcf9a62df5202c4a0628a9ac9798b7c49dd08b /services/audioflinger/AudioFlinger.h
parentd08f48c2ad2941d62b313007955c7145075d562c (diff)
Improve underrun handling for fast tracks
Maintain more accurate accounting of type of underrun. Automatically remove track from active list after a series of "empty" underruns. Change-Id: If042bf80e1790dcaaf195c99dc9c0ed9b55382c1
Diffstat (limited to 'services/audioflinger/AudioFlinger.h')
-rw-r--r--services/audioflinger/AudioFlinger.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index bcf29e9a..88056b8c 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -793,7 +793,7 @@ private:
// index 0 is reserved for normal mixer's submix;
// index is allocated statically at track creation time
// but the slot is only used if track is active
- uint32_t mObservedUnderruns; // Most recently observed value of
+ FastTrackUnderruns mObservedUnderruns; // Most recently observed value of
// mFastMixerDumpState.mTracks[mFastIndex].mUnderruns
uint32_t mUnderrunCount; // Counter of total number of underruns, never reset
volatile float mCachedVolume; // combined master volume and stream type volume;
@@ -1112,7 +1112,8 @@ public:
sp<NBAIO_Sink> mNormalSink;
public:
virtual bool hasFastMixer() const = 0;
- virtual uint32_t getFastTrackUnderruns(size_t fastIndex) const { return 0; }
+ virtual FastTrackUnderruns getFastTrackUnderruns(size_t fastIndex) const
+ { FastTrackUnderruns dummy; return dummy; }
protected:
// accessed by both binder threads and within threadLoop(), lock on mutex needed
@@ -1167,10 +1168,10 @@ public:
public:
virtual bool hasFastMixer() const { return mFastMixer != NULL; }
- virtual uint32_t getFastTrackUnderruns(size_t fastIndex) const {
- ALOG_ASSERT(0 < fastIndex &&
- fastIndex < FastMixerState::kMaxFastTracks);
- return mFastMixerDumpState.mTracks[fastIndex].mUnderruns;
+ virtual FastTrackUnderruns getFastTrackUnderruns(size_t fastIndex) const {
+ ALOG_ASSERT(0 < fastIndex &&
+ fastIndex < FastMixerState::kMaxFastTracks);
+ return mFastMixerDumpState.mTracks[fastIndex].mUnderruns;
}
};