Bluetooth: A2DP sink interface for Audio Focus change and AVRCP 1.3
- Add interface to report audio focus change from Bluetooth Apk
to media task for A2DP Sink scenarios.
- Add interface to request audiofocus from system/bt.
- Add interfaces for AVRCP 1.3.
Change-Id: I687ea7be460b3ee3b082db9264621e2e24d04c0c
diff --git a/include/hardware/bt_av.h b/include/hardware/bt_av.h
index 5252a17..5f7601e 100644
--- a/include/hardware/bt_av.h
+++ b/include/hardware/bt_av.h
@@ -38,13 +38,13 @@
/** Callback for connection state change.
* state will have one of the values from btav_connection_state_t
*/
-typedef void (* btav_connection_state_callback)(btav_connection_state_t state,
+typedef void (* btav_connection_state_callback)(btav_connection_state_t state,
bt_bdaddr_t *bd_addr);
/** Callback for audiopath state change.
* state will have one of the values from btav_audio_state_t
*/
-typedef void (* btav_audio_state_callback)(btav_audio_state_t state,
+typedef void (* btav_audio_state_callback)(btav_audio_state_t state,
bt_bdaddr_t *bd_addr);
/** Callback for audio configuration change.
@@ -57,6 +57,13 @@
uint32_t sample_rate,
uint8_t channel_count);
+/*
+ * Callback for audio focus request to be used only in
+ * case of A2DP Sink. This is required because we are using
+ * AudioTrack approach for audio data rendering.
+ */
+typedef void (* btav_audio_focus_request_callback)(bt_bdaddr_t *bd_addr);
+
/** BT-AV callback structure. */
typedef struct {
/** set to sizeof(btav_callbacks_t) */
@@ -64,17 +71,18 @@
btav_connection_state_callback connection_state_cb;
btav_audio_state_callback audio_state_cb;
btav_audio_config_callback audio_config_cb;
+ btav_audio_focus_request_callback audio_focus_request_cb;
} btav_callbacks_t;
-/**
+/**
* NOTE:
*
* 1. AVRCP 1.0 shall be supported initially. AVRCP passthrough commands
- * shall be handled internally via uinput
+ * shall be handled internally via uinput
*
* 2. A2DP data path shall be handled via a socket pipe between the AudioFlinger
* android_audio_hw library and the Bluetooth stack.
- *
+ *
*/
/** Represents the standard BT-AV interface.
* Used for both the A2DP source and sink interfaces.
@@ -96,6 +104,9 @@
/** Closes the interface. */
void (*cleanup)( void );
+
+ /** Sends Audio Focus State. */
+ void (*audio_focus_state)( int focus_state );
} btav_interface_t;
__END_DECLS