summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-02-21 10:32:45 -0800
committerGlenn Kasten <gkasten@google.com>2012-07-17 18:06:19 -0700
commit955e78180ac6111c54f50930b0c4c12395e86cf7 (patch)
treeb4c12804643f73e9acbbf1db58f5ffa7e0bd7bc7 /include
parentea682976030a3930f6ee49b33b7e21abfc68174a (diff)
downloadframeworks_av-955e78180ac6111c54f50930b0c4c12395e86cf7.zip
frameworks_av-955e78180ac6111c54f50930b0c4c12395e86cf7.tar.gz
frameworks_av-955e78180ac6111c54f50930b0c4c12395e86cf7.tar.bz2
AudioRecord locking
Fix race conditions for EVENT_MARKER and EVENT_NEW_POS callbacks. Marker and new position update fields are protected by lock. getSampleRate() doesn't need a lock because it reads from shared memory control block. Enforce that the parameter passed with EVENT_MARKER and EVENT_NEW_POS cannot not be changed by the callback handler, and will not change during the call by another thread. Session ID should never change; log if it does. Change-Id: Ia2c63cf1a71b10bb06c37981bd76437f83fffa91
Diffstat (limited to 'include')
-rw-r--r--include/media/AudioRecord.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h
index 7e66ac9..156c592 100644
--- a/include/media/AudioRecord.h
+++ b/include/media/AudioRecord.h
@@ -84,8 +84,8 @@ public:
* more bytes than indicated by 'size' field and update 'size' if less bytes are
* read.
* - EVENT_OVERRUN: unused.
- * - EVENT_MARKER: pointer to an uin32_t containing the marker position in frames.
- * - EVENT_NEW_POS: pointer to an uin32_t containing the new position in frames.
+ * - EVENT_MARKER: pointer to const uint32_t containing the marker position in frames.
+ * - EVENT_NEW_POS: pointer to const uint32_t containing the new position in frames.
*/
typedef void (*callback_t)(int event, void* user, void *info);