From: chanten <chanyeol.park@gmail.com>
To: luiz.von.dentz@intel.com
Cc: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>,
linux-bluetooth@vger.kernel.org
Subject: Re: [RFCv1 14/20] android/avdtp: Add set vendor codec function
Date: Thu, 30 Apr 2015 00:46:10 +0900 [thread overview]
Message-ID: <1430322370.2268.12.camel@gmail.com> (raw)
In-Reply-To: <1425049388-18333-15-git-send-email-Andrei.Emeltchenko.news@gmail.com>
Hi,
On Fri, 2015-02-27 at 17:03 +0200, Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>
> ---
> profiles/audio/avdtp.c | 22 ++++++++++++++++++++++
> profiles/audio/avdtp.h | 2 ++
> 2 files changed, 24 insertions(+)
>
> diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
> index 6132c13..c396e8f 100644
> --- a/profiles/audio/avdtp.c
> +++ b/profiles/audio/avdtp.c
> @@ -49,6 +49,7 @@
> #include "src/adapter.h"
> #include "src/device.h"
>
> +#include "../profiles/audio/a2dp-codecs.h"
> #include "avdtp.h"
> #include "a2dp.h"
> #include "sink.h"
> @@ -330,6 +331,8 @@ struct avdtp_local_sep {
> struct avdtp_stream *stream;
> struct seid_info info;
> uint8_t codec;
> + uint32_t vndcodec_vendor;
> + uint16_t vndcodec_codec;
> gboolean delay_reporting;
> GSList *caps;
> struct avdtp_sep_ind *ind;
> @@ -1274,6 +1277,18 @@ struct avdtp_remote_sep *avdtp_find_remote_sep(struct avdtp *session,
> if (codec_data->media_codec_type != lsep->codec)
> continue;
>
> + /* FIXME: Add Vendor Specific Codec match to SEP callback */
> + if (lsep->codec == A2DP_CODEC_VENDOR) {
> + a2dp_vendor_codec_t *vndcodec =
> + (void *) codec_data->data;
> +
> + if (btohl(vndcodec->vendor_id) != lsep->vndcodec_vendor)
> + continue;
> +
> + if (btohs(vndcodec->codec_id) != lsep->vndcodec_codec)
> + continue;
> + }
> +
> if (sep->stream == NULL)
> return sep;
> }
> @@ -3753,6 +3768,13 @@ struct avdtp_local_sep *avdtp_register_sep(struct queue *lseps, uint8_t type,
> return sep;
> }
>
> +void avdtp_sep_set_vendor_codec(struct avdtp_local_sep *sep, uint32_t vendor_id,
> + uint16_t codec_id)
> +{
> + sep->vndcodec_vendor = vendor_id;
> + sep->vndcodec_codec = codec_id;
> +}
> +
> int avdtp_unregister_sep(struct queue *lseps, struct avdtp_local_sep *sep)
> {
> if (!sep)
> diff --git a/profiles/audio/avdtp.h b/profiles/audio/avdtp.h
> index af55f76..0fc8fe2 100644
> --- a/profiles/audio/avdtp.h
> +++ b/profiles/audio/avdtp.h
> @@ -282,6 +282,8 @@ struct avdtp_local_sep *avdtp_register_sep(struct queue *lseps, uint8_t type,
> struct avdtp_sep_ind *ind,
> struct avdtp_sep_cfm *cfm,
> void *user_data);
> +void avdtp_sep_set_vendor_codec(struct avdtp_local_sep *sep, uint32_t vendor_id,
> + uint16_t codec_id);
>
> /* Find a matching pair of local and remote SEP ID's */
> struct avdtp_remote_sep *avdtp_find_remote_sep(struct avdtp *session,
I find out that bluez a2dp also do not work fine in case of multiple
vendor codecs in remote. So I think bluez also needs this android bluez
patch.
Originally I consider to use check_vendor(profile/audio/a2dp.c)function
from avdtp_find_remote_sep. but it does not seem good to me.
Could you give us the guidance?
Thanks
Chanyeol
next prev parent reply other threads:[~2015-04-29 15:46 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-27 15:02 [RFCv1 00/20] Audio deduplication part 3 Andrei Emeltchenko
2015-02-27 15:02 ` [RFCv1 01/20] audio/avdtp: Copy SEP list to avdtp session Andrei Emeltchenko
2015-02-27 15:02 ` [RFCv1 02/20] audio/avdtp: Refactor avdtp_new Andrei Emeltchenko
2015-02-27 15:02 ` [RFCv1 03/20] audio/avdtp: Add stream related debugs Andrei Emeltchenko
2015-02-27 15:02 ` [RFCv1 04/20] audio/avdtp: Remove avdtp_server from avdtp code Andrei Emeltchenko
2015-02-27 15:02 ` [RFCv1 05/20] audio/avdtp: Move connection logic from avdtp to a2dp Andrei Emeltchenko
2015-02-27 15:02 ` [RFCv1 06/20] audio/avdtp: Refactor transport and control channels Andrei Emeltchenko
2015-02-27 15:02 ` [RFCv1 07/20] audio/avdtp: Remove start timer on stream_free() Andrei Emeltchenko
2015-02-27 15:02 ` [RFCv1 08/20] audio/avdtp: Add check for callback before run it Andrei Emeltchenko
2015-02-27 15:02 ` [RFCv1 09/20] audio/avdtp: Add AVDTP_STATE_OPEN to allowed state Andrei Emeltchenko
2015-02-27 15:02 ` [RFCv1 10/20] audio/avdtp: Fix style issues Andrei Emeltchenko
2015-02-27 15:02 ` [RFCv1 11/20] android/avdtp: Move bluetooth service code to callback Andrei Emeltchenko
2015-02-27 15:03 ` [RFCv1 12/20] audio/avdtp: Make use of disconnect callback Andrei Emeltchenko
2015-02-27 15:03 ` [RFCv1 13/20] audio/avdtp: Add finalize_discovery() on unref Andrei Emeltchenko
2015-02-27 15:03 ` [RFCv1 14/20] android/avdtp: Add set vendor codec function Andrei Emeltchenko
2015-04-29 15:46 ` chanten [this message]
2015-04-29 15:46 ` chanten
2015-04-30 14:18 ` Luiz Augusto von Dentz
2015-02-27 15:03 ` [RFCv1 15/20] audio/avdtp: Add error checks and style fixes Andrei Emeltchenko
2015-02-27 15:03 ` [RFCv1 16/20] audio/avdtp: Add handling missing cases in avdtp_parse_rej Andrei Emeltchenko
2015-02-27 15:03 ` [RFCv1 17/20] audio/avdtp: Add delay reporting in capabilities Andrei Emeltchenko
2015-02-27 15:03 ` [RFCv1 18/20] audio/avdtp: Remove disconnect timer code Andrei Emeltchenko
2015-02-27 15:03 ` [RFCv1 19/20] android/avdtp: Refactor avdtp_new() Andrei Emeltchenko
2015-02-27 15:03 ` [RFCv1 20/20] audio/avdtp: Refactor freeing avdtp session Andrei Emeltchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1430322370.2268.12.camel@gmail.com \
--to=chanyeol.park@gmail.com \
--cc=Andrei.Emeltchenko.news@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.von.dentz@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox