Lines Matching defs:format
31 * \brief Return sign info for a PCM sample linear format
32 * \param format Format
33 * \return 0 unsigned, 1 signed, a negative error code if format is not linear
35 int snd_pcm_format_signed(snd_pcm_format_t format)
37 switch (format) {
81 * \brief Return sign info for a PCM sample linear format
82 * \param format Format
83 * \return 0 signed, 1 unsigned, a negative error code if format is not linear
85 int snd_pcm_format_unsigned(snd_pcm_format_t format)
89 val = snd_pcm_format_signed(format);
96 * \brief Return linear info for a PCM sample format
97 * \param format Format
100 int snd_pcm_format_linear(snd_pcm_format_t format)
102 return snd_pcm_format_signed(format) >= 0;
106 * \brief Return float info for a PCM sample format
107 * \param format Format
110 int snd_pcm_format_float(snd_pcm_format_t format)
112 switch (format) {
124 * \brief Return endian info for a PCM sample format
125 * \param format Format
128 int snd_pcm_format_little_endian(snd_pcm_format_t format)
130 switch (format) {
177 * \brief Return endian info for a PCM sample format
178 * \param format Format
181 int snd_pcm_format_big_endian(snd_pcm_format_t format)
185 val = snd_pcm_format_little_endian(format);
192 * \brief Return endian info for a PCM sample format
193 * \param format Format
196 int snd_pcm_format_cpu_endian(snd_pcm_format_t format)
199 return snd_pcm_format_little_endian(format);
201 return snd_pcm_format_big_endian(format);
206 * \brief Return the bit-width of the format
207 * \param format Sample format
208 * \return the bit-width of the format, or a negative error code if not applicable
210 int snd_pcm_format_width(snd_pcm_format_t format)
212 switch (format) {
273 * \brief Return the physical bit-width of the format (bits needed to store a PCM sample)
274 * \param format Sample format
275 * \return the physical bit-width of the format, or a negative error code if not applicable
277 int snd_pcm_format_physical_width(snd_pcm_format_t format)
279 switch (format) {
338 * \param format Sample format
342 ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples)
344 switch (format) {
406 * \brief Return 64 bit expressing silence for a PCM sample format
407 * \param format Sample format
410 uint64_t snd_pcm_format_silence_64(snd_pcm_format_t format)
412 switch (format) {
568 * \brief Return 32 bit expressing silence for a PCM sample format
569 * \param format Sample format
572 uint32_t snd_pcm_format_silence_32(snd_pcm_format_t format)
574 assert(snd_pcm_format_physical_width(format) <= 32);
575 return (uint32_t)snd_pcm_format_silence_64(format);
579 * \brief Return 16 bit expressing silence for a PCM sample format
580 * \param format Sample format
583 uint16_t snd_pcm_format_silence_16(snd_pcm_format_t format)
585 assert(snd_pcm_format_physical_width(format) <= 16);
586 return (uint16_t)snd_pcm_format_silence_64(format);
590 * \brief Return 8 bit expressing silence for a PCM sample format
591 * \param format Sample format
594 uint8_t snd_pcm_format_silence(snd_pcm_format_t format)
596 assert(snd_pcm_format_physical_width(format) <= 8);
597 return (uint8_t)snd_pcm_format_silence_64(format);
602 * \param format Sample format
607 int snd_pcm_format_set_silence(snd_pcm_format_t format, void *data, unsigned int samples)
611 switch (snd_pcm_format_physical_width(format)) {
613 uint8_t silence = snd_pcm_format_silence_64(format);
622 uint8_t silence = snd_pcm_format_silence_64(format);
627 uint16_t silence = snd_pcm_format_silence_64(format);
638 uint32_t silence = snd_pcm_format_silence_64(format);
658 uint32_t silence = snd_pcm_format_silence_64(format);
669 uint64_t silence = snd_pcm_format_silence_64(format);
709 * \brief Compose a PCM sample linear format
711 * \param pwidth Physical bit width of the format
714 * \return The matching format type, or #SND_PCM_FORMAT_UNKNOWN if no match