Update the A2DP Codec Config API
Previously, the JNI upcall would contain only the current codec config.
In the new API, the upcall contains:
1. The current codec config
2. The list of codecs containing the local codecs capabilities
3. The list of codecs containing the selectable codecs capabilities.
This list is the intersection of the local codecs capabilities
and the capabilities of the paired device.
Also, changed the btav_a2dp_codec_priority_t type to enum.
Test: A2DP streaming with headsets and switching the codecs
Change-Id: Icb1c7e0ac6a81e4283fb5353ec2c36712587e0e1
diff --git a/include/hardware/bt_av.h b/include/hardware/bt_av.h
index 536badf..66a8643 100644
--- a/include/hardware/bt_av.h
+++ b/include/hardware/bt_av.h
@@ -68,7 +68,10 @@
BTAV_A2DP_CODEC_INDEX_MAX = BTAV_A2DP_CODEC_INDEX_SINK_MAX
} btav_a2dp_codec_index_t;
-typedef uint32_t btav_a2dp_codec_priority_t;
+typedef enum {
+ BTAV_A2DP_CODEC_PRIORITY_DEFAULT = 0,
+ BTAV_A2DP_CODEC_PRIORITY_HIGHEST = 1000 * 1000
+} btav_a2dp_codec_priority_t;
typedef enum {
BTAV_A2DP_CODEC_SAMPLE_RATE_NONE = 0x0,
@@ -132,7 +135,8 @@
*/
typedef void (* btav_audio_source_config_callback)(
btav_a2dp_codec_config_t codec_config,
- std::vector<btav_a2dp_codec_config_t> codec_capabilities);
+ std::vector<btav_a2dp_codec_config_t> codecs_local_capabilities,
+ std::vector<btav_a2dp_codec_config_t> codecs_selectable_capabilities);
/** Callback for audio configuration change.
* Used only for the A2DP Sink interface.