summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2018-03-30 16:59:41 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-03-30 16:59:41 +0000
commit721f4e8984a56831ed8106b4f901e2bb6a093551 (patch)
tree3292167c2d9e9aad5075c95e8d645e9f6d2f90dc
parent8cf2862f9410d3b581038edd1575c11e4ced9c76 (diff)
parent909a8f988b4a6ac52491e0af0ceef2cd4dbb25be (diff)
downloadlibhardware-721f4e8984a56831ed8106b4f901e2bb6a093551.tar.gz
Merge "Support query microphones information." into pi-dev
-rw-r--r--include/hardware/audio.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/hardware/audio.h b/include/hardware/audio.h
index 53808dd5..9ad0f8b5 100644
--- a/include/hardware/audio.h
+++ b/include/hardware/audio.h
@@ -512,6 +512,24 @@ struct audio_stream_in {
*/
int (*get_mmap_position)(const struct audio_stream_in *stream,
struct audio_mmap_position *position);
+
+ /**
+ * Called by the framework to read active microphones
+ *
+ * \param[in] stream the stream object.
+ * \param[out] mic_array Pointer to first element on array with microphone info
+ * \param[out] mic_count When called, this holds the value of the max number of elements
+ * allowed in the mic_array. The actual number of elements written
+ * is returned here.
+ * if mic_count is passed as zero, mic_array will not be populated,
+ * and mic_count will return the actual number of active microphones.
+ *
+ * \return 0 if the microphone array is successfully filled.
+ * -ENOSYS if there is an error filling the data
+ */
+ int (*get_active_microphones)(const struct audio_stream_in *stream,
+ struct audio_microphone_characteristic_t *mic_array,
+ size_t *mic_count);
};
typedef struct audio_stream_in audio_stream_in_t;
@@ -684,6 +702,25 @@ struct audio_hw_device {
void (*close_input_stream)(struct audio_hw_device *dev,
struct audio_stream_in *stream_in);
+ /**
+ * Called by the framework to read available microphones characteristics.
+ *
+ * \param[in] dev the hw_device object.
+ * \param[out] mic_array Pointer to first element on array with microphone info
+ * \param[out] mic_count When called, this holds the value of the max number of elements
+ * allowed in the mic_array. The actual number of elements written
+ * is returned here.
+ * if mic_count is passed as zero, mic_array will not be populated,
+ * and mic_count will return the actual number of microphones in the
+ * system.
+ *
+ * \return 0 if the microphone array is successfully filled.
+ * -ENOSYS if there is an error filling the data
+ */
+ int (*get_microphones)(const struct audio_hw_device *dev,
+ struct audio_microphone_characteristic_t *mic_array,
+ size_t *mic_count);
+
/** This method dumps the state of the audio hardware */
int (*dump)(const struct audio_hw_device *dev, int fd);