summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2015-04-14 15:02:11 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-04-14 15:02:12 +0000
commitb23cabdb71b98dc5e852f5d06be271696fea92c7 (patch)
tree5fd928f892970e2d905fdfcc502a0204d62a149d /include
parent9e6955a19bf77ebf27b770e910efbe1ebf1ceac0 (diff)
parent551b5355d34aa42890811fc3606d3b63429296cd (diff)
downloadframeworks_av-b23cabdb71b98dc5e852f5d06be271696fea92c7.zip
frameworks_av-b23cabdb71b98dc5e852f5d06be271696fea92c7.tar.gz
frameworks_av-b23cabdb71b98dc5e852f5d06be271696fea92c7.tar.bz2
Merge "AudioRecord::obtainBuffer() can return nonContig like AudioTrack"
Diffstat (limited to 'include')
-rw-r--r--include/media/AudioRecord.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h
index 7be2c3e..dbe2788 100644
--- a/include/media/AudioRecord.h
+++ b/include/media/AudioRecord.h
@@ -335,6 +335,13 @@ public:
* After draining these frames of data, the caller should release them with releaseBuffer().
* If the track buffer is not empty, obtainBuffer() returns as many contiguous
* full frames as are available immediately.
+ *
+ * If nonContig is non-NULL, it is an output parameter that will be set to the number of
+ * additional non-contiguous frames that are predicted to be available immediately,
+ * if the client were to release the first frames and then call obtainBuffer() again.
+ * This value is only a prediction, and needs to be confirmed.
+ * It will be set to zero for an error return.
+ *
* If the track buffer is empty and track is stopped, obtainBuffer() returns WOULD_BLOCK
* regardless of the value of waitCount.
* If the track buffer is empty and track is not stopped, obtainBuffer() blocks with a
@@ -364,11 +371,15 @@ public:
* raw pointer to the buffer
*/
- status_t obtainBuffer(Buffer* audioBuffer, int32_t waitCount);
+ status_t obtainBuffer(Buffer* audioBuffer, int32_t waitCount,
+ size_t *nonContig = NULL);
private:
/* If nonContig is non-NULL, it is an output parameter that will be set to the number of
- * additional non-contiguous frames that are available immediately.
+ * additional non-contiguous frames that are predicted to be available immediately,
+ * if the client were to release the first frames and then call obtainBuffer() again.
+ * This value is only a prediction, and needs to be confirmed.
+ * It will be set to zero for an error return.
* FIXME We could pass an array of Buffers instead of only one Buffer to obtainBuffer(),
* in case the requested amount of frames is in two or more non-contiguous regions.
* FIXME requested and elapsed are both relative times. Consider changing to absolute time.