From 22618077e78a04120f19582700127b6456e21932 Mon Sep 17 00:00:00 2001 From: Timo Wischer Date: Tue, 13 Mar 2018 09:34:43 +0100 Subject: pcm: Provide areas_copy function which handles buffer wrap around The already existing areas_copy functions do not care about the end of the source and destination buffer. Therefore the caller has to take care that the requested offset+size is not exceeding any buffer limit. This additional function will take care about the end of an buffer and will continue at the beginning of the buffer. For example this is required when copying between buffers with different sizes (not multiple of). This is often the case in IO plugins like the JACK plugin. Signed-off-by: Timo Wischer Signed-off-by: Takashi Iwai --- include/pcm.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/pcm.h') diff --git a/include/pcm.h b/include/pcm.h index 2619c8cd..e2a53435 100644 --- a/include/pcm.h +++ b/include/pcm.h @@ -1147,6 +1147,15 @@ int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset, const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset, unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format); +int snd_pcm_areas_copy_wrap(const snd_pcm_channel_area_t *dst_channels, + snd_pcm_uframes_t dst_offset, + const snd_pcm_uframes_t dst_size, + const snd_pcm_channel_area_t *src_channels, + snd_pcm_uframes_t src_offset, + const snd_pcm_uframes_t src_size, + const unsigned int channels, + snd_pcm_uframes_t frames, + const snd_pcm_format_t format); /** \} */ -- cgit v1.2.3