mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
Add snd_pcm_hw_params_get/set_export_buffer()
Add snd_pcm_hw_params_get/set_export_buffer() API functions. They control to ensure the buffer export to other processes. If this flag is set, the local buffer of a plugin is exported over IPC shm. Otherwise the buffer can be handled only locally (no shm). Also fixed Version file for 1.0.9.
This commit is contained in:
parent
18053076e2
commit
4d7c53d280
7 changed files with 65 additions and 12 deletions
|
|
@ -3959,6 +3959,36 @@ int snd_pcm_hw_params_get_rate_resample(snd_pcm_t *pcm, snd_pcm_hw_params_t *par
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Restrict a configuration space to allow the buffer accessible from outside
|
||||
* \param pcm PCM handle
|
||||
* \param params Configuration space
|
||||
* \param val 0 = disable, 1 = enable (default) exporting buffer
|
||||
* \return 0 otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val)
|
||||
{
|
||||
assert(pcm && params);
|
||||
if (val)
|
||||
params->flags |= SND_PCM_HW_PARAMS_EXPORT_BUFFER;
|
||||
else
|
||||
params->flags &= ~SND_PCM_HW_PARAMS_EXPORT_BUFFER;
|
||||
return snd_pcm_hw_refine(pcm, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Extract buffer accessibility from a configuration space
|
||||
* \param pcm PCM handle
|
||||
* \param *val 0 = disable, 1 = enable exporting buffer
|
||||
* \return 0 otherwise a negative error code
|
||||
*/
|
||||
int snd_pcm_hw_params_get_export_buffer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val)
|
||||
{
|
||||
assert(pcm && params && val);
|
||||
*val = params->flags & SND_PCM_HW_PARAMS_EXPORT_BUFFER ? 1 : 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Extract period time from a configuration space
|
||||
* \param params Configuration space
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue