summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/FastMixerState.h
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-03-18 17:01:15 -0700
committerGlenn Kasten <gkasten@google.com>2014-03-31 12:23:11 -0700
commitf7160b5dc3091fd9624f25d534c6848ee831b706 (patch)
tree521236419b4532dc8e91ed22be147a6aeb8baa34 /services/audioflinger/FastMixerState.h
parent4cd161b5bf7a8008d684db4b217ed84d1704e683 (diff)
downloadframeworks_av-f7160b5dc3091fd9624f25d534c6848ee831b706.zip
frameworks_av-f7160b5dc3091fd9624f25d534c6848ee831b706.tar.gz
frameworks_av-f7160b5dc3091fd9624f25d534c6848ee831b706.tar.bz2
FastMixer use FastThread and FastMixerState use FastThreadState
Change-Id: I594c973e9f575113bdefee6f4cf8c29d8beac1f3
Diffstat (limited to 'services/audioflinger/FastMixerState.h')
-rw-r--r--services/audioflinger/FastMixerState.h19
1 files changed, 7 insertions, 12 deletions
diff --git a/services/audioflinger/FastMixerState.h b/services/audioflinger/FastMixerState.h
index 9739fe9..10696e8 100644
--- a/services/audioflinger/FastMixerState.h
+++ b/services/audioflinger/FastMixerState.h
@@ -21,6 +21,7 @@
#include <media/ExtendedAudioBufferProvider.h>
#include <media/nbaio/NBAIO.h>
#include <media/nbaio/NBLog.h>
+#include "FastThreadState.h"
namespace android {
@@ -48,7 +49,7 @@ struct FastTrack {
};
// Represents a single state of the fast mixer
-struct FastMixerState {
+struct FastMixerState : FastThreadState {
FastMixerState();
/*virtual*/ ~FastMixerState();
@@ -61,23 +62,17 @@ struct FastMixerState {
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
- enum Command {
- INITIAL = 0, // used only for the initial state
- HOT_IDLE = 1, // do nothing
- COLD_IDLE = 2, // wait for the futex
- IDLE = 3, // either HOT_IDLE or COLD_IDLE
- EXIT = 4, // exit from thread
+
+ // Extends FastThreadState::Command
+ static const Command
// The following commands also process configuration changes, and can be "or"ed:
MIX = 0x8, // mix tracks
WRITE = 0x10, // write to output sink
- MIX_WRITE = 0x18, // mix tracks and write to output sink
- } mCommand;
- int32_t* mColdFutexAddr; // for COLD_IDLE only, pointer to the associated futex
- unsigned mColdGen; // increment when COLD_IDLE is requested so it's only performed once
+ MIX_WRITE = 0x18; // mix tracks and write to output sink
+
// This might be a one-time configuration rather than per-state
FastMixerDumpState* mDumpState; // if non-NULL, then update dump state periodically
NBAIO_Sink* mTeeSink; // if non-NULL, then duplicate write()s to this non-blocking sink
- NBLog::Writer* mNBLogWriter; // non-blocking logger
}; // struct FastMixerState
} // namespace android