diff options
author | Kevin Rocard <krocard@google.com> | 2018-03-26 17:13:12 -0700 |
---|---|---|
committer | Kevin Rocard <krocard@google.com> | 2018-03-30 11:29:11 -0700 |
commit | 0360e255f14ce24ff315af266818da7d411474c4 (patch) | |
tree | 3827d8ec69d681286261fc27609e978e6b0454ce | |
parent | 721f4e8984a56831ed8106b4f901e2bb6a093551 (diff) | |
download | libhardware-0360e255f14ce24ff315af266818da7d411474c4.tar.gz |
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>
-rw-r--r-- | include/hardware/audio.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/include/hardware/audio.h b/include/hardware/audio.h index 9ad0f8b5..10a8789a 100644 --- a/include/hardware/audio.h +++ b/include/hardware/audio.h @@ -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; |