summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/FastMixerState.h
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-04-25 17:52:27 -0700
committerGlenn Kasten <gkasten@google.com>2012-04-30 13:00:31 -0700
commit288ed2103d96f3aabd7e6bea3c080ab6db164049 (patch)
treedec8e7b3a993e86baa8916ba70dcd6b3c053d062 /services/audioflinger/FastMixerState.h
parent0c0abd4ad26971b5fba94734137fe0bb1a590ab6 (diff)
downloadframeworks_av-288ed2103d96f3aabd7e6bea3c080ab6db164049.zip
frameworks_av-288ed2103d96f3aabd7e6bea3c080ab6db164049.tar.gz
frameworks_av-288ed2103d96f3aabd7e6bea3c080ab6db164049.tar.bz2
Fix race condition for non-started fast tracks
This required re-implementing how fast tracks are considered active. Now, they use the same logic as normal tracks, except underrun is ignored. Other changes: - add framesReady() to AudioBufferProvider interface - rebased - add track underrun counter state to fast mixer dump state - move dumpsys header to Track::appendDumpHeader() so it closer to where tracks are dumped - display track state in dumpsys as a character code - measure and display warmup time and cycles in dumpsys - copy in the presentation complete code - add ExtendedAudioBufferProvider for framesReady() which returns size_t - simplify underrun tracking - deferred reset track after stop() - add comments Change-Id: I7db8821bc565230ec76da1f9380fe3fb09735e5b
Diffstat (limited to 'services/audioflinger/FastMixerState.h')
-rw-r--r--services/audioflinger/FastMixerState.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/audioflinger/FastMixerState.h b/services/audioflinger/FastMixerState.h
index 83094c8..ce0cdb5 100644
--- a/services/audioflinger/FastMixerState.h
+++ b/services/audioflinger/FastMixerState.h
@@ -18,7 +18,7 @@
#define ANDROID_AUDIO_FAST_MIXER_STATE_H
#include <system/audio.h>
-#include "AudioBufferProvider.h"
+#include "ExtendedAudioBufferProvider.h"
#include "NBAIO.h"
namespace android {
@@ -40,7 +40,7 @@ struct FastTrack {
FastTrack();
/*virtual*/ ~FastTrack();
- AudioBufferProvider* mBufferProvider; // must not be NULL
+ ExtendedAudioBufferProvider* mBufferProvider; // must be NULL if inactive, or non-NULL if active
VolumeProvider* mVolumeProvider; // optional; if NULL then full-scale
unsigned mSampleRate; // optional; if zero then use mixer sample rate
audio_channel_mask_t mChannelMask; // AUDIO_CHANNEL_OUT_MONO or AUDIO_CHANNEL_OUT_STEREO
@@ -57,7 +57,7 @@ struct FastMixerState {
// all pointer fields use raw pointers; objects are owned and ref-counted by the normal mixer
FastTrack mFastTracks[kMaxFastTracks];
int mFastTracksGen; // increment when any mFastTracks[i].mGeneration is incremented
- unsigned mTrackMask; // bit i is set if and only if mFastTracks[i] != NULL
+ unsigned mTrackMask; // bit i is set if and only if mFastTracks[i] is active
NBAIO_Sink* mOutputSink; // HAL output device, must already be negotiated
int mOutputSinkGen; // increment when mOutputSink is assigned
size_t mFrameCount; // number of frames per fast mix buffer