From: Takashi Iwai <tiwai@suse.de>
To: Alan Young <consult.awy@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] pcm: rate: Add capability to pass configuration node to plugins
Date: Wed, 08 Feb 2017 16:36:06 +0100 [thread overview]
Message-ID: <s5hy3xg8zkp.wl-tiwai@suse.de> (raw)
In-Reply-To: <6d7c74b7-da90-5ae9-c355-c6884b2edf09@gmail.com>
On Wed, 08 Feb 2017 11:50:44 +0100,
Alan Young wrote:
>
> It is useful for the converter used by a rate plugin to be capable of
> receiving configuration. This patch enables the "converter" node of
> the configuration of a "type rate" plugin to be specified as a
> compound and passed to open func of the converter plugin.
>
> The SND_PCM_RATE_PLUGIN_VERSION is incremented and
> SND_PCM_RATE_PLUGIN_VERSION_CONFIGURE is defined so that a converter
> plugin can test whether it should expect the extra parameter on its
> open func.
>
> Alan.
>
> [1.2 <text/html; utf-8 (7bit)>]
>
> >From febb2e95682e99fee04f5853f783ba48748850b5 Mon Sep 17 00:00:00 2001
> From: Alan Young <consult.awy@gmail.com>
> Date: Thu, 7 Apr 2016 09:15:04 +0100
> Subject: [PATCH] pcm: rate: Add capability to pass configuration node to
> plugins
>
> If a rate plugin uses a node (compound) instead of a plain string for
> its "converter" then that compound will be passed as an additional
> parameter to the plugin open() function
> (SND_PCM_RATE_PLUGIN_ENTRY(XXX)).
>
> The existing behaviour of using the first (usable) plain string value,
> regardless of parameter name, within the configuration node as the
> converter name is unchanged.
>
> Signed-off-by: Alan Young <consult.awy@gmail.com>
> ---
> include/pcm_rate.h | 5 +++--
> src/pcm/pcm_rate.c | 19 ++++++++++++-------
> 2 files changed, 15 insertions(+), 9 deletions(-)
>
> diff --git a/include/pcm_rate.h b/include/pcm_rate.h
> index 4d70df2..fb7ec55 100644
> --- a/include/pcm_rate.h
> +++ b/include/pcm_rate.h
> @@ -38,7 +38,8 @@ extern "C" {
> /**
> * Protocol version
> */
> -#define SND_PCM_RATE_PLUGIN_VERSION 0x010002
> +#define SND_PCM_RATE_PLUGIN_VERSION 0x010003
> +#define SND_PCM_RATE_PLUGIN_VERSION_CONFIGURE 0x010003
>
> /** hw_params information for a single side */
> typedef struct snd_pcm_rate_side_info {
> @@ -118,7 +119,7 @@ typedef struct snd_pcm_rate_ops {
>
> /** open function type */
> typedef int (*snd_pcm_rate_open_func_t)(unsigned int version, void **objp,
> - snd_pcm_rate_ops_t *opsp);
> + snd_pcm_rate_ops_t *opsp, const snd_config_t *conf);
The idea is interesting, but a devil lives always in the detail: you
can't change the existing function definition. This will be broken
once you mix the old version of plugin with the new system or vice
versa.
Alternatively, try to provide another function
_snd_pcm_rate_xxx_open_conf() or such. In addition, you should
provide the old open function as is for now, too.
Then the rate plugin can try to get and open via snd_dlobj_cache_get()
for the open_conf at first, then fall back to the old open function.
thanks,
Takashi
next prev parent reply other threads:[~2017-02-08 15:36 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-17 15:24 [PATCH] pcm_rate: Do not discard slave reported delay in status result Alan Young
2016-11-17 15:26 ` Alan Young
2016-11-17 16:47 ` Takashi Iwai
2016-11-17 16:51 ` Alan Young
2016-11-17 16:55 ` Takashi Iwai
2016-11-17 17:12 ` [PATCH RESEND] " Alan Young
2016-11-28 19:11 ` Takashi Iwai
2016-12-13 11:43 ` Alan Young
2016-12-13 11:49 ` Takashi Iwai
2016-12-13 13:05 ` Alan Young
2016-12-14 14:29 ` Takashi Iwai
2017-02-08 10:50 ` [PATCH] pcm: rate: Add capability to pass configuration node to plugins Alan Young
2017-02-08 15:36 ` Takashi Iwai [this message]
2017-02-09 15:41 ` Alan Young
2017-02-09 15:48 ` Alan Young
2017-02-13 17:20 ` [PATCH] [updated] " Alan Young
2017-02-14 7:08 ` Takashi Iwai
2017-02-14 7:30 ` Alan Young
2017-02-15 12:28 ` Alan Young
2017-02-17 16:53 ` Takashi Iwai
2017-02-17 17:44 ` Alan Young
2017-02-17 17:59 ` Takashi Iwai
2017-02-21 12:02 ` Alan Young
2017-02-21 12:39 ` Takashi Iwai
2017-02-21 14:34 ` Alan Young
2017-02-21 14:43 ` Takashi Iwai
2017-02-21 15:04 ` Alan Young
2017-02-21 15:14 ` Takashi Iwai
2017-02-21 15:24 ` Alan Young
2017-02-21 15:28 ` Takashi Iwai
2017-02-21 16:14 ` Alan Young
2017-02-21 21:30 ` Takashi Iwai
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=s5hy3xg8zkp.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=consult.awy@gmail.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