PulseAudio  1.1
format.h File Reference

Go to the source code of this file.

Data Structures

struct  pa_format_info
 Represents the format of data provided in a stream or processed by a sink. More...

Defines

#define PA_FORMAT_INFO_SNPRINT_MAX   256
 Maximum required string length for pa_format_info_snprint().

Typedefs

typedef enum pa_encoding pa_encoding_t
 Represents the type of encoding used in a stream or accepted by a sink.
typedef struct pa_format_info pa_format_info
 Represents the format of data provided in a stream or processed by a sink.

Enumerations

enum  pa_encoding {
  PA_ENCODING_ANY,
  PA_ENCODING_PCM,
  PA_ENCODING_AC3_IEC61937,
  PA_ENCODING_EAC3_IEC61937,
  PA_ENCODING_MPEG_IEC61937,
  PA_ENCODING_DTS_IEC61937,
  PA_ENCODING_MAX,
  PA_ENCODING_INVALID = -1
}
 Represents the type of encoding used in a stream or accepted by a sink. More...

Functions

const char * pa_encoding_to_string (pa_encoding_t e) PA_GCC_CONST
 Returns a printable string representing the given encoding type.
pa_encoding_t pa_encoding_from_string (const char *encoding)
 Converts a string of the form returned by pa_encoding_to_string() back to a pa_encoding_t.
pa_format_infopa_format_info_new (void)
 Allocates a new pa_format_info structure.
pa_format_infopa_format_info_copy (const pa_format_info *src)
 Returns a new pa_format_info struct and representing the same format as src.
void pa_format_info_free (pa_format_info *f)
 Frees a pa_format_info structure.
int pa_format_info_valid (const pa_format_info *f)
 Returns non-zero when the format info structure is valid.
int pa_format_info_is_pcm (const pa_format_info *f)
 Returns non-zero when the format info structure represents a PCM (i.e.
int pa_format_info_is_compatible (pa_format_info *first, pa_format_info *second)
 Returns non-zero if the format represented first is a subset of the format represented by .
char * pa_format_info_snprint (char *s, size_t l, const pa_format_info *f)
 Return a human-readable string representing the given format.
pa_format_infopa_format_info_from_string (const char *str)
 Parse a human-readable string of the form generated by pa_format_info_snprint() into a pa_format_info structure.
void pa_format_info_set_prop_int (pa_format_info *f, const char *key, int value)
 Sets an integer property on the given format info.
void pa_format_info_set_prop_int_array (pa_format_info *f, const char *key, const int *values, int n_values)
 Sets a property with a list of integer values on the given format info.
void pa_format_info_set_prop_int_range (pa_format_info *f, const char *key, int min, int max)
 Sets a property which can have any value in a given integer range on the given format info.
void pa_format_info_set_prop_string (pa_format_info *f, const char *key, const char *value)
 Sets a string property on the given format info.
void pa_format_info_set_prop_string_array (pa_format_info *f, const char *key, const char **values, int n_values)
 Sets a property with a list of string values on the given format info.
void pa_format_info_set_sample_format (pa_format_info *f, pa_sample_format_t sf)
 Convenience method to set the sample format as a property on the given format.
void pa_format_info_set_rate (pa_format_info *f, int rate)
 Convenience method to set the sampling rate as a property on the given format.
void pa_format_info_set_channels (pa_format_info *f, int channels)
 Convenience method to set the number of channels as a property on the given format.
void pa_format_info_set_channel_map (pa_format_info *f, const pa_channel_map *map)
 Convenience method to set the channel map as a property on the given format.

Define Documentation

#define PA_FORMAT_INFO_SNPRINT_MAX   256

Maximum required string length for pa_format_info_snprint().

Please note that this value can change with any release without warning and without being considered API or ABI breakage. You should not use this definition anywhere where it might become part of an ABI.

Since:
1.0

Typedef Documentation

typedef enum pa_encoding pa_encoding_t

Represents the type of encoding used in a stream or accepted by a sink.

Since:
1.0

Represents the format of data provided in a stream or processed by a sink.

Since:
1.0

Enumeration Type Documentation

Represents the type of encoding used in a stream or accepted by a sink.

Since:
1.0
Enumerator:
PA_ENCODING_ANY 

Any encoding format, PCM or compressed.

PA_ENCODING_PCM 

Any PCM format.

PA_ENCODING_AC3_IEC61937 

AC3 data encapsulated in IEC 61937 header/padding.

PA_ENCODING_EAC3_IEC61937 

EAC3 data encapsulated in IEC 61937 header/padding.

PA_ENCODING_MPEG_IEC61937 

MPEG-1 or MPEG-2 (Part 3, not AAC) data encapsulated in IEC 61937 header/padding.

PA_ENCODING_DTS_IEC61937 

DTS data encapsulated in IEC 61937 header/padding.

PA_ENCODING_MAX 

Valid encoding types must be less than this value.

PA_ENCODING_INVALID 

Represents an invalid encoding.


Function Documentation

pa_encoding_t pa_encoding_from_string ( const char *  encoding)

Converts a string of the form returned by pa_encoding_to_string() back to a pa_encoding_t.

Since:
1.0

Returns a printable string representing the given encoding type.

Since:
1.0

Returns a new pa_format_info struct and representing the same format as src.

Frees a pa_format_info structure.

Parse a human-readable string of the form generated by pa_format_info_snprint() into a pa_format_info structure.

Since:
1.0

Returns non-zero if the format represented first is a subset of the format represented by .

This means that second must have all the fields that first does, but the reverse need not be true. This is typically expected to be used to check if a stream's format is compatible with a given sink. In such a case, first would be the sink's format and second would be the stream's.

Returns non-zero when the format info structure represents a PCM (i.e.

uncompressed data) format

Allocates a new pa_format_info structure.

Clients must initialise at least the encoding field themselves.

Convenience method to set the channel map as a property on the given format.

void pa_format_info_set_channels ( pa_format_info f,
int  channels 
)

Convenience method to set the number of channels as a property on the given format.

void pa_format_info_set_prop_int ( pa_format_info f,
const char *  key,
int  value 
)

Sets an integer property on the given format info.

void pa_format_info_set_prop_int_array ( pa_format_info f,
const char *  key,
const int *  values,
int  n_values 
)

Sets a property with a list of integer values on the given format info.

void pa_format_info_set_prop_int_range ( pa_format_info f,
const char *  key,
int  min,
int  max 
)

Sets a property which can have any value in a given integer range on the given format info.

void pa_format_info_set_prop_string ( pa_format_info f,
const char *  key,
const char *  value 
)

Sets a string property on the given format info.

void pa_format_info_set_prop_string_array ( pa_format_info f,
const char *  key,
const char **  values,
int  n_values 
)

Sets a property with a list of string values on the given format info.

void pa_format_info_set_rate ( pa_format_info f,
int  rate 
)

Convenience method to set the sampling rate as a property on the given format.

Convenience method to set the sample format as a property on the given format.

char* pa_format_info_snprint ( char *  s,
size_t  l,
const pa_format_info f 
)

Return a human-readable string representing the given format.

Since:
1.0

Returns non-zero when the format info structure is valid.