mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Added lfloat plugin code (not finished)
This commit is contained in:
parent
72a221be2c
commit
bb749766d4
6 changed files with 33 additions and 4 deletions
|
|
@ -318,7 +318,7 @@ enum _snd_pcm_type {
|
|||
SND_PCM_TYPE_DROUTE,
|
||||
/** Loopback server plugin (not yet implemented) */
|
||||
SND_PCM_TYPE_LBSERVER,
|
||||
/** Linear <-> float format conversion PCM */
|
||||
/** Linear Integer <-> Linear Float format conversion PCM */
|
||||
SND_PCM_TYPE_LINEAR_FLOAT,
|
||||
/** LADSPA integration plugin */
|
||||
SND_PCM_TYPE_LADSPA,
|
||||
|
|
@ -808,6 +808,7 @@ snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframe
|
|||
int snd_pcm_format_signed(snd_pcm_format_t format);
|
||||
int snd_pcm_format_unsigned(snd_pcm_format_t format);
|
||||
int snd_pcm_format_linear(snd_pcm_format_t format);
|
||||
int snd_pcm_format_float(snd_pcm_format_t format);
|
||||
int snd_pcm_format_little_endian(snd_pcm_format_t format);
|
||||
int snd_pcm_format_big_endian(snd_pcm_format_t format);
|
||||
int snd_pcm_format_cpu_endian(snd_pcm_format_t format);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ libpcm_la_SOURCES = atomic.c mask.c interval.c \
|
|||
pcm_route.c pcm_mulaw.c pcm_alaw.c pcm_adpcm.c \
|
||||
pcm_rate.c pcm_plug.c pcm_misc.c pcm_mmap.c pcm_multi.c \
|
||||
pcm_shm.c pcm_file.c pcm_null.c pcm_share.c \
|
||||
pcm_meter.c pcm_hooks.c pcm_ladspa.c pcm_symbols.c
|
||||
pcm_meter.c pcm_hooks.c pcm_lfloat.c pcm_ladspa.c pcm_symbols.c
|
||||
noinst_HEADERS = atomic.h pcm_local.h pcm_plugin.h mask.h mask_inline.h \
|
||||
interval.h interval_inline.h plugin_ops.h
|
||||
|
||||
|
|
|
|||
|
|
@ -594,3 +594,9 @@ int snd_pcm_conf_generic_id(const char *id);
|
|||
(1U << SND_PCM_FORMAT_S32_BE) | \
|
||||
(1U << SND_PCM_FORMAT_U32_LE) | \
|
||||
(1U << SND_PCM_FORMAT_U32_BE))
|
||||
|
||||
#define SND_PCM_FMTBIT_FLOAT \
|
||||
((1U << SND_PCM_FORMAT_FLOAT_LE) | \
|
||||
(1U << SND_PCM_FORMAT_FLOAT_BE) | \
|
||||
(1U << SND_PCM_FORMAT_FLOAT64_LE) | \
|
||||
(1U << SND_PCM_FORMAT_FLOAT64_BE))
|
||||
|
|
|
|||
|
|
@ -81,6 +81,24 @@ int snd_pcm_format_linear(snd_pcm_format_t format)
|
|||
return snd_pcm_format_signed(format) >= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Return float info for a PCM sample format
|
||||
* \param format Format
|
||||
* \return 0 non float, 1 float
|
||||
*/
|
||||
int snd_pcm_format_float(snd_pcm_format_t format)
|
||||
{
|
||||
switch (format) {
|
||||
case SNDRV_PCM_FORMAT_FLOAT_LE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT_BE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT64_LE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT64_BE:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Return endian info for a PCM sample format
|
||||
* \param format Format
|
||||
|
|
|
|||
|
|
@ -324,7 +324,7 @@ static snd_pcm_uframes_t _snd_pcm_share_slave_missing(snd_pcm_share_slave_t *sla
|
|||
{
|
||||
snd_pcm_uframes_t missing = INT_MAX;
|
||||
struct list_head *i;
|
||||
snd_pcm_sframes_t avail = snd_pcm_avail_update(slave->pcm);
|
||||
/* snd_pcm_sframes_t avail = */ snd_pcm_avail_update(slave->pcm);
|
||||
slave->hw_ptr = *slave->pcm->hw_ptr;
|
||||
list_for_each(i, &slave->clients) {
|
||||
snd_pcm_share_t *share = list_entry(i, snd_pcm_share_t, list);
|
||||
|
|
@ -396,7 +396,7 @@ static void _snd_pcm_share_update(snd_pcm_t *pcm)
|
|||
snd_pcm_share_slave_t *slave = share->slave;
|
||||
snd_pcm_t *spcm = slave->pcm;
|
||||
snd_pcm_uframes_t missing;
|
||||
snd_pcm_sframes_t avail = snd_pcm_avail_update(spcm);
|
||||
/* snd_pcm_sframes_t avail = */ snd_pcm_avail_update(spcm);
|
||||
slave->hw_ptr = *slave->pcm->hw_ptr;
|
||||
missing = _snd_pcm_share_missing(pcm);
|
||||
if (!slave->polling) {
|
||||
|
|
@ -823,6 +823,8 @@ static int snd_pcm_share_prepare(snd_pcm_t *pcm)
|
|||
case SND_PCM_STATE_PREPARED:
|
||||
err = 0;
|
||||
goto _end;
|
||||
default: /* nothing todo */
|
||||
break;
|
||||
}
|
||||
if (slave->prepared_count == 0) {
|
||||
err = snd_pcm_prepare(slave->pcm);
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ extern const char *_snd_module_pcm_rate;
|
|||
extern const char *_snd_module_pcm_route;
|
||||
extern const char *_snd_module_pcm_share;
|
||||
extern const char *_snd_module_pcm_shm;
|
||||
extern const char *_snd_module_pcm_lfloat;
|
||||
extern const char *_snd_module_pcm_ladspa;
|
||||
|
||||
static const char **snd_pcm_open_objects[] = {
|
||||
|
|
@ -55,6 +56,7 @@ static const char **snd_pcm_open_objects[] = {
|
|||
&_snd_module_pcm_route,
|
||||
&_snd_module_pcm_share,
|
||||
&_snd_module_pcm_shm,
|
||||
&_snd_module_pcm_lfloat,
|
||||
&_snd_module_pcm_ladspa
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue