Merge "Support query microphones information." into pi-dev am: 721f4e8984

am: d6c41dd831

Change-Id: Ibd1854649eb745ea99750e819ef95ffc690cb75e
This commit is contained in:
rago 2018-03-30 20:50:49 +00:00 committed by android-build-merger
commit 6012c8f87c

View file

@ -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);