@@ -409,6 +409,9 @@ struct avdtp {
/* Attempt stream setup instead of disconnecting */
gboolean stream_setup;
+
+ /* use offload for transport */
+ gboolean use_offload;
};
static GSList *state_callbacks = NULL;
@@ -2425,6 +2428,7 @@ struct avdtp *avdtp_new(GIOChannel *chan, struct btd_device *device,
struct queue *lseps)
{
struct avdtp *session;
+ char *use_offload;
session = g_new0(struct avdtp, 1);
@@ -2436,6 +2440,9 @@ struct avdtp *avdtp_new(GIOChannel *chan, struct btd_device *device,
session->version = get_version(session);
+ if (is_msft_a2dp_offload_supported(avdtp_get_adapter(session)))
+ session->use_offload = TRUE;
+
if (!chan)
return session;
@@ -9796,6 +9796,15 @@ static void codec_offload_func(struct btd_adapter *adapter, uint8_t action)
btd_error(adapter->dev_id, "Failed to set Codec Offload");
}
+static bool is_exp_feature_uuid_the_same(const void *data,
+ const void *match_data)
+{
+ if (sizeof(data) != sizeof(match_data))
+ return false;
+
+ return memcmp(data, match_data, sizeof(data)) == 0;
+}
+
bool is_msft_a2dp_offload_supported(struct btd_adapter *adapter)
{
return queue_find(adapter->exps, is_exp_feature_uuid_the_same,