int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params,
snd_pcm_hw_param_t var, int *dir); int snd_pcm_hw_param_last(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params,
snd_pcm_hw_param_t var, int *dir); int snd_pcm_hw_param_value(conststruct snd_pcm_hw_params *params,
snd_pcm_hw_param_t var, int *dir);
#define SNDRV_MASK_BITS 64 /* we use so far 64bits only */ #define SNDRV_MASK_SIZE (SNDRV_MASK_BITS / 32) #define MASK_OFS(i) ((i) >> 5) #define MASK_BIT(i) (1U << ((i) & 31))
staticinlineint snd_mask_empty(conststruct snd_mask *mask)
{ int i; for (i = 0; i < SNDRV_MASK_SIZE; i++) if (mask->bits[i]) return 0; return 1;
}
staticinlineunsignedint snd_mask_min(conststruct snd_mask *mask)
{ int i; for (i = 0; i < SNDRV_MASK_SIZE; i++) { if (mask->bits[i]) return __ffs(mask->bits[i]) + (i << 5);
} return 0;
}
staticinlineunsignedint snd_mask_max(conststruct snd_mask *mask)
{ int i; for (i = SNDRV_MASK_SIZE - 1; i >= 0; i--) { if (mask->bits[i]) return __fls(mask->bits[i]) + (i << 5);
} return 0;
}
/* Most of drivers need only this one */ staticinlinevoid snd_mask_set_format(struct snd_mask *mask,
snd_pcm_format_t format)
{
snd_mask_set(mask, (__force unsignedint)format);
}
/* Most of drivers need only this one */ staticinlineint snd_mask_test_format(conststruct snd_mask *mask,
snd_pcm_format_t format)
{ return snd_mask_test(mask, (__force unsignedint)format);
}
staticinlineint snd_mask_single(conststruct snd_mask *mask)
{ int i, c = 0; for (i = 0; i < SNDRV_MASK_SIZE; i++) { if (! mask->bits[i]) continue; if (mask->bits[i] & (mask->bits[i] - 1)) return 0; if (c) return 0;
c++;
} return 1;
}
/** * params_access - get the access type from the hw params * @p: hw params
*/ staticinline snd_pcm_access_t params_access(conststruct snd_pcm_hw_params *p)
{ return (__force snd_pcm_access_t)snd_mask_min(hw_param_mask_c(p,
SNDRV_PCM_HW_PARAM_ACCESS));
}
/** * params_format - get the sample format from the hw params * @p: hw params
*/ staticinline snd_pcm_format_t params_format(conststruct snd_pcm_hw_params *p)
{ return (__force snd_pcm_format_t)snd_mask_min(hw_param_mask_c(p,
SNDRV_PCM_HW_PARAM_FORMAT));
}
/** * params_subformat - get the sample subformat from the hw params * @p: hw params
*/ staticinline snd_pcm_subformat_t
params_subformat(conststruct snd_pcm_hw_params *p)
{ return (__force snd_pcm_subformat_t)snd_mask_min(hw_param_mask_c(p,
SNDRV_PCM_HW_PARAM_SUBFORMAT));
}
/** * params_period_bytes - get the period size (in bytes) from the hw params * @p: hw params
*/ staticinlineunsignedint
params_period_bytes(conststruct snd_pcm_hw_params *p)
{ return hw_param_interval_c(p, SNDRV_PCM_HW_PARAM_PERIOD_BYTES)->min;
}
/** * params_width - get the number of bits of the sample format from the hw params * @p: hw params * * This function returns the number of bits per sample that the selected sample * format of the hw params has.
*/ staticinlineint params_width(conststruct snd_pcm_hw_params *p)
{ return snd_pcm_format_width(params_format(p));
}
/* * params_physical_width - get the storage size of the sample format from the hw params * @p: hw params * * This functions returns the number of bits per sample that the selected sample * format of the hw params takes up in memory. This will be equal or larger than * params_width().
*/ staticinlineint params_physical_width(conststruct snd_pcm_hw_params *p)
{ return snd_pcm_format_physical_width(params_format(p));
}
int snd_pcm_hw_params_bits(conststruct snd_pcm_hw_params *p);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.