alsa-lib/include
Takashi Iwai 119d9c1678 pcm: rate: Improve the support multiple formats
This patch extends the PCM rate plugin for allowing its converter
plugin to deal with multiple formats.  Currently, the converter plugin
is allowed to take different formats only when convert callback is
defined.  And for this way (so far only the standard linear rate
plugin does), all linear formats have to be handled, and it's
cumbersome.

OTOH, most other rate plugins are implemented with convert_s16
callback, which accepts only S16 format.  This is often not ideal
because many converter engines can handle 32bit formats.  Also, the
target format is often 32bit format, hence this would require
additional conversion even if the converter engine can output 32bit
natively.

In this patch, for addressing the problems above, the rate plugin API
is extended in the following way:

- The new get_supported_formats callback is added; this stores the bit
  masks of the supported input and output formats, as well as the
  behavior flags.  Currently only linear formats are allowed.
- When the plugin accepts only the interleaved stream, set
  SND_PCM_RATE_FLAG_INTERLEAVED flag bit.  Otherwise the code has to
  handle snd_pcm_channel_area at each call.
- When both input and output formats have to be identical, pass
  SND_PCM_RATE_FLAG_SYNC_FORMATS flag bit.
- When the converter wants to process different formats, use convert
  callback instead of convert_s16.  You can put both in the ops for
  compatibility, too.
  The input and output formats are found in the info argument of init
  callback.
- Now the PCM rate plugin core will skip the temporary buffer
  allocation and conversions for pre- and post-process if not needed
  (i.e. matching with the requested input or output format).

The rate plugin API version is bumped to 0x010003.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-06-17 11:40:38 +02:00
..
sound topology: use inclusive language for fsync 2020-11-17 14:01:20 +01:00
alisp.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
alsa-symbols.h Fix EXPORT_SYMBOL attribute for clang 2021-06-14 10:11:42 +02:00
aserver.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
asoundef.h asoundef.h: add CEA861_AUDIO_INFOFRAME defines 2019-11-25 10:36:05 +01:00
asoundlib-head.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
asoundlib-tail.h Create asoundlib.h dynamically according to configure options 2007-07-10 15:58:41 +02:00
bswap.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
conf.h conf: add snd_config_make_path() function 2021-05-13 11:02:41 +02:00
control.h control: remap plugin - initial version 2021-04-07 16:22:50 +02:00
control_external.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
control_plugin.h control: remap plugin - add docs 2021-04-07 16:24:09 +02:00
error.h Use __func__ instead of __FUNCTION__ 2019-06-12 08:52:07 +02:00
global.h snd_dlopen: implement the relocatable version for glibc 2020-06-04 19:09:58 +02:00
hwdep.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
input.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
list.h conf: implement snd_config_add_before() and snd_config_add_after() 2019-11-14 16:56:05 +01:00
local.h ucm: add LibraryConfig support 2021-04-13 17:14:28 +02:00
Makefile.am include: try to fix the out-of-source-tree build 2021-05-25 17:13:06 +02:00
mixer.h mixer: simple - add snd_mixer_selem_id_parse() from amixer 2019-11-14 15:00:40 +01:00
mixer_abst.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
output.h output: Add snd_output_buffer_steal() function 2021-04-13 09:23:06 +02:00
pcm.h pcm: Fix a typo in SND_PCM_AUDIO_TSTAMP_TYPE_LAST definition 2020-12-22 16:11:05 +01:00
pcm_external.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
pcm_extplug.h pcm: extplug: Keep format and channels the same if requested 2018-12-10 11:53:41 +01:00
pcm_ioplug.h ioplug: Fix comment in struct snd_pcm_ioplug 2018-10-02 17:56:51 +02:00
pcm_old.h pcm: fix get_stop_threshold alsa-lib 0.9 alias 2016-12-15 22:47:02 +01:00
pcm_plugin.h pcm: the maximal rate is 768000Hz, fix the remain code 2019-10-25 13:43:31 +02:00
pcm_rate.h pcm: rate: Improve the support multiple formats 2021-06-17 11:40:38 +02:00
rawmidi.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
search.h Corrections by Kevin Conder <kconder@interaccess.com> 2002-03-12 20:14:33 +00:00
seq.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
seq_event.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
seq_midi_event.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
seqmid.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
sys.h Ok, added warning to sys/asoundlib.h with redirection to alsa/asoundlib.h. 2001-09-11 12:18:56 +00:00
timer.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
topology.h topology: use inclusive language in documentation 2020-11-17 14:01:30 +01:00
type_compat.h Change FSF address (Franklin Street) 2017-11-14 14:29:26 +01:00
use-case.h ucm: add _alibpref to get the private device prefix 2021-06-02 11:09:46 +02:00