Re: [PATCH] Allow ioplugins to override snd_pcm_delay()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Fri, 26 May 2006 11:38:11 +0200,
Pierre Ossman wrote:
> 
> Some io plug-ins might want to adjust the reported delay value and not
> strictly follow the current buffer usage (that's why we have two calls
> after all).
> 
> Allow them to specify a delay() callback and use the previous behaviour
> if they don't.
> 
> Signed-off-by: Pierre Ossman <ossman@xxxxxxxxx>
> 
> ? ioplug-delay.patch
> Index: include/pcm_ioplug.h
> ===================================================================
> RCS file: /cvsroot/alsa/alsa-lib/include/pcm_ioplug.h,v
> retrieving revision 1.5
> diff -u -r1.5 pcm_ioplug.h
> --- include/pcm_ioplug.h	24 May 2005 09:42:01 -0000	1.5
> +++ include/pcm_ioplug.h	25 May 2006 19:05:23 -0000
> @@ -130,6 +130,10 @@
>  	 */
>  	snd_pcm_sframes_t (*pointer)(snd_pcm_ioplug_t *io);
>  	/**
> +	 * get the delay for the running PCM; optional
> +	 */
> +	int (*delay)(snd_pcm_ioplug_t *io, snd_pcm_sframes_t *delayp);
> +	/**
>  	 * transfer the data; optional
>  	 */
>  	snd_pcm_sframes_t (*transfer)(snd_pcm_ioplug_t *io,

The change is OK, but please remind that the API has been already
public, so we need to keep the compatibility as much as possible.
This addition will break the binary compatibility.

First, we need the increase of version number
(SND_PCM_IOPLUG_VERSION) if we modify API.  If the version of the
object is older, either reject or allow it as compatible.

One way to keep it binary-compatible is to append the new method to
the end of the callback table, and check the version before accessing
the new method (and handle as NULL for older version).

Could you rewrite the patch in that manner?


Thanks,

Takashi


_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux