summaryrefslogtreecommitdiffstats
path: root/audio/unix.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-01-23 13:11:07 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-01-23 13:11:07 +0000
commit9ae63b37bb909c66a931ee3934af1ad87047f326 (patch)
treecd772bc99e37d2c5ba3e611d10370dc361a683c7 /audio/unix.c
parentf67d81062c4be2cec6bb1b340a9f212f1227e062 (diff)
Initial support of mpeg12 codec.
Diffstat (limited to 'audio/unix.c')
-rw-r--r--audio/unix.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/audio/unix.c b/audio/unix.c
index d9f7c670..2226579d 100644
--- a/audio/unix.c
+++ b/audio/unix.c
@@ -341,6 +341,7 @@ static void a2dp_discovery_complete(struct avdtp *session, GSList *seps,
struct bt_getcapabilities_rsp *rsp = (void *) buf;
struct a2dp_data *a2dp = &client->d.a2dp;
struct sbc_codec_cap *sbc_cap = NULL;
+ struct mpeg_codec_cap *mpeg_cap = NULL;
GSList *l;
if (err)
@@ -364,10 +365,11 @@ static void a2dp_discovery_complete(struct avdtp *session, GSList *seps,
codec_cap = (void *) cap->data;
- if (codec_cap->media_codec_type == A2DP_CODEC_SBC && !sbc_cap) {
+ if (codec_cap->media_codec_type == A2DP_CODEC_SBC && !sbc_cap)
sbc_cap = (void *) codec_cap;
- break;
- }
+
+ if (codec_cap->media_codec_type == A2DP_CODEC_MPEG12 && !mpeg_cap)
+ mpeg_cap = (void *) codec_cap;
}
/* endianess prevent direct cast */
@@ -381,6 +383,17 @@ static void a2dp_discovery_complete(struct avdtp *session, GSList *seps,
rsp->sbc_capabilities.max_bitpool = sbc_cap->max_bitpool;
}
+ if (mpeg_cap) {
+ rsp->mpeg_capabilities.channel_mode = mpeg_cap->channel_mode;
+ rsp->mpeg_capabilities.crc = mpeg_cap->crc;
+ rsp->mpeg_capabilities.layer = mpeg_cap->layer;
+ rsp->mpeg_capabilities.frequency = mpeg_cap->frequency;
+ rsp->mpeg_capabilities.mpf = mpeg_cap->mpf;
+ rsp->mpeg_capabilities.vbr = mpeg_cap->vbr;
+ rsp->mpeg_capabilities.bitrate = mpeg_cap->bitrate1 &
+ mpeg_cap->bitrate0 << 8;
+ }
+
unix_ipc_sendmsg(client, &rsp->rsp_h.msg_h);
return;