Lines Matching full:format
45 static bool valid_format(snd_pcm_format_t format) in valid_format() argument
47 return (INT)format >= 0 && (INT)format <= (INT)SNDRV_PCM_FORMAT_LAST; in valid_format()
194 /* FIXME: the following format is not defined properly yet */
258 * snd_pcm_format_signed - Check the PCM format is signed linear
259 * @format: the format to check
261 * Return: 1 if the given PCM format is signed linear, 0 if unsigned
264 int snd_pcm_format_signed(snd_pcm_format_t format) in snd_pcm_format_signed() argument
267 if (!valid_format(format)) in snd_pcm_format_signed()
269 if ((val = pcm_formats[(INT)format].signd) < 0) in snd_pcm_format_signed()
276 * snd_pcm_format_unsigned - Check the PCM format is unsigned linear
277 * @format: the format to check
279 * Return: 1 if the given PCM format is unsigned linear, 0 if signed
282 int snd_pcm_format_unsigned(snd_pcm_format_t format) in snd_pcm_format_unsigned() argument
286 val = snd_pcm_format_signed(format); in snd_pcm_format_unsigned()
294 * snd_pcm_format_linear - Check the PCM format is linear
295 * @format: the format to check
297 * Return: 1 if the given PCM format is linear, 0 if not.
299 int snd_pcm_format_linear(snd_pcm_format_t format) in snd_pcm_format_linear() argument
301 return snd_pcm_format_signed(format) >= 0; in snd_pcm_format_linear()
306 * snd_pcm_format_little_endian - Check the PCM format is little-endian
307 * @format: the format to check
309 * Return: 1 if the given PCM format is little-endian, 0 if
312 int snd_pcm_format_little_endian(snd_pcm_format_t format) in snd_pcm_format_little_endian() argument
315 if (!valid_format(format)) in snd_pcm_format_little_endian()
317 if ((val = pcm_formats[(INT)format].le) < 0) in snd_pcm_format_little_endian()
324 * snd_pcm_format_big_endian - Check the PCM format is big-endian
325 * @format: the format to check
327 * Return: 1 if the given PCM format is big-endian, 0 if
330 int snd_pcm_format_big_endian(snd_pcm_format_t format) in snd_pcm_format_big_endian() argument
334 val = snd_pcm_format_little_endian(format); in snd_pcm_format_big_endian()
342 * snd_pcm_format_width - return the bit-width of the format
343 * @format: the format to check
345 * Return: The bit-width of the format, or a negative error code
346 * if unknown format.
348 int snd_pcm_format_width(snd_pcm_format_t format) in snd_pcm_format_width() argument
351 if (!valid_format(format)) in snd_pcm_format_width()
353 if ((val = pcm_formats[(INT)format].width) == 0) in snd_pcm_format_width()
360 * snd_pcm_format_physical_width - return the physical bit-width of the format
361 * @format: the format to check
363 * Return: The physical bit-width of the format, or a negative error code
364 * if unknown format.
366 int snd_pcm_format_physical_width(snd_pcm_format_t format) in snd_pcm_format_physical_width() argument
369 if (!valid_format(format)) in snd_pcm_format_physical_width()
371 if ((val = pcm_formats[(INT)format].phys) == 0) in snd_pcm_format_physical_width()
378 * snd_pcm_format_size - return the byte size of samples on the given format
379 * @format: the format to check
382 * Return: The byte size of the given samples for the format, or a
383 * negative error code if unknown format.
385 ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples) in snd_pcm_format_size() argument
387 int phys_width = snd_pcm_format_physical_width(format); in snd_pcm_format_size()
396 * @format: the format to check
398 * Return: The format pattern to fill or %NULL if error.
400 const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format) in snd_pcm_format_silence_64() argument
402 if (!valid_format(format)) in snd_pcm_format_silence_64()
404 if (! pcm_formats[(INT)format].phys) in snd_pcm_format_silence_64()
406 return pcm_formats[(INT)format].silence; in snd_pcm_format_silence_64()
412 * @format: the PCM format
420 int snd_pcm_format_set_silence(snd_pcm_format_t format, void *data, unsigned int samples) in snd_pcm_format_set_silence() argument
426 if (!valid_format(format)) in snd_pcm_format_set_silence()
430 width = pcm_formats[(INT)format].phys; /* physical width */ in snd_pcm_format_set_silence()
431 pat = pcm_formats[(INT)format].silence; in snd_pcm_format_set_silence()
435 if (pcm_formats[(INT)format].signd == 1 || width <= 8) { in snd_pcm_format_set_silence()