Merge "Support query microphones information." into pi-dev
diff --git a/include/hardware/audio.h b/include/hardware/audio.h
index 53808dd..9ad0f8b 100644
--- a/include/hardware/audio.h
+++ b/include/hardware/audio.h
@@ -512,6 +512,24 @@
*/
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 @@
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);