audio/A2DP: Add implemention of audio Open command
Luiz Augusto von Dentz
maintainerPATCH 1/6 audio/A2DP: Add implemention of audio Open command
From: Luiz Augusto von Dentz <[email protected]>
--- android/a2dp.c | 159 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 158 insertions(+), 1 deletion(-)
android/a2dp.c +158 -1
@@ -52,9 +52,23 @@static GIOChannel *server =NULL ;static GSList *devices =NULL ; +static GSList *endpoints =NULL ;static bdaddr_t adapter_addr;static uint32_t record_id =0 ; +struct a2dp_preset { +void *data; +int8_t len; +}; + +struct a2dp_endpoint { +uint8_t id; +uint8_t codec; +struct avdtp_local_sep *sep; +struct a2dp_preset *caps; +GSList *presets; +}; +struct a2dp_device {bdaddr_t dst;uint8_t state;
@@ -70,6 +84,29 @@ static int device_cmp(gconstpointer s, gconstpointer user_data)return bacmp (&dev->dst, dst); } +static void preset_free (void *data) +{ +struct a2dp_preset *preset = data; + +g_free (preset->data); +g_free (preset); +} + +static void unregister_endpoint (void *data) +{ +struct a2dp_endpoint *endpoint = data; + +if (endpoint->sep) +avdtp_unregister_sep (endpoint->sep); + +if (endpoint->caps) +preset_free (endpoint->caps); + +g_slist_free_full (endpoint->presets, preset_free); + +g_free (endpoint); +} +static void a2dp_device_free (struct a2dp_device *dev) {if (dev->session)
@@ -354,10 +391,127 @@ static sdp_record_t *a2dp_record(void)return record; } +static gboolean sep_getcap_ind (struct avdtp *session, +struct avdtp_local_sep *sep, +GSList **caps,uint8_t *err, +void *user_data) +{ +struct a2dp_endpoint *endpoint = user_data; +struct a2dp_preset *cap = endpoint->presets->data; +struct avdtp_service_capability *media_transport, *media_codec; +struct avdtp_media_codec_capability *codec_caps; + + *caps =NULL ; + + media_transport =avdtp_service_cap_new (AVDTP_MEDIA_TRANSPORT , +NULL ,0 ); + + *caps =g_slist_append (*caps, media_transport); + + codec_caps =g_malloc0 (sizeof (*codec_caps) +sizeof (cap)); + codec_caps->media_type =AVDTP_MEDIA_TYPE_AUDIO ; + codec_caps->media_codec_type = endpoint->codec; +memcpy (codec_caps->data, cap->data, cap->len); + + media_codec =avdtp_service_cap_new (AVDTP_MEDIA_CODEC , codec_caps, +sizeof (*codec_caps) +sizeof (cap)); + + *caps =g_slist_append (*caps, media_codec); +g_free (codec_caps); + +return TRUE; +} + +static struct avdtp_sep_ind sep_ind = { + .get_capability = sep_getcap_ind, +}; + +static uint8_t register_endpoint (const uint8_t *uuid,uint8_t codec, +GSList *presets) +{ +struct a2dp_endpoint *endpoint; + +/* FIXME: Add proper check for uuid */ + + endpoint = g_new0(struct a2dp_endpoint, 1); + endpoint->id =g_slist_length (endpoints) +1 ; + endpoint->codec = codec; + endpoint->sep =avdtp_register_sep (AVDTP_SEP_TYPE_SOURCE , +AVDTP_MEDIA_TYPE_AUDIO , + codec, FALSE, &sep_ind,NULL , + endpoint); + endpoint->caps =g_slist_nth_data (presets->data,0 ); + endpoint->presets =g_slist_copy (g_slist_nth (presets,1 )); + + endpoints =g_slist_append (endpoints, endpoint); + +return endpoint->id; +} + +static GSList *parse_presets (const struct audio_preset *p,uint8_t count, +uint16_t len) +{ +GSList *l =NULL ; +uint8_t i; + +for (i =0 ; count > i; i++) { +struct a2dp_preset *preset; + +if (len <sizeof (struct audio_preset )) { +DBG ("Invalid preset index %u" , i); +break ; + } + + len -=sizeof (struct audio_preset ); +if (len ==0 || len < p->len) { +DBG ("Invalid preset size of %u for index %u" , len, i); +break ; + } + + preset = g_new0(struct a2dp_preset, 1); + preset->len = p->len; + preset->data =g_memdup (p->data, preset->len); + l =g_slist_append (l, preset); + + len -= preset->len; + p +=sizeof (struct audio_preset ) + preset->len; + } + +return l; +} +static void bt_audio_open (const void *buf,uint16_t len) { -DBG ("Not Implemented" ); +const struct audio_cmd_open *cmd = buf; +struct audio_rsp_open rsp; +GSList *presets; + +DBG ("" ); +if (cmd->presets ==0 ) { +error ("No audio presets found" ); + goto failed; + } + + presets =parse_presets (cmd->preset, cmd->presets, len -sizeof (*cmd)); +if (!presets) { +error ("No audio presets found" ); + goto failed; + } + + rsp.id =register_endpoint (cmd->uuid, cmd->codec, presets); +g_slist_free (presets); + +if (rsp.id ==0 ) { +error ("Unable to register endpoint" ); + goto failed; + } + +audio_ipc_send_rsp_full (AUDIO_OP_OPEN ,sizeof (rsp), &rsp,-1 ); + +return ; + +failed:audio_ipc_send_rsp (AUDIO_OP_OPEN ,AUDIO_STATUS_FAILED ); }
@@ -471,6 +625,9 @@ void bt_a2dp_unregister(void) {DBG ("" ); +g_slist_free_full (endpoints, unregister_endpoint); + endpoints =NULL ; +g_slist_foreach (devices, a2dp_device_disconnected,NULL ); devices =NULL ;
Signature · 1 line
1.8.4.2
Luiz Augusto von Dentz
maintainerPATCH 2/6 audio/A2DP: Add implemention of audio Close command
From: Luiz Augusto von Dentz <[email protected]>
--- android/a2dp.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-)
android/a2dp.c +28 -2
@@ -515,11 +515,37 @@ failed:audio_ipc_send_rsp (AUDIO_OP_OPEN ,AUDIO_STATUS_FAILED ); } +static struct a2dp_endpoint *find_endpoint (uint8_t id) +{ +GSList *l; + +for (l = endpoints; l; l =g_slist_next (l)) { +struct a2dp_endpoint *endpoint = l->data; + +if (endpoint->id == id) +return endpoint; + } + +return NULL ; +} +static void bt_audio_close (const void *buf,uint16_t len) { -DBG ("Not Implemented" ); +const struct audio_cmd_close *cmd = buf; +struct a2dp_endpoint *endpoint; + +DBG ("" ); + + endpoint =find_endpoint (cmd->id); +if (!endpoint) { +error ("Unable to find endpoint %u" , cmd->id); +audio_ipc_send_rsp (AUDIO_OP_CLOSE ,HAL_STATUS_FAILED ); +return ; + } + +unregister_endpoint (endpoint); -audio_ipc_send_rsp (AUDIO_OP_CLOSE ,HAL_STATUS_FAILED ); +audio_ipc_send_rsp (AUDIO_OP_CLOSE ,HAL_STATUS_SUCCESS ); }static void bt_stream_open (const void *buf,uint16_t len)
Signature · 1 line
1.8.4.2
Luiz Augusto von Dentz
maintainerPATCH 3/6 audio/A2DP: Add implemention of audio Open Stream command
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- android/a2dp.c | 199 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 197 insertions(+), 2 deletions(-)
android/a2dp.c +197 -2
@@ -37,6 +37,7 @@#include "lib/bluetooth.h" #include "lib/sdp.h" #include "lib/sdp_lib.h" +#include "profiles/audio/a2dp-codecs.h" #include "log.h" #include "a2dp.h" #include "hal-msg.h"
@@ -53,6 +54,7 @@static GIOChannel *server =NULL ;static GSList *devices =NULL ;static GSList *endpoints =NULL ; +static GSList *setups =NULL ;static bdaddr_t adapter_addr;static uint32_t record_id =0 ;
@@ -67,6 +69,7 @@ struct a2dp_endpoint {struct avdtp_local_sep *sep;struct a2dp_preset *caps;GSList *presets; +struct a2dp_config *config; };struct a2dp_device {
@@ -76,6 +79,13 @@ struct a2dp_device {struct avdtp *session; }; +struct a2dp_setup { +struct a2dp_device *dev; +struct a2dp_endpoint *endpoint; +struct a2dp_preset *preset; +struct avdtp_stream *stream; +}; +static int device_cmp (gconstpointer s,gconstpointer user_data) {const struct a2dp_device *dev = s;
@@ -422,8 +432,160 @@ static gboolean sep_getcap_ind(struct avdtp *session,return TRUE; } +static int sbc_check_config (struct a2dp_endpoint *endpoint, +struct a2dp_preset *conf) +{ +a2dp_sbc_t *caps, *config; + +if (conf->len !=sizeof (a2dp_sbc_t)) { +error ("SBC: Invalid configuration size (%u)" , conf->len); +return -EINVAL ; + } + + caps = endpoint->caps->data; + config = conf->data; + +if (!(caps->frequency & config->frequency)) { +error ("SBC: Unsupported frequency (%u) by endpoint" , + config->frequency); +return -EINVAL ; + } + +if (!(caps->channel_mode & config->channel_mode)) { +error ("SBC: Unsupported channel mode (%u) by endpoint" , + config->channel_mode); +return -EINVAL ; + } + +if (!(caps->block_length & config->block_length)) { +error ("SBC: Unsupported block length (%u) by endpoint" , + config->block_length); +return -EINVAL ; + } + +if (!(caps->allocation_method & config->allocation_method)) { +error ("SBC: Unsupported allocation method (%u) by endpoint" , + config->block_length); +return -EINVAL ; + } + +return 0 ; +} + +static int check_config (struct a2dp_endpoint *endpoint, +struct a2dp_preset *config) +{ +GSList *l; + +for (l = endpoint->presets; l; l =g_slist_next (l)) { +struct a2dp_preset *preset = l->data; + +if (preset->len != config->len) +continue ; + +if (memcmp (preset->data, config->data, preset->len) ==0 ) +return 0 ; + } + +/* Codec specific */ +switch (endpoint->codec) { +case A2DP_CODEC_SBC : +return sbc_check_config (endpoint, config); +default : +return -EINVAL ; + } +} + +static struct a2dp_device *find_device_by_session (struct avdtp *session) +{ +GSList *l; + +for (l = devices; l; l =g_slist_next (l)) { +struct a2dp_device *dev = l->data; + +if (dev->session == session) +return dev; + } + +return NULL ; +} + +static void setup_free (void *data) +{ +struct a2dp_setup *setup = data; + +preset_free (setup->preset); +g_free (setup); +} + +static void setup_add (struct a2dp_device *dev,struct a2dp_endpoint *endpoint, +struct a2dp_preset *preset,struct avdtp_stream *stream) +{ +struct a2dp_setup *setup; + + setup = g_new0(struct a2dp_setup, 1); + setup->dev = dev; + setup->endpoint = endpoint; + setup->preset = preset; + setup->stream = stream; + setups =g_slist_append (setups, setup); +} + +static gboolean sep_setconf_ind (struct avdtp *session, +struct avdtp_local_sep *sep, +struct avdtp_stream *stream, +GSList *caps, +avdtp_set_configuration_cb cb, +void *user_data) +{ +struct a2dp_endpoint *endpoint = user_data; +struct a2dp_device *dev; +struct a2dp_preset *preset =NULL ; + +DBG ("" ); + + dev =find_device_by_session (session); +if (!dev) { +error ("Unable to find device for session %p" , session); +return FALSE; + } + +for (; caps !=NULL ; caps =g_slist_next (caps)) { +struct avdtp_service_capability *cap = caps->data; +struct avdtp_media_codec_capability *codec; + +if (cap->category ==AVDTP_DELAY_REPORTING ) +return FALSE; + +if (cap->category !=AVDTP_MEDIA_CODEC ) +continue ; + + codec = (struct avdtp_media_codec_capability *) cap->data; + +if (codec->media_codec_type != endpoint->codec) +return FALSE; + + preset = g_new0(struct a2dp_preset, 1); + preset->len = cap->length -sizeof (*codec); + preset->data =g_memdup (codec->data, preset->len); + +if (check_config (endpoint, preset) <0 ) { +preset_free (preset); +return FALSE; + } + } + +if (!preset) +return FALSE; + +setup_add (dev, endpoint, preset, stream); + +return TRUE; +} +static struct avdtp_sep_ind sep_ind = { .get_capability = sep_getcap_ind, + .set_configuration = sep_setconf_ind, }; static uint8_t register_endpoint(const uint8_t *uuid, uint8_t codec,
@@ -548,11 +710,41 @@ static void bt_audio_close(const void *buf, uint16_t len)audio_ipc_send_rsp (AUDIO_OP_CLOSE ,HAL_STATUS_SUCCESS ); } +static struct a2dp_setup *find_setup (uint8_t id) +{ +GSList *l; + +for (l = setups; l; l =g_slist_next (l)) { +struct a2dp_setup *setup = l->data; + +if (setup->endpoint->id == id) +return setup; + } + +return NULL ; +} +static void bt_stream_open (const void *buf,uint16_t len) { -DBG ("Not Implemented" ); +const struct audio_cmd_open_stream *cmd = buf; +struct audio_rsp_open_stream *rsp; +struct a2dp_setup *setup; + +DBG ("" ); -audio_ipc_send_rsp (AUDIO_OP_OPEN_STREAM ,AUDIO_STATUS_FAILED ); + setup =find_setup (cmd->id); +if (!setup) { +error ("Unable to find stream for endpoint %u" , cmd->id); +audio_ipc_send_rsp (AUDIO_OP_OPEN_STREAM ,HAL_STATUS_FAILED ); +return ; + } + + len =sizeof (*rsp) + setup->preset->len; + rsp =g_malloc0 (sizeof (*rsp) + setup->preset->len); + rsp->preset->len = setup->preset->len; +memcpy (rsp->preset->data, setup->preset->data, setup->preset->len); + +audio_ipc_send_rsp_full (AUDIO_OP_OPEN_STREAM , len, rsp,-1 ); }static void bt_stream_close (const void *buf,uint16_t len)
@@ -651,6 +843,9 @@ void bt_a2dp_unregister(void) {DBG ("" ); +g_slist_free_full (setups, setup_free); + setups =NULL ; +g_slist_free_full (endpoints, unregister_endpoint); endpoints =NULL ;
Signature · 1 line
1.8.4.2
Luiz Augusto von Dentz
maintainerPATCH 4/6 audio/A2DP: Add implemention of audio Close Stream command
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- android/a2dp.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
android/a2dp.c +22 -1
@@ -749,8 +749,29 @@ static void bt_stream_open(const void *buf, uint16_t len)static void bt_stream_close (const void *buf,uint16_t len) { -DBG ("Not Implemented" ); +const struct audio_cmd_close_stream *cmd = buf; +struct a2dp_setup *setup; +int err; +DBG ("" ); + + setup =find_setup (cmd->id); +if (!setup) { +error ("Unable to find stream for endpoint %u" , cmd->id); + goto failed; + } + + err =avdtp_close (setup->dev->session, setup->stream, FALSE); +if (err <0 ) { +error ("avdtp_close: %s" ,strerror (-err)); + goto failed; + } + +audio_ipc_send_rsp (AUDIO_OP_CLOSE_STREAM ,AUDIO_STATUS_SUCCESS ); + +return ; + +failed:audio_ipc_send_rsp (AUDIO_OP_CLOSE_STREAM ,AUDIO_STATUS_FAILED ); }
Signature · 1 line
1.8.4.2
Luiz Augusto von Dentz
maintainerPATCH 5/6 audio/A2DP: Add implemention of audio Resume Stream command
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- android/a2dp.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
android/a2dp.c +22 -1
@@ -777,8 +777,29 @@ failed:static void bt_stream_resume (const void *buf,uint16_t len) { -DBG ("Not Implemented" ); +const struct audio_cmd_resume_stream *cmd = buf; +struct a2dp_setup *setup; +int err; + +DBG ("" ); + setup =find_setup (cmd->id); +if (!setup) { +error ("Unable to find stream for endpoint %u" , cmd->id); + goto failed; + } + + err =avdtp_start (setup->dev->session, setup->stream); +if (err <0 ) { +error ("avdtp_start: %s" ,strerror (-err)); + goto failed; + } + +audio_ipc_send_rsp (AUDIO_OP_RESUME_STREAM ,AUDIO_STATUS_SUCCESS ); + +return ; + +failed:audio_ipc_send_rsp (AUDIO_OP_RESUME_STREAM ,AUDIO_STATUS_FAILED ); }
Signature · 1 line
1.8.4.2
Luiz Augusto von Dentz
maintainerPATCH 6/6 audio/A2DP: Add implemention of audio Suspend Stream command
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
--- android/a2dp.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)
android/a2dp.c +22 -1
@@ -805,8 +805,29 @@ failed:static void bt_stream_suspend (const void *buf,uint16_t len) { -DBG ("Not Implemented" ); +const struct audio_cmd_suspend_stream *cmd = buf; +struct a2dp_setup *setup; +int err; + +DBG ("" ); + + setup =find_setup (cmd->id); +if (!setup) { +error ("Unable to find stream for endpoint %u" , cmd->id); + goto failed; + } + + err =avdtp_suspend (setup->dev->session, setup->stream); +if (err <0 ) { +error ("avdtp_suspend: %s" ,strerror (-err)); + goto failed; + } +audio_ipc_send_rsp (AUDIO_OP_SUSPEND_STREAM ,AUDIO_STATUS_SUCCESS ); + +return ; + +failed:audio_ipc_send_rsp (AUDIO_OP_SUSPEND_STREAM ,AUDIO_STATUS_FAILED ); }
Signature · 1 line
1.8.4.2
Hi Luiz,
Quoted 77 lines · On Saturday 11 January 2014 12:13:31 Luiz Augusto von Dentz wrote:
From: Luiz Augusto von Dentz <[email protected]>
--- android/a2dp.c | 159++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 158 insertions(+), 1 deletion(-)
android/a2dp.c +45
-0@@ -52,9 +52,23 @@static GIOChannel *server =NULL ;static GSList *devices =NULL ; +static GSList *endpoints =NULL ;static bdaddr_t adapter_addr;static uint32_t record_id =0 ; +struct a2dp_preset { +void *data; +int8_t len; +}; + +struct a2dp_endpoint { +uint8_t id; +uint8_t codec; +struct avdtp_local_sep *sep; +struct a2dp_preset *caps; +GSList *presets; +}; +struct a2dp_device {bdaddr_t dst;uint8_t state;@@ -70,6 +84,29 @@ static int device_cmp(gconstpointer s, gconstpointer user_data) return bacmp(&dev->dst, dst); } +static void preset_free (void *data) +{ +struct a2dp_preset *preset = data; + +g_free (preset->data); +g_free (preset); +} + +static void unregister_endpoint (void *data) +{ +struct a2dp_endpoint *endpoint = data; + +if (endpoint->sep) +avdtp_unregister_sep (endpoint->sep); + +if (endpoint->caps) +preset_free (endpoint->caps); + +g_slist_free_full (endpoint->presets, preset_free); + +g_free (endpoint); +} +static void a2dp_device_free (struct a2dp_device *dev) {if (dev->session)@@ -354,10 +391,127 @@ static sdp_record_t *a2dp_record(void)return record; } +static gboolean sep_getcap_ind (struct avdtp *session, +struct avdtp_local_sep *sep, +GSList **caps,uint8_t *err, +void *user_data) +{ +struct a2dp_endpoint *endpoint = user_data; +struct a2dp_preset *cap = endpoint->presets->data; +struct avdtp_service_capability *media_transport, *media_codec;
android/a2dp.c static sdp_record_t *a2dp_record(void) · line 411
Quoted 10 lines
android/a2dp.c +10
-0+struct avdtp_media_codec_capability *codec_caps; + + *caps =NULL ; + + media_transport =avdtp_service_cap_new (AVDTP_MEDIA_TRANSPORT , +NULL ,0 ); + + *caps =g_slist_append (*caps, media_transport); + + codec_caps =g_malloc0 (sizeof (*codec_caps) +sizeof (cap));
Shouldn't this be cap->len instead of sizeof(cap) ?
Quoted 39 lines
android/a2dp.c +39
-0+ codec_caps->media_type =AVDTP_MEDIA_TYPE_AUDIO ; + codec_caps->media_codec_type = endpoint->codec; +memcpy (codec_caps->data, cap->data, cap->len); + + media_codec =avdtp_service_cap_new (AVDTP_MEDIA_CODEC , codec_caps, +sizeof (*codec_caps) +sizeof (cap)); + + *caps =g_slist_append (*caps, media_codec); +g_free (codec_caps); + +return TRUE; +} + +static struct avdtp_sep_ind sep_ind = { + .get_capability = sep_getcap_ind, +}; + +static uint8_t register_endpoint (const uint8_t *uuid,uint8_t codec, +GSList *presets) +{ +struct a2dp_endpoint *endpoint; + +/* FIXME: Add proper check for uuid */ + + endpoint = g_new0(struct a2dp_endpoint, 1); + endpoint->id =g_slist_length (endpoints) +1 ; + endpoint->codec = codec; + endpoint->sep =avdtp_register_sep (AVDTP_SEP_TYPE_SOURCE , +AVDTP_MEDIA_TYPE_AUDIO , + codec, FALSE, &sep_ind,NULL , + endpoint); + endpoint->caps =g_slist_nth_data (presets->data,0 ); + endpoint->presets =g_slist_copy (g_slist_nth (presets,1 )); + + endpoints =g_slist_append (endpoints, endpoint); + +return endpoint->id; +} +
android/a2dp.c static sdp_record_t *a2dp_record(void) · line 460
Quoted 10 lines
android/a2dp.c +10
-0+static GSList *parse_presets (const struct audio_preset *p,uint8_t count, +uint16_t len) +{ +GSList *l =NULL ; +uint8_t i; + +for (i =0 ; count > i; i++) { +struct a2dp_preset *preset; + +if (len <sizeof (struct audio_preset )) {
If Audio IPC command is malformed we should discard it, free list and return NULL.
(I'm still not sure how daemon should behave if there is Audio IPC error, possibly closing IPC socket and reset a2dp service state?)
Quoted 67 lines
android/a2dp.c +54
-1+DBG ("Invalid preset index %u" , i); +break ; + } + + len -=sizeof (struct audio_preset ); +if (len ==0 || len < p->len) { +DBG ("Invalid preset size of %u for index %u" , len, i); +break ; + } + + preset = g_new0(struct a2dp_preset, 1); + preset->len = p->len; + preset->data =g_memdup (p->data, preset->len); + l =g_slist_append (l, preset); + + len -= preset->len; + p +=sizeof (struct audio_preset ) + preset->len; + } + +return l; +} +static void bt_audio_open (const void *buf,uint16_t len) { -DBG ("Not Implemented" ); +const struct audio_cmd_open *cmd = buf; +struct audio_rsp_open rsp; +GSList *presets; + +DBG ("" ); +if (cmd->presets ==0 ) { +error ("No audio presets found" ); + goto failed; + } + + presets =parse_presets (cmd->preset, cmd->presets, len -sizeof (*cmd)); +if (!presets) { +error ("No audio presets found" ); + goto failed; + } + + rsp.id =register_endpoint (cmd->uuid, cmd->codec, presets); +g_slist_free (presets); + +if (rsp.id ==0 ) { +error ("Unable to register endpoint" ); + goto failed; + } + +audio_ipc_send_rsp_full (AUDIO_OP_OPEN ,sizeof (rsp), &rsp,-1 ); + +return ; + +failed:audio_ipc_send_rsp (AUDIO_OP_OPEN ,AUDIO_STATUS_FAILED ); }@@ -471,6 +625,9 @@ void bt_a2dp_unregister(void) {DBG ("" ); +g_slist_free_full (endpoints, unregister_endpoint); + endpoints =NULL ; +g_slist_foreach (devices, a2dp_device_disconnected,NULL ); devices =NULL ;
Signature · 2 lines
Szymon K. Janc [email protected]
Hi Luiz,
Quoted 142 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
--- android/a2dp.c | 159 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 158 insertions(+), 1 deletion(-)android/a2dp.c +111
-0@@ -52,9 +52,23 @@static GIOChannel *server =NULL ;static GSList *devices =NULL ; +static GSList *endpoints =NULL ;static bdaddr_t adapter_addr;static uint32_t record_id =0 ; +struct a2dp_preset { +void *data; +int8_t len; +}; + +struct a2dp_endpoint { +uint8_t id; +uint8_t codec; +struct avdtp_local_sep *sep; +struct a2dp_preset *caps; +GSList *presets; +}; +struct a2dp_device {bdaddr_t dst;uint8_t state;@@ -70,6 +84,29 @@ static int device_cmp(gconstpointer s, gconstpointer user_data)return bacmp (&dev->dst, dst); } +static void preset_free (void *data) +{ +struct a2dp_preset *preset = data; + +g_free (preset->data); +g_free (preset); +} + +static void unregister_endpoint (void *data) +{ +struct a2dp_endpoint *endpoint = data; + +if (endpoint->sep) +avdtp_unregister_sep (endpoint->sep); + +if (endpoint->caps) +preset_free (endpoint->caps); + +g_slist_free_full (endpoint->presets, preset_free); + +g_free (endpoint); +} +static void a2dp_device_free (struct a2dp_device *dev) {if (dev->session)@@ -354,10 +391,127 @@ static sdp_record_t *a2dp_record(void)return record; } +static gboolean sep_getcap_ind (struct avdtp *session, +struct avdtp_local_sep *sep, +GSList **caps,uint8_t *err, +void *user_data) +{ +struct a2dp_endpoint *endpoint = user_data; +struct a2dp_preset *cap = endpoint->presets->data; +struct avdtp_service_capability *media_transport, *media_codec; +struct avdtp_media_codec_capability *codec_caps; + + *caps =NULL ; + + media_transport =avdtp_service_cap_new (AVDTP_MEDIA_TRANSPORT , +NULL ,0 ); + + *caps =g_slist_append (*caps, media_transport); + + codec_caps =g_malloc0 (sizeof (*codec_caps) +sizeof (cap)); + codec_caps->media_type =AVDTP_MEDIA_TYPE_AUDIO ; + codec_caps->media_codec_type = endpoint->codec; +memcpy (codec_caps->data, cap->data, cap->len); + + media_codec =avdtp_service_cap_new (AVDTP_MEDIA_CODEC , codec_caps, +sizeof (*codec_caps) +sizeof (cap)); + + *caps =g_slist_append (*caps, media_codec); +g_free (codec_caps); + +return TRUE; +} + +static struct avdtp_sep_ind sep_ind = { + .get_capability = sep_getcap_ind, +}; + +static uint8_t register_endpoint (const uint8_t *uuid,uint8_t codec, +GSList *presets) +{ +struct a2dp_endpoint *endpoint; + +/* FIXME: Add proper check for uuid */ + + endpoint = g_new0(struct a2dp_endpoint, 1); + endpoint->id =g_slist_length (endpoints) +1 ; + endpoint->codec = codec; + endpoint->sep =avdtp_register_sep (AVDTP_SEP_TYPE_SOURCE , +AVDTP_MEDIA_TYPE_AUDIO , + codec, FALSE, &sep_ind,NULL , + endpoint); + endpoint->caps =g_slist_nth_data (presets->data,0 ); + endpoint->presets =g_slist_copy (g_slist_nth (presets,1 )); + + endpoints =g_slist_append (endpoints, endpoint); + +return endpoint->id; +} + +static GSList *parse_presets (const struct audio_preset *p,uint8_t count, +uint16_t len) +{ +GSList *l =NULL ; +uint8_t i; + +for (i =0 ; count > i; i++) { +struct a2dp_preset *preset; + +if (len <sizeof (struct audio_preset )) { +DBG ("Invalid preset index %u" , i); +break ; + } + + len -=sizeof (struct audio_preset ); +if (len ==0 || len < p->len) { +DBG ("Invalid preset size of %u for index %u" , len, i);
android/a2dp.c static sdp_record_t *a2dp_record(void) · line 477
Quoted 10 lines
android/a2dp.c +10
-0+break ; + } + + preset = g_new0(struct a2dp_preset, 1); + preset->len = p->len; + preset->data =g_memdup (p->data, preset->len); + l =g_slist_append (l, preset); + + len -= preset->len; + p +=sizeof (struct audio_preset ) + preset->len;
It would be better to explicitly use uint8_t pointer for presets buffer since this will work only as long as sizeof(struct audio_preset) is 1.
Andrzej
Re: [PATCH BlueZ 2/6] audio/A2DP: Add implemention of audio Close command
In reply to Luiz Augusto von DentzHi Luiz,
Quoted 30 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
--- android/a2dp.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-)android/a2dp.c +14
-0@@ -515,11 +515,37 @@ failed:audio_ipc_send_rsp (AUDIO_OP_OPEN ,AUDIO_STATUS_FAILED ); } +static struct a2dp_endpoint *find_endpoint (uint8_t id) +{ +GSList *l; + +for (l = endpoints; l; l =g_slist_next (l)) { +struct a2dp_endpoint *endpoint = l->data; + +if (endpoint->id == id) +return endpoint; + } + +return NULL ; +} +static void bt_audio_close (const void *buf,uint16_t len) {
android/a2dp.c failed: · line 542
Quoted 10 lines
android/a2dp.c +9
-1-DBG ("Not Implemented" ); +const struct audio_cmd_close *cmd = buf; +struct a2dp_endpoint *endpoint; + +DBG ("" ); + + endpoint =find_endpoint (cmd->id); +if (!endpoint) { +error ("Unable to find endpoint %u" , cmd->id); +audio_ipc_send_rsp (AUDIO_OP_CLOSE ,HAL_STATUS_FAILED );
I think we should use AUDIO_STATUS_FAILED instead of HAL_STATUS_FAILED
android/a2dp.c failed: · line 548
Quoted 7 lines
android/a2dp.c +5
-1+return ; + } + +unregister_endpoint (endpoint); -audio_ipc_send_rsp (AUDIO_OP_CLOSE ,HAL_STATUS_FAILED ); +audio_ipc_send_rsp (AUDIO_OP_CLOSE ,HAL_STATUS_SUCCESS );
Similar here.
Quoted 7 lines
android/a2dp.c +0
-1}static void bt_stream_open (const void *buf,uint16_t len) --1.8.4.2
--
\Lukasz
Quoted 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Luiz,
Quoted 65 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
--- android/a2dp.c | 159 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 158 insertions(+), 1 deletion(-)android/a2dp.c +37
-0@@ -52,9 +52,23 @@static GIOChannel *server =NULL ;static GSList *devices =NULL ; +static GSList *endpoints =NULL ;static bdaddr_t adapter_addr;static uint32_t record_id =0 ; +struct a2dp_preset { +void *data; +int8_t len; +}; + +struct a2dp_endpoint { +uint8_t id; +uint8_t codec; +struct avdtp_local_sep *sep; +struct a2dp_preset *caps; +GSList *presets; +}; +struct a2dp_device {bdaddr_t dst;uint8_t state;@@ -70,6 +84,29 @@ static int device_cmp(gconstpointer s, gconstpointer user_data)return bacmp (&dev->dst, dst); } +static void preset_free (void *data) +{ +struct a2dp_preset *preset = data; + +g_free (preset->data); +g_free (preset); +} + +static void unregister_endpoint (void *data) +{ +struct a2dp_endpoint *endpoint = data; + +if (endpoint->sep) +avdtp_unregister_sep (endpoint->sep); + +if (endpoint->caps) +preset_free (endpoint->caps); + +g_slist_free_full (endpoint->presets, preset_free); + +g_free (endpoint); +} +static void a2dp_device_free (struct a2dp_device *dev) {if (dev->session)
android/a2dp.c static sdp_record_t *a2dp_record(void) · line 400
Quoted 10 lines
android/a2dp.c +7
-0@@ -354,10 +391,127 @@ static sdp_record_t *a2dp_record(void)return record; } +static gboolean sep_getcap_ind (struct avdtp *session, +struct avdtp_local_sep *sep, +GSList **caps,uint8_t *err, +void *user_data) +{ +struct a2dp_endpoint *endpoint = user_data; +struct a2dp_preset *cap = endpoint->presets->data;
endpoint->caps
Quoted 33 lines
android/a2dp.c +33
-0+struct avdtp_service_capability *media_transport, *media_codec; +struct avdtp_media_codec_capability *codec_caps; + + *caps =NULL ; + + media_transport =avdtp_service_cap_new (AVDTP_MEDIA_TRANSPORT , +NULL ,0 ); + + *caps =g_slist_append (*caps, media_transport); + + codec_caps =g_malloc0 (sizeof (*codec_caps) +sizeof (cap)); + codec_caps->media_type =AVDTP_MEDIA_TYPE_AUDIO ; + codec_caps->media_codec_type = endpoint->codec; +memcpy (codec_caps->data, cap->data, cap->len); + + media_codec =avdtp_service_cap_new (AVDTP_MEDIA_CODEC , codec_caps, +sizeof (*codec_caps) +sizeof (cap)); + + *caps =g_slist_append (*caps, media_codec); +g_free (codec_caps); + +return TRUE; +} + +static struct avdtp_sep_ind sep_ind = { + .get_capability = sep_getcap_ind, +}; + +static uint8_t register_endpoint (const uint8_t *uuid,uint8_t codec, +GSList *presets) +{ +struct a2dp_endpoint *endpoint; +
android/a2dp.c static sdp_record_t *a2dp_record(void) · line 443
Quoted 10 lines
android/a2dp.c +10
-0+/* FIXME: Add proper check for uuid */ + + endpoint = g_new0(struct a2dp_endpoint, 1); + endpoint->id =g_slist_length (endpoints) +1 ; + endpoint->codec = codec; + endpoint->sep =avdtp_register_sep (AVDTP_SEP_TYPE_SOURCE , +AVDTP_MEDIA_TYPE_AUDIO , + codec, FALSE, &sep_ind,NULL , + endpoint); + endpoint->caps =g_slist_nth_data (presets->data,0 );
g_slist_nth_data(presets, 0)
BR,
Andrzej
Re: [PATCH BlueZ 3/6] audio/A2DP: Add implemention of audio Open Stream command
In reply to Luiz Augusto von DentzHi Luiz,
Quoted 191 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
--- android/a2dp.c | 199 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 197 insertions(+), 2 deletions(-)android/a2dp.c +149
-0@@ -37,6 +37,7 @@#include "lib/bluetooth.h" #include "lib/sdp.h" #include "lib/sdp_lib.h" +#include "profiles/audio/a2dp-codecs.h" #include "log.h" #include "a2dp.h" #include "hal-msg.h" @@ -53,6 +54,7 @@static GIOChannel *server =NULL ;static GSList *devices =NULL ;static GSList *endpoints =NULL ; +static GSList *setups =NULL ;static bdaddr_t adapter_addr;static uint32_t record_id =0 ;@@ -67,6 +69,7 @@ struct a2dp_endpoint {struct avdtp_local_sep *sep;struct a2dp_preset *caps;GSList *presets; +struct a2dp_config *config; };struct a2dp_device {@@ -76,6 +79,13 @@ struct a2dp_device {struct avdtp *session; }; +struct a2dp_setup { +struct a2dp_device *dev; +struct a2dp_endpoint *endpoint; +struct a2dp_preset *preset; +struct avdtp_stream *stream; +}; +static int device_cmp (gconstpointer s,gconstpointer user_data) {const struct a2dp_device *dev = s;@@ -422,8 +432,160 @@ static gboolean sep_getcap_ind(struct avdtp *session,return TRUE; } +static int sbc_check_config (struct a2dp_endpoint *endpoint, +struct a2dp_preset *conf) +{ +a2dp_sbc_t *caps, *config; + +if (conf->len !=sizeof (a2dp_sbc_t)) { +error ("SBC: Invalid configuration size (%u)" , conf->len); +return -EINVAL ; + } + + caps = endpoint->caps->data; + config = conf->data; + +if (!(caps->frequency & config->frequency)) { +error ("SBC: Unsupported frequency (%u) by endpoint" , + config->frequency); +return -EINVAL ; + } + +if (!(caps->channel_mode & config->channel_mode)) { +error ("SBC: Unsupported channel mode (%u) by endpoint" , + config->channel_mode); +return -EINVAL ; + } + +if (!(caps->block_length & config->block_length)) { +error ("SBC: Unsupported block length (%u) by endpoint" , + config->block_length); +return -EINVAL ; + } + +if (!(caps->allocation_method & config->allocation_method)) { +error ("SBC: Unsupported allocation method (%u) by endpoint" , + config->block_length); +return -EINVAL ; + } + +return 0 ; +} + +static int check_config (struct a2dp_endpoint *endpoint, +struct a2dp_preset *config) +{ +GSList *l; + +for (l = endpoint->presets; l; l =g_slist_next (l)) { +struct a2dp_preset *preset = l->data; + +if (preset->len != config->len) +continue ; + +if (memcmp (preset->data, config->data, preset->len) ==0 ) +return 0 ; + } + +/* Codec specific */ +switch (endpoint->codec) { +case A2DP_CODEC_SBC : +return sbc_check_config (endpoint, config); +default : +return -EINVAL ; + } +} + +static struct a2dp_device *find_device_by_session (struct avdtp *session) +{ +GSList *l; + +for (l = devices; l; l =g_slist_next (l)) { +struct a2dp_device *dev = l->data; + +if (dev->session == session) +return dev; + } + +return NULL ; +} + +static void setup_free (void *data) +{ +struct a2dp_setup *setup = data; + +preset_free (setup->preset); +g_free (setup); +} + +static void setup_add (struct a2dp_device *dev,struct a2dp_endpoint *endpoint, +struct a2dp_preset *preset,struct avdtp_stream *stream) +{ +struct a2dp_setup *setup; + + setup = g_new0(struct a2dp_setup, 1); + setup->dev = dev; + setup->endpoint = endpoint; + setup->preset = preset; + setup->stream = stream; + setups =g_slist_append (setups, setup); +} + +static gboolean sep_setconf_ind (struct avdtp *session, +struct avdtp_local_sep *sep, +struct avdtp_stream *stream, +GSList *caps, +avdtp_set_configuration_cb cb, +void *user_data) +{ +struct a2dp_endpoint *endpoint = user_data; +struct a2dp_device *dev; +struct a2dp_preset *preset =NULL ; + +DBG ("" ); + + dev =find_device_by_session (session); +if (!dev) { +error ("Unable to find device for session %p" , session); +return FALSE; + } + +for (; caps !=NULL ; caps =g_slist_next (caps)) { +struct avdtp_service_capability *cap = caps->data; +struct avdtp_media_codec_capability *codec; + +if (cap->category ==AVDTP_DELAY_REPORTING ) +return FALSE; + +if (cap->category !=AVDTP_MEDIA_CODEC ) +continue ; + + codec = (struct avdtp_media_codec_capability *) cap->data; + +if (codec->media_codec_type != endpoint->codec) +return FALSE; + + preset = g_new0(struct a2dp_preset, 1); + preset->len = cap->length -sizeof (*codec); + preset->data =g_memdup (codec->data, preset->len); + +if (check_config (endpoint, preset) <0 ) { +preset_free (preset);
android/a2dp.c static gboolean sep_getcap_ind(struct avdtp *session, · line 583
Quoted 10 lines
android/a2dp.c +10
-0+return FALSE; + } + } + +if (!preset) +return FALSE; + +setup_add (dev, endpoint, preset, stream); + +return TRUE;
I guess there should be call to avdtp_set_configuration_cb somewhere in this function?
BR,
Andrzej
Re: [PATCH BlueZ 3/6] audio/A2DP: Add implemention of audio Open Stream command
In reply to Luiz Augusto von DentzHi Luiz,
Quoted 11 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
--- android/a2dp.c | 199 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 197 insertions(+), 2 deletions(-)android/a2dp.c +0
-0
android/a2dp.c line 40
Quoted 4 lines
android/a2dp.c +1
-0@@ -37,6 +37,7 @@#include "lib/bluetooth.h" #include "lib/sdp.h" #include "lib/sdp_lib.h" +#include "profiles/audio/a2dp-codecs.h"
We need to discuss how we gonna use structs from this file in hal-audio (eg. a2dp_sbc_t). Maybe we should have some special file with audio structs/defines for IPC only? Then you could copy data to structs you need.
Quoted 216 lines
android/a2dp.c +176
-1#include "log.h" #include "a2dp.h" #include "hal-msg.h" @@ -53,6 +54,7 @@static GIOChannel *server =NULL ;static GSList *devices =NULL ;static GSList *endpoints =NULL ; +static GSList *setups =NULL ;static bdaddr_t adapter_addr;static uint32_t record_id =0 ;@@ -67,6 +69,7 @@ struct a2dp_endpoint {struct avdtp_local_sep *sep;struct a2dp_preset *caps;GSList *presets; +struct a2dp_config *config; };struct a2dp_device {@@ -76,6 +79,13 @@ struct a2dp_device {struct avdtp *session; }; +struct a2dp_setup { +struct a2dp_device *dev; +struct a2dp_endpoint *endpoint; +struct a2dp_preset *preset; +struct avdtp_stream *stream; +}; +static int device_cmp (gconstpointer s,gconstpointer user_data) {const struct a2dp_device *dev = s;@@ -422,8 +432,160 @@ static gboolean sep_getcap_ind(struct avdtp *session,return TRUE; } +static int sbc_check_config (struct a2dp_endpoint *endpoint, +struct a2dp_preset *conf) +{ +a2dp_sbc_t *caps, *config; + +if (conf->len !=sizeof (a2dp_sbc_t)) { +error ("SBC: Invalid configuration size (%u)" , conf->len); +return -EINVAL ; + } + + caps = endpoint->caps->data; + config = conf->data; + +if (!(caps->frequency & config->frequency)) { +error ("SBC: Unsupported frequency (%u) by endpoint" , + config->frequency); +return -EINVAL ; + } + +if (!(caps->channel_mode & config->channel_mode)) { +error ("SBC: Unsupported channel mode (%u) by endpoint" , + config->channel_mode); +return -EINVAL ; + } + +if (!(caps->block_length & config->block_length)) { +error ("SBC: Unsupported block length (%u) by endpoint" , + config->block_length); +return -EINVAL ; + } + +if (!(caps->allocation_method & config->allocation_method)) { +error ("SBC: Unsupported allocation method (%u) by endpoint" , + config->block_length); +return -EINVAL ; + } + +return 0 ; +} + +static int check_config (struct a2dp_endpoint *endpoint, +struct a2dp_preset *config) +{ +GSList *l; + +for (l = endpoint->presets; l; l =g_slist_next (l)) { +struct a2dp_preset *preset = l->data; + +if (preset->len != config->len) +continue ; + +if (memcmp (preset->data, config->data, preset->len) ==0 ) +return 0 ; + } + +/* Codec specific */ +switch (endpoint->codec) { +case A2DP_CODEC_SBC : +return sbc_check_config (endpoint, config); +default : +return -EINVAL ; + } +} + +static struct a2dp_device *find_device_by_session (struct avdtp *session) +{ +GSList *l; + +for (l = devices; l; l =g_slist_next (l)) { +struct a2dp_device *dev = l->data; + +if (dev->session == session) +return dev; + } + +return NULL ; +} + +static void setup_free (void *data) +{ +struct a2dp_setup *setup = data; + +preset_free (setup->preset); +g_free (setup); +} + +static void setup_add (struct a2dp_device *dev,struct a2dp_endpoint *endpoint, +struct a2dp_preset *preset,struct avdtp_stream *stream) +{ +struct a2dp_setup *setup; + + setup = g_new0(struct a2dp_setup, 1); + setup->dev = dev; + setup->endpoint = endpoint; + setup->preset = preset; + setup->stream = stream; + setups =g_slist_append (setups, setup); +} + +static gboolean sep_setconf_ind (struct avdtp *session, +struct avdtp_local_sep *sep, +struct avdtp_stream *stream, +GSList *caps, +avdtp_set_configuration_cb cb, +void *user_data) +{ +struct a2dp_endpoint *endpoint = user_data; +struct a2dp_device *dev; +struct a2dp_preset *preset =NULL ; + +DBG ("" ); + + dev =find_device_by_session (session); +if (!dev) { +error ("Unable to find device for session %p" , session); +return FALSE; + } + +for (; caps !=NULL ; caps =g_slist_next (caps)) { +struct avdtp_service_capability *cap = caps->data; +struct avdtp_media_codec_capability *codec; + +if (cap->category ==AVDTP_DELAY_REPORTING ) +return FALSE; + +if (cap->category !=AVDTP_MEDIA_CODEC ) +continue ; + + codec = (struct avdtp_media_codec_capability *) cap->data; + +if (codec->media_codec_type != endpoint->codec) +return FALSE; + + preset = g_new0(struct a2dp_preset, 1); + preset->len = cap->length -sizeof (*codec); + preset->data =g_memdup (codec->data, preset->len); + +if (check_config (endpoint, preset) <0 ) { +preset_free (preset); +return FALSE; + } + } + +if (!preset) +return FALSE; + +setup_add (dev, endpoint, preset, stream); + +return TRUE; +} +static struct avdtp_sep_ind sep_ind = { .get_capability = sep_getcap_ind, + .set_configuration = sep_setconf_ind, }; static uint8_t register_endpoint(const uint8_t *uuid, uint8_t codec,@@ -548,11 +710,41 @@ static void bt_audio_close(const void *buf, uint16_t len)audio_ipc_send_rsp (AUDIO_OP_CLOSE ,HAL_STATUS_SUCCESS ); } +static struct a2dp_setup *find_setup (uint8_t id) +{ +GSList *l; + +for (l = setups; l; l =g_slist_next (l)) { +struct a2dp_setup *setup = l->data; + +if (setup->endpoint->id == id) +return setup; + } + +return NULL ; +} +static void bt_stream_open (const void *buf,uint16_t len) { -DBG ("Not Implemented" ); +const struct audio_cmd_open_stream *cmd = buf;
android/a2dp.c static void bt_audio_close(const void *buf, uint16_t len) · line 738
Quoted 10 lines
android/a2dp.c +8
-1+struct audio_rsp_open_stream *rsp; +struct a2dp_setup *setup; + +DBG ("" ); -audio_ipc_send_rsp (AUDIO_OP_OPEN_STREAM ,AUDIO_STATUS_FAILED ); + setup =find_setup (cmd->id); +if (!setup) { +error ("Unable to find stream for endpoint %u" , cmd->id); +audio_ipc_send_rsp (AUDIO_OP_OPEN_STREAM ,HAL_STATUS_FAILED );
Use AUDIO_STATUS_FAILED
Quoted 23 lines
android/a2dp.c +12
-1+return ; + } + + len =sizeof (*rsp) + setup->preset->len; + rsp =g_malloc0 (sizeof (*rsp) + setup->preset->len); + rsp->preset->len = setup->preset->len; +memcpy (rsp->preset->data, setup->preset->data, setup->preset->len); + +audio_ipc_send_rsp_full (AUDIO_OP_OPEN_STREAM , len, rsp,-1 ); }static void bt_stream_close (const void *buf,uint16_t len)@@ -651,6 +843,9 @@ void bt_a2dp_unregister(void) {DBG ("" ); +g_slist_free_full (setups, setup_free); + setups =NULL ; +g_slist_free_full (endpoints, unregister_endpoint); endpoints =NULL ; --
Quoted 2 lines
1.8.4.2
BR
Lukasz
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Luiz Augusto von Dentz
maintainerRe: [PATCH BlueZ 3/6] audio/A2DP: Add implemention of audio Open Stream command
Hi Lukasz,
Quoted 10 lines · Lukasz Rymanowski
Hi Luiz,
Quoted 6 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
--- android/a2dp.c | 199 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 197 insertions(+), 2 deletions(-)
Quoted 14 lines
android/a2dp.c line 40
Quoted 9 lines
android/a2dp.c +1
-0@@ -37,6 +37,7 @@#include "lib/bluetooth.h" #include "lib/sdp.h" #include "lib/sdp_lib.h" +#include "profiles/audio/a2dp-codecs.h" We need to discuss how we gonna use structs from this file in hal-audio (eg.
a2dp_sbc_t). Maybe we should have some special file with audio structs/defines for IPC only? Then you could copy data to structs you need.
Not sure what you mean about this header, its LGPL already so I see no problem of including it in hal-audio.
Re: [PATCH BlueZ 3/6] audio/A2DP: Add implemention of audio Open Stream command
Hi Luiz,
Quoted 29 lines · Luiz Augusto von Dentz
Hi Lukasz,
Quoted 10 lines · Lukasz Rymanowski
Hi Luiz,
Quoted 6 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
--- android/a2dp.c | 199 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 197 insertions(+), 2 deletions(-)Quoted 14 lines
android/a2dp.c line 40
Quoted 9 lines
android/a2dp.c +1
-0@@ -37,6 +37,7 @@#include "lib/bluetooth.h" #include "lib/sdp.h" #include "lib/sdp_lib.h" +#include "profiles/audio/a2dp-codecs.h" We need to discuss how we gonna use structs from this file in hal-audio (eg.
a2dp_sbc_t). Maybe we should have some special file with audio structs/defines for IPC only? Then you could copy data to structs you need.
Quoted 2 lines
Not sure what you mean about this header, its LGPL already so I see no problem of including it in hal-audio.
You are right, it is LGPL so no problem.
\Lukasz