Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
pcm_misc.c File Reference
#include <linux/time.h>
#include <linux/export.h>
#include <sound/core.h>
#include <sound/pcm.h>

Go to the source code of this file.

Data Structures

struct  pcm_format_data
 

Macros

#define SND_PCM_FORMAT_UNKNOWN   (-1)
 
#define INT   __force int
 

Functions

int snd_pcm_format_signed (snd_pcm_format_t format)
 
 EXPORT_SYMBOL (snd_pcm_format_signed)
 
int snd_pcm_format_unsigned (snd_pcm_format_t format)
 
 EXPORT_SYMBOL (snd_pcm_format_unsigned)
 
int snd_pcm_format_linear (snd_pcm_format_t format)
 
 EXPORT_SYMBOL (snd_pcm_format_linear)
 
int snd_pcm_format_little_endian (snd_pcm_format_t format)
 
 EXPORT_SYMBOL (snd_pcm_format_little_endian)
 
int snd_pcm_format_big_endian (snd_pcm_format_t format)
 
 EXPORT_SYMBOL (snd_pcm_format_big_endian)
 
int snd_pcm_format_width (snd_pcm_format_t format)
 
 EXPORT_SYMBOL (snd_pcm_format_width)
 
int snd_pcm_format_physical_width (snd_pcm_format_t format)
 
 EXPORT_SYMBOL (snd_pcm_format_physical_width)
 
ssize_t snd_pcm_format_size (snd_pcm_format_t format, size_t samples)
 
 EXPORT_SYMBOL (snd_pcm_format_size)
 
const unsigned charsnd_pcm_format_silence_64 (snd_pcm_format_t format)
 
 EXPORT_SYMBOL (snd_pcm_format_silence_64)
 
int snd_pcm_format_set_silence (snd_pcm_format_t format, void *data, unsigned int samples)
 
 EXPORT_SYMBOL (snd_pcm_format_set_silence)
 
int snd_pcm_limit_hw_rates (struct snd_pcm_runtime *runtime)
 
 EXPORT_SYMBOL (snd_pcm_limit_hw_rates)
 
unsigned int snd_pcm_rate_to_rate_bit (unsigned int rate)
 
 EXPORT_SYMBOL (snd_pcm_rate_to_rate_bit)
 
unsigned int snd_pcm_rate_bit_to_rate (unsigned int rate_bit)
 
 EXPORT_SYMBOL (snd_pcm_rate_bit_to_rate)
 

Macro Definition Documentation

#define INT   __force int

Definition at line 40 of file pcm_misc.c.

#define SND_PCM_FORMAT_UNKNOWN   (-1)

Definition at line 26 of file pcm_misc.c.

Function Documentation

EXPORT_SYMBOL ( snd_pcm_format_signed  )
EXPORT_SYMBOL ( snd_pcm_format_unsigned  )
EXPORT_SYMBOL ( snd_pcm_format_linear  )
EXPORT_SYMBOL ( snd_pcm_format_little_endian  )
EXPORT_SYMBOL ( snd_pcm_format_big_endian  )
EXPORT_SYMBOL ( snd_pcm_format_width  )
EXPORT_SYMBOL ( snd_pcm_format_physical_width  )
EXPORT_SYMBOL ( snd_pcm_format_size  )
EXPORT_SYMBOL ( snd_pcm_format_silence_64  )
EXPORT_SYMBOL ( snd_pcm_format_set_silence  )
EXPORT_SYMBOL ( snd_pcm_limit_hw_rates  )
EXPORT_SYMBOL ( snd_pcm_rate_to_rate_bit  )
EXPORT_SYMBOL ( snd_pcm_rate_bit_to_rate  )
int snd_pcm_format_big_endian ( snd_pcm_format_t  format)

snd_pcm_format_big_endian - Check the PCM format is big-endian : the format to check

Returns 1 if the given PCM format is big-endian, 0 if little-endian, or a negative error code if endian not specified.

Definition at line 289 of file pcm_misc.c.

int snd_pcm_format_linear ( snd_pcm_format_t  format)

snd_pcm_format_linear - Check the PCM format is linear : the format to check

Returns 1 if the given PCM format is linear, 0 if not.

Definition at line 256 of file pcm_misc.c.

int snd_pcm_format_little_endian ( snd_pcm_format_t  format)

snd_pcm_format_little_endian - Check the PCM format is little-endian : the format to check

Returns 1 if the given PCM format is little-endian, 0 if big-endian, or a negative error code if endian not specified.

Definition at line 270 of file pcm_misc.c.

int snd_pcm_format_physical_width ( snd_pcm_format_t  format)

snd_pcm_format_physical_width - return the physical bit-width of the format : the format to check

Returns the physical bit-width of the format, or a negative error code if unknown format.

Definition at line 327 of file pcm_misc.c.

int snd_pcm_format_set_silence ( snd_pcm_format_t  format,
void data,
unsigned int  samples 
)

snd_pcm_format_set_silence - set the silence data on the buffer : the PCM format : the buffer pointer : the number of samples to set silence

Sets the silence data on the buffer for the given samples.

Returns zero if successful, or a negative error code on failure.

Definition at line 384 of file pcm_misc.c.

int snd_pcm_format_signed ( snd_pcm_format_t  format)

snd_pcm_format_signed - Check the PCM format is signed linear : the format to check

Returns 1 if the given PCM format is signed linear, 0 if unsigned linear, and a negative error code for non-linear formats.

Definition at line 219 of file pcm_misc.c.

const unsigned char* snd_pcm_format_silence_64 ( snd_pcm_format_t  format)

snd_pcm_format_silence_64 - return the silent data in 8 bytes array : the format to check

Returns the format pattern to fill or NULL if error.

Definition at line 363 of file pcm_misc.c.

ssize_t snd_pcm_format_size ( snd_pcm_format_t  format,
size_t  samples 
)

snd_pcm_format_size - return the byte size of samples on the given format : the format to check : sampling rate

Returns the byte size of the given samples for the format, or a negative error code if unknown format.

Definition at line 347 of file pcm_misc.c.

int snd_pcm_format_unsigned ( snd_pcm_format_t  format)

snd_pcm_format_unsigned - Check the PCM format is unsigned linear : the format to check

Returns 1 if the given PCM format is unsigned linear, 0 if signed linear, and a negative error code for non-linear formats.

Definition at line 238 of file pcm_misc.c.

int snd_pcm_format_width ( snd_pcm_format_t  format)

snd_pcm_format_width - return the bit-width of the format : the format to check

Returns the bit-width of the format, or a negative error code if unknown format.

Definition at line 308 of file pcm_misc.c.

int snd_pcm_limit_hw_rates ( struct snd_pcm_runtime runtime)

snd_pcm_limit_hw_rates - determine rate_min/rate_max fields : the runtime instance

Determines the rate_min and rate_max fields from the rates bits of the given runtime->hw.

Returns zero if successful.

Definition at line 454 of file pcm_misc.c.

unsigned int snd_pcm_rate_bit_to_rate ( unsigned int  rate_bit)

snd_pcm_rate_bit_to_rate - converts SNDRV_PCM_RATE_xxx bit to sample rate : the rate bit to convert

Returns the sample rate that corresponds to the given SNDRV_PCM_RATE_xxx flag or 0 for an unknown rate bit

Definition at line 499 of file pcm_misc.c.

unsigned int snd_pcm_rate_to_rate_bit ( unsigned int  rate)

snd_pcm_rate_to_rate_bit - converts sample rate to SNDRV_PCM_RATE_xxx bit : the sample rate to convert

Returns the SNDRV_PCM_RATE_xxx flag that corresponds to the given rate, or SNDRV_PCM_RATE_KNOT for an unknown rate.

Definition at line 481 of file pcm_misc.c.