summaryrefslogtreecommitdiffstats
path: root/include/hardware/bt_av.h
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@google.com>2014-06-07 14:05:22 -0700
committerMike Lockwood <lockwood@google.com>2014-06-13 09:09:58 -0700
commit21e50b1898db68f9fdeb355b86f717ff342795bd (patch)
tree65ad98621bfe902aba7dcff249ff4fcb112c5971 /include/hardware/bt_av.h
parent7da4cb8b6f9e99b1c003d8aada8a36c1ce977313 (diff)
downloadhardware_libhardware-21e50b1898db68f9fdeb355b86f717ff342795bd.zip
hardware_libhardware-21e50b1898db68f9fdeb355b86f717ff342795bd.tar.gz
hardware_libhardware-21e50b1898db68f9fdeb355b86f717ff342795bd.tar.bz2
Use separate HAL interfaces for A2DP source and sink roles.
Both use the same structs for APIs and callbacks, but now source and sink mode can operate independently with separate Bluetooth profile services in the framework. An extra callback btav_audio_config_callback is used for reporting audio configuration for A2DP sink role Change-Id: I6e8172b66ff95e61721d1c35790609b7ae2be030
Diffstat (limited to 'include/hardware/bt_av.h')
-rw-r--r--include/hardware/bt_av.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/hardware/bt_av.h b/include/hardware/bt_av.h
index 2ec00c3..5252a17 100644
--- a/include/hardware/bt_av.h
+++ b/include/hardware/bt_av.h
@@ -47,12 +47,23 @@ typedef void (* btav_connection_state_callback)(btav_connection_state_t state,
typedef void (* btav_audio_state_callback)(btav_audio_state_t state,
bt_bdaddr_t *bd_addr);
+/** Callback for audio configuration change.
+ * Used only for the A2DP sink interface.
+ * state will have one of the values from btav_audio_state_t
+ * sample_rate: sample rate in Hz
+ * channel_count: number of channels (1 for mono, 2 for stereo)
+ */
+typedef void (* btav_audio_config_callback)(bt_bdaddr_t *bd_addr,
+ uint32_t sample_rate,
+ uint8_t channel_count);
+
/** BT-AV callback structure. */
typedef struct {
/** set to sizeof(btav_callbacks_t) */
size_t size;
btav_connection_state_callback connection_state_cb;
btav_audio_state_callback audio_state_cb;
+ btav_audio_config_callback audio_config_cb;
} btav_callbacks_t;
/**
@@ -65,7 +76,9 @@ typedef struct {
* android_audio_hw library and the Bluetooth stack.
*
*/
-/** Represents the standard BT-AV interface. */
+/** Represents the standard BT-AV interface.
+ * Used for both the A2DP source and sink interfaces.
+ */
typedef struct {
/** set to sizeof(btav_interface_t) */