From 9ae63b37bb909c66a931ee3934af1ad87047f326 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 23 Jan 2008 13:11:07 +0000 Subject: Initial support of mpeg12 codec. --- audio/unix.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'audio/unix.c') 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; -- cgit