OSDN Git Service

pcm: add mmap_begin callback to snd_pcm_fast_ops_t api
authorAdam Miartus <amiartus@de.adit-jv.com>
Thu, 23 May 2019 13:00:39 +0000 (15:00 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 24 May 2019 09:06:44 +0000 (11:06 +0200)
commite520f454803acfdb9af5cd7224129b37904eef4a
tree56eea4556fac81282eea5bc08f55f9e6c4b39b2a
parent108a2f43791fe769fd58726881b12ad908ebd2e0
pcm: add mmap_begin callback to snd_pcm_fast_ops_t api

main motivation for adding the callback is to use it to enable operation
on mmaped buffer before user access for pcm_file plugin

support for MMAP read access with masking by data from input file is not
implemented for pcm_file plugin, by adding this callback implementing
such feature can be done by rewriting next continuous portion of buffer
on each mmap_begin call

plugins like softvol use pcm_plugin interface and overwrite the buffer by
looping around it in avail_update callback, this patch hopes to simplify
the task by adding new api callback, removing the need for rewriting
pcm_file (to use pcm_plugin callbacks) and careful checking when looping
around whole mmaped buffer

Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
Reviewed-by: Timo Wischer <twischer@de.adit-jv.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm.c
src/pcm/pcm_local.h