Lines Matching +full:data +full:- +full:rates

2  *  PCM Interface - misc routines
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #define SND_PCM_FORMAT_UNKNOWN (-1)
37 signed char le; /* 0 = big-endian, 1 = little-endian, -1 = others */
38 signed char signd; /* 0 = unsigned, 1 = signed, -1 = others */
39 unsigned char silence[8]; /* silence data to fill */
52 .width = 8, .phys = 8, .le = -1, .signd = 1,
56 .width = 8, .phys = 8, .le = -1, .signd = 0,
108 .width = 32, .phys = 32, .le = 1, .signd = -1,
112 .width = 32, .phys = 32, .le = 0, .signd = -1,
116 .width = 64, .phys = 64, .le = 1, .signd = -1,
120 .width = 64, .phys = 64, .le = 0, .signd = -1,
124 .width = 32, .phys = 32, .le = 1, .signd = -1,
128 .width = 32, .phys = 32, .le = 0, .signd = -1,
132 .width = 8, .phys = 8, .le = -1, .signd = -1,
136 .width = 8, .phys = 8, .le = -1, .signd = -1,
140 .width = 4, .phys = 4, .le = -1, .signd = -1,
144 .width = 3, .phys = 3, .le = -1, .signd = -1,
148 .width = 5, .phys = 5, .le = -1, .signd = -1,
173 .le = -1, .signd = -1,
176 .le = -1, .signd = -1,
196 .le = -1, .signd = -1,
247 .width = 3, .phys = 8, .le = -1, .signd = -1,
251 .width = 5, .phys = 8, .le = -1, .signd = -1,
258 * snd_pcm_format_signed - Check the PCM format is signed linear
262 * linear, and a negative error code for non-linear formats.
268 return -EINVAL; in snd_pcm_format_signed()
271 return -EINVAL; in snd_pcm_format_signed()
277 * snd_pcm_format_unsigned - Check the PCM format is unsigned linear
281 * linear, and a negative error code for non-linear formats.
295 * snd_pcm_format_linear - Check the PCM format is linear
307 * snd_pcm_format_little_endian - Check the PCM format is little-endian
310 * Return: 1 if the given PCM format is little-endian, 0 if
311 * big-endian, or a negative error code if endian not specified.
317 return -EINVAL; in snd_pcm_format_little_endian()
320 return -EINVAL; in snd_pcm_format_little_endian()
326 * snd_pcm_format_big_endian - Check the PCM format is big-endian
329 * Return: 1 if the given PCM format is big-endian, 0 if
330 * little-endian, or a negative error code if endian not specified.
344 * snd_pcm_format_width - return the bit-width of the format
347 * Return: The bit-width of the format, or a negative error code
354 return -EINVAL; in snd_pcm_format_width()
357 return -EINVAL; in snd_pcm_format_width()
363 * snd_pcm_format_physical_width - return the physical bit-width of the format
366 * Return: The physical bit-width of the format, or a negative error code
373 return -EINVAL; in snd_pcm_format_physical_width()
376 return -EINVAL; in snd_pcm_format_physical_width()
382 * snd_pcm_format_size - return the byte size of samples on the given format
393 return -EINVAL; in snd_pcm_format_size()
399 * snd_pcm_format_silence_64 - return the silent data in 8 bytes array
415 * snd_pcm_format_set_silence - set the silence data on the buffer
417 * @data: the buffer pointer
420 * Sets the silence data on the buffer for the given samples.
424 int snd_pcm_format_set_silence(snd_pcm_format_t format, void *data, unsigned int samples) in snd_pcm_format_set_silence() argument
431 return -EINVAL; in snd_pcm_format_set_silence()
437 return -EINVAL; in snd_pcm_format_set_silence()
438 /* signed or 1 byte data */ in snd_pcm_format_set_silence()
441 memset(data, *pat, bytes); in snd_pcm_format_set_silence()
444 /* non-zero samples, fill using a loop */ in snd_pcm_format_set_silence()
446 dst = data; in snd_pcm_format_set_silence()
448 while (samples--) { in snd_pcm_format_set_silence()
456 while (samples--) { in snd_pcm_format_set_silence()
462 while (samples--) { in snd_pcm_format_set_silence()
468 while (samples--) { in snd_pcm_format_set_silence()
474 while (samples--) { in snd_pcm_format_set_silence()
486 * snd_pcm_hw_limit_rates - determine rate_min/rate_max fields
489 * Determines the rate_min and rate_max fields from the rates bits of
498 if (hw->rates & (1 << i)) { in snd_pcm_hw_limit_rates()
499 hw->rate_min = snd_pcm_known_rates.list[i]; in snd_pcm_hw_limit_rates()
503 for (i = (int)snd_pcm_known_rates.count - 1; i >= 0; i--) { in snd_pcm_hw_limit_rates()
504 if (hw->rates & (1 << i)) { in snd_pcm_hw_limit_rates()
505 hw->rate_max = snd_pcm_known_rates.list[i]; in snd_pcm_hw_limit_rates()
514 * snd_pcm_rate_to_rate_bit - converts sample rate to SNDRV_PCM_RATE_xxx bit
532 * snd_pcm_rate_bit_to_rate - converts SNDRV_PCM_RATE_xxx bit to sample rate
549 static unsigned int snd_pcm_rate_mask_sanitize(unsigned int rates) in snd_pcm_rate_mask_sanitize() argument
551 if (rates & SNDRV_PCM_RATE_CONTINUOUS) in snd_pcm_rate_mask_sanitize()
553 else if (rates & SNDRV_PCM_RATE_KNOT) in snd_pcm_rate_mask_sanitize()
555 return rates; in snd_pcm_rate_mask_sanitize()
559 * snd_pcm_rate_mask_intersect - computes the intersection between two rate masks
563 * This function computes the rates that are supported by both rate masks passed
567 * Return: A rate mask containing the rates that are supported by both rates_a
589 * snd_pcm_rate_range_to_bits - converts rate range to SNDRV_PCM_RATE_xxx bit
593 * This function has an implicit assumption: the rates in the given range have
594 * only the pre-defined rates like 44100 or 16000.
602 unsigned int rates = 0; in snd_pcm_rate_range_to_bits() local
608 rates |= 1 << i; in snd_pcm_rate_range_to_bits()
611 if (!rates) in snd_pcm_rate_range_to_bits()
612 rates = SNDRV_PCM_RATE_KNOT; in snd_pcm_rate_range_to_bits()
614 return rates; in snd_pcm_rate_range_to_bits()