summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.h
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-01-17 12:09:05 -0800
committerGlenn Kasten <gkasten@google.com>2014-03-25 15:42:35 -0700
commitbcefec31bd1346133052356ffc8d7ac8a5b13fab (patch)
tree4125808fe2bbae00a8bf93ba260688e2f7c11181 /services/audioflinger/AudioFlinger.h
parent1392eb3d1802e9f894f87d7a7387207d1b6faca1 (diff)
downloadframeworks_av-bcefec31bd1346133052356ffc8d7ac8a5b13fab.zip
frameworks_av-bcefec31bd1346133052356ffc8d7ac8a5b13fab.tar.gz
frameworks_av-bcefec31bd1346133052356ffc8d7ac8a5b13fab.tar.bz2
Document AudioFlinger::nextUniqueId()
Change-Id: Iafe96f1c10bd85cb23a2553945ca68aa601dc2eb
Diffstat (limited to 'services/audioflinger/AudioFlinger.h')
-rw-r--r--services/audioflinger/AudioFlinger.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 2367d7d..ec32edd 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -454,7 +454,14 @@ private:
{ return mStreamTypes[stream].volume; }
void audioConfigChanged_l(int event, audio_io_handle_t ioHandle, const void *param2);
- // allocate an audio_io_handle_t, session ID, or effect ID
+ // Allocate an audio_io_handle_t, session ID, effect ID, or audio_module_handle_t.
+ // They all share the same ID space, but the namespaces are actually independent
+ // because there are separate KeyedVectors for each kind of ID.
+ // The return value is uint32_t, but is cast to signed for some IDs.
+ // FIXME This API does not handle rollover to zero (for unsigned IDs),
+ // or from positive to negative (for signed IDs).
+ // Thus it may fail by returning an ID of the wrong sign,
+ // or by returning a non-unique ID.
uint32_t nextUniqueId();
status_t moveEffectChain_l(int sessionId,
@@ -590,7 +597,11 @@ private:
DefaultKeyedVector< audio_io_handle_t, sp<RecordThread> > mRecordThreads;
DefaultKeyedVector< pid_t, sp<NotificationClient> > mNotificationClients;
+
volatile int32_t mNextUniqueId; // updated by android_atomic_inc
+ // nextUniqueId() returns uint32_t, but this is declared int32_t
+ // because the atomic operations require an int32_t
+
audio_mode_t mMode;
bool mBtNrecIsOff;