summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-04-01 17:47:00 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-04-01 17:47:01 +0000
commit2ade30003882f0c3782d68018d06cb81b99dfeb2 (patch)
tree515a19da1dc7387195367c0d706ab2cc92a5e6e5 /services/audioflinger
parent1e0c8cd8fad2108c8ea085748fcca2059e3ce4ab (diff)
parentf7160b5dc3091fd9624f25d534c6848ee831b706 (diff)
downloadframeworks_av-2ade30003882f0c3782d68018d06cb81b99dfeb2.zip
frameworks_av-2ade30003882f0c3782d68018d06cb81b99dfeb2.tar.gz
frameworks_av-2ade30003882f0c3782d68018d06cb81b99dfeb2.tar.bz2
Merge "FastMixer use FastThread and FastMixerState use FastThreadState"
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/FastMixer.h6
-rw-r--r--services/audioflinger/FastMixerState.cpp6
-rw-r--r--services/audioflinger/FastMixerState.h19
3 files changed, 13 insertions, 18 deletions
diff --git a/services/audioflinger/FastMixer.h b/services/audioflinger/FastMixer.h
index 6158925..7aeddef 100644
--- a/services/audioflinger/FastMixer.h
+++ b/services/audioflinger/FastMixer.h
@@ -18,10 +18,10 @@
#define ANDROID_AUDIO_FAST_MIXER_H
#include <utils/Debug.h>
-#include <utils/Thread.h>
extern "C" {
#include "../private/bionic_futex.h"
}
+#include "FastThread.h"
#include "StateQueue.h"
#include "FastMixerState.h"
@@ -29,10 +29,10 @@ namespace android {
typedef StateQueue<FastMixerState> FastMixerStateQueue;
-class FastMixer : public Thread {
+class FastMixer : public FastThread {
public:
- FastMixer() : Thread(false /*canCallJava*/) { }
+ FastMixer() : FastThread() { }
virtual ~FastMixer() { }
FastMixerStateQueue* sq() { return &mSQ; }
diff --git a/services/audioflinger/FastMixerState.cpp b/services/audioflinger/FastMixerState.cpp
index 43ff233..4631274 100644
--- a/services/audioflinger/FastMixerState.cpp
+++ b/services/audioflinger/FastMixerState.cpp
@@ -29,10 +29,10 @@ FastTrack::~FastTrack()
{
}
-FastMixerState::FastMixerState() :
+FastMixerState::FastMixerState() : FastThreadState(),
mFastTracksGen(0), mTrackMask(0), mOutputSink(NULL), mOutputSinkGen(0),
- mFrameCount(0), mCommand(INITIAL), mColdFutexAddr(NULL), mColdGen(0),
- mDumpState(NULL), mTeeSink(NULL), mNBLogWriter(NULL)
+ mFrameCount(0),
+ mDumpState(NULL), mTeeSink(NULL)
{
}
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