diff options
author | jiabin <jiabin@google.com> | 2020-02-12 12:59:18 -0800 |
---|---|---|
committer | Jiabin Huang <jiabin@google.com> | 2020-02-24 20:49:23 +0000 |
commit | 3b4b33f479b2ef31f94030a51642dcc58e1e1152 (patch) | |
tree | d20394fc5534144998aa07dc82c4f2def03ff257 | |
parent | 220ed7063eddc77b1fa17a9792ba71358c3f9484 (diff) | |
download | libhardware-3b4b33f479b2ef31f94030a51642dcc58e1e1152.tar.gz |
Add a callback for codec format changed.
Bug: 133526565
Test: Manually
Change-Id: Ie7d17c7d9b49394601b4788aa44a8407ebb6f72e
-rw-r--r-- | include/hardware/audio.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/hardware/audio.h b/include/hardware/audio.h index b047fa06..b87d3bb3 100644 --- a/include/hardware/audio.h +++ b/include/hardware/audio.h @@ -203,8 +203,15 @@ typedef enum { STREAM_CBK_EVENT_ERROR, /* stream hit some error, let AF take action */ } stream_callback_event_t; +typedef enum { + STREAM_EVENT_CBK_TYPE_CODEC_FORMAT_CHANGED, /* codec format of the stream changed */ +} stream_event_callback_type_t; + typedef int (*stream_callback_t)(stream_callback_event_t event, void *param, void *cookie); +typedef int (*stream_event_callback_t)(stream_event_callback_type_t event, + void *param, void *cookie); + /* type of drain requested to audio_stream_out->drain(). Mutually exclusive */ typedef enum { AUDIO_DRAIN_ALL, /* drain() returns when all data has been played */ @@ -422,6 +429,13 @@ struct audio_stream_out { */ void (*update_source_metadata)(struct audio_stream_out *stream, const struct source_metadata* source_metadata); + + /** + * Set the callback function for notifying events for an output stream. + */ + int (*set_event_callback)(struct audio_stream_out *stream, + stream_event_callback_t callback, + void *cookie); }; typedef struct audio_stream_out audio_stream_out_t; |