Audio V4: Add metadata update to legacy API

The metadata API was not present in the legacy HAL API
which lots of developer still use.

Test: Check the method is correctly called on each track change
Bug: 38184704
Bug: 69623109
Change-Id: I46a9db5a67baef52844ed85296a529402e00f4cb
Signed-off-by: Kevin Rocard <krocard@google.com>
This commit is contained in:
Kevin Rocard 2018-03-26 17:13:12 -07:00
parent 721f4e8984
commit 0360e255f1

View file

@ -212,13 +212,24 @@ typedef enum {
give time for gapless track switch */
} audio_drain_type_t;
typedef struct source_metadata {
size_t track_count;
/** Array of metadata of each track connected to this source. */
struct playback_track_metadata* tracks;
} source_metadata_t;
typedef struct sink_metadata {
size_t track_count;
/** Array of metadata of each track connected to this sink. */
struct record_track_metadata* tracks;
} sink_metadata_t;
/**
* audio_stream_out is the abstraction interface for the audio output hardware.
*
* It provides information about various properties of the audio output
* hardware driver.
*/
struct audio_stream_out {
/**
* Common methods of the audio stream out. This *must* be the first member of audio_stream_out
@ -403,6 +414,13 @@ struct audio_stream_out {
*/
int (*get_mmap_position)(const struct audio_stream_out *stream,
struct audio_mmap_position *position);
/**
* Called when the metadata of the stream's source has been changed.
* @param source_metadata Description of the audio that is played by the clients.
*/
void (*update_source_metadata)(struct audio_stream_out *stream,
const struct source_metadata* source_metadata);
};
typedef struct audio_stream_out audio_stream_out_t;
@ -530,6 +548,13 @@ struct audio_stream_in {
int (*get_active_microphones)(const struct audio_stream_in *stream,
struct audio_microphone_characteristic_t *mic_array,
size_t *mic_count);
/**
* Called when the metadata of the stream's sink has been changed.
* @param sink_metadata Description of the audio that is recorded by the clients.
*/
void (*update_sink_metadata)(struct audio_stream_in *stream,
const struct sink_metadata* sink_metadata);
};
typedef struct audio_stream_in audio_stream_in_t;