summaryrefslogtreecommitdiff
path: root/android/a2dp.c
diff options
context:
space:
mode:
authorAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>2014-01-22 11:34:44 +0100
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-01-23 11:34:19 +0200
commitadaa54bdf7a1e0678b6b7fa482407149f589c838 (patch)
treeb8cf7dbb22d5b6edc0c03cce3960852587d6241b /android/a2dp.c
parent282f0d076a803cc445f9a7f0cc066ca489ccc493 (diff)
downloadbluez-adaa54bdf7a1e0678b6b7fa482407149f589c838.tar.gz
android: Add MTU data to Open Stream Audio IPC
MTU value for transport channel is sent in Open Stream response, which is required to calculate number of frames which can be packed into single media packet. This is to avoid including GPLv2 licensed headers in Audio HAL implementation.
Diffstat (limited to 'android/a2dp.c')
-rw-r--r--android/a2dp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/android/a2dp.c b/android/a2dp.c
index a996f794e..572e0d120 100644
--- a/android/a2dp.c
+++ b/android/a2dp.c
@@ -1304,6 +1304,7 @@ static void bt_stream_open(const void *buf, uint16_t len)
struct audio_rsp_open_stream *rsp;
struct a2dp_setup *setup;
int fd;
+ uint16_t omtu;
DBG("");
@@ -1314,14 +1315,17 @@ static void bt_stream_open(const void *buf, uint16_t len)
return;
}
- if (!avdtp_stream_get_transport(setup->stream, &fd, NULL, NULL, NULL)) {
+ if (!avdtp_stream_get_transport(setup->stream, &fd, NULL, &omtu,
+ NULL)) {
error("avdtp_stream_get_transport: failed");
audio_ipc_send_rsp(AUDIO_OP_OPEN_STREAM, AUDIO_STATUS_FAILED);
return;
}
- len = sizeof(struct audio_preset) + setup->preset->len;
+ len = sizeof(struct audio_rsp_open_stream) +
+ sizeof(struct audio_preset) + setup->preset->len;
rsp = g_malloc0(len);
+ rsp->mtu = omtu;
rsp->preset->len = setup->preset->len;
memcpy(rsp->preset->data, setup->preset->data, setup->preset->len);