mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
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> |
||
|---|---|---|
| .. | ||
| sound | ||
| alisp.h | ||
| alsa-symbols.h | ||
| aserver.h | ||
| asoundef.h | ||
| asoundlib-head.h | ||
| asoundlib-tail.h | ||
| bswap.h | ||
| conf.h | ||
| control.h | ||
| control_external.h | ||
| control_plugin.h | ||
| error.h | ||
| global.h | ||
| hwdep.h | ||
| input.h | ||
| list.h | ||
| local.h | ||
| Makefile.am | ||
| mixer.h | ||
| mixer_abst.h | ||
| output.h | ||
| pcm.h | ||
| pcm_external.h | ||
| pcm_extplug.h | ||
| pcm_ioplug.h | ||
| pcm_old.h | ||
| pcm_plugin.h | ||
| pcm_rate.h | ||
| rawmidi.h | ||
| search.h | ||
| seq.h | ||
| seq_event.h | ||
| seq_midi_event.h | ||
| seqmid.h | ||
| sys.h | ||
| timer.h | ||
| topology.h | ||
| type_compat.h | ||
| use-case.h | ||