summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-03-01 09:21:37 -0800
committerGlenn Kasten <gkasten@google.com>2012-03-06 16:18:17 -0800
commitcbc52bfb3b51c81c945b1e35990324bde892829a (patch)
tree240280d717db745f2e46d2688487afe6c55f61e2 /services
parent92b8360fe9c3174dc0edaaab4b746d8a3d3f831f (diff)
downloadframeworks_av-cbc52bfb3b51c81c945b1e35990324bde892829a.zip
frameworks_av-cbc52bfb3b51c81c945b1e35990324bde892829a.tar.gz
frameworks_av-cbc52bfb3b51c81c945b1e35990324bde892829a.tar.bz2
Add comments about sequence for setting parameters
Change-Id: Iffa59a34c3c47bdc1d3234cdcb4d8ff99c102825
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioFlinger.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 28b33a2..60d78c8 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -534,7 +534,10 @@ private:
friend class RecordTrack;
const type_t mType;
+
+ // Used by parameters, config events, addTrack_l, exit
Condition mWaitWorkCV;
+
const sp<AudioFlinger> mAudioFlinger;
uint32_t mSampleRate;
size_t mFrameCount;
@@ -542,9 +545,30 @@ private:
uint16_t mChannelCount;
size_t mFrameSize;
audio_format_t mFormat;
+
+ // Parameter sequence by client: binder thread calling setParameters():
+ // 1. Lock mLock
+ // 2. Append to mNewParameters
+ // 3. mWaitWorkCV.signal
+ // 4. mParamCond.waitRelative with timeout
+ // 5. read mParamStatus
+ // 6. mWaitWorkCV.signal
+ // 7. Unlock
+ //
+ // Parameter sequence by server: threadLoop calling checkForNewParameters_l():
+ // 1. Lock mLock
+ // 2. If there is an entry in mNewParameters proceed ...
+ // 2. Read first entry in mNewParameters
+ // 3. Process
+ // 4. Remove first entry from mNewParameters
+ // 5. Set mParamStatus
+ // 6. mParamCond.signal
+ // 7. mWaitWorkCV.wait with timeout (this is to avoid overwriting mParamStatus)
+ // 8. Unlock
Condition mParamCond;
Vector<String8> mNewParameters;
status_t mParamStatus;
+
Vector<ConfigEvent> mConfigEvents;
bool mStandby;
const audio_io_handle_t mId;