MPD
|
#include <stdint.h>
#include <stdbool.h>
#include <assert.h>
Go to the source code of this file.
Data Structures | |
struct | audio_format |
This structure describes the format of a raw PCM stream. More... | |
struct | audio_format_string |
Buffer for audio_format_string(). More... | |
Enumerations | |
enum | sample_format { SAMPLE_FORMAT_UNDEFINED = 0, SAMPLE_FORMAT_S8, SAMPLE_FORMAT_S16, SAMPLE_FORMAT_S24, SAMPLE_FORMAT_S24_P32, SAMPLE_FORMAT_S32 } |
Functions | |
static void | audio_format_clear (struct audio_format *af) |
Clears the audio_format object, i.e. | |
static void | audio_format_init (struct audio_format *af, uint32_t sample_rate, enum sample_format format, uint8_t channels) |
Initializes an audio_format object, i.e. | |
static bool | audio_format_defined (const struct audio_format *af) |
Checks whether the specified audio_format object has a defined value. | |
static bool | audio_format_fully_defined (const struct audio_format *af) |
Checks whether the specified audio_format object is full, i.e. | |
static bool | audio_format_mask_defined (const struct audio_format *af) |
Checks whether the specified audio_format object has at least one defined value. | |
static bool | audio_valid_sample_rate (unsigned sample_rate) |
Checks whether the sample rate is valid. | |
static bool | audio_valid_sample_format (enum sample_format format) |
Checks whether the sample format is valid. | |
static bool | audio_valid_channel_count (unsigned channels) |
Checks whether the number of channels is valid. | |
static bool | audio_format_valid (const struct audio_format *af) |
Returns false if the format is not valid for playback with MPD. | |
static bool | audio_format_mask_valid (const struct audio_format *af) |
Returns false if the format mask is not valid for playback with MPD. | |
static bool | audio_format_equals (const struct audio_format *a, const struct audio_format *b) |
static void | audio_format_mask_apply (struct audio_format *af, const struct audio_format *mask) |
static unsigned | audio_format_sample_size (const struct audio_format *af) |
Returns the size of each (mono) sample in bytes. | |
static unsigned | audio_format_frame_size (const struct audio_format *af) |
Returns the size of each full frame in bytes. | |
static double | audio_format_time_to_size (const struct audio_format *af) |
Returns the floating point factor which converts a time span to a storage size in bytes. | |
const char * | sample_format_to_string (enum sample_format format) |
Renders a sample_format enum into a string, e.g. | |
const char * | audio_format_to_string (const struct audio_format *af, struct audio_format_string *s) |
Renders the audio_format object into a string, e.g. | |
enum sample_format |
Definition at line 27 of file audio_format.h.
|
inlinestatic |
Clears the audio_format object, i.e.
sets all attributes to an undefined (invalid) value.
Definition at line 89 of file audio_format.h.
|
inlinestatic |
Checks whether the specified audio_format object has a defined value.
Definition at line 115 of file audio_format.h.
|
inlinestatic |
Definition at line 210 of file audio_format.h.
|
inlinestatic |
Returns the size of each full frame in bytes.
Definition at line 268 of file audio_format.h.
|
inlinestatic |
Checks whether the specified audio_format object is full, i.e.
all attributes are defined. This is more complete than audio_format_defined(), but slower.
Definition at line 126 of file audio_format.h.
|
inlinestatic |
Initializes an audio_format object, i.e.
sets all attributes to valid values.
Definition at line 101 of file audio_format.h.
|
inlinestatic |
Definition at line 220 of file audio_format.h.
|
inlinestatic |
Checks whether the specified audio_format object has at least one defined value.
Definition at line 137 of file audio_format.h.
|
inlinestatic |
Returns false if the format mask is not valid for playback with MPD.
This function performs some basic validity checks.
Definition at line 201 of file audio_format.h.
|
inlinestatic |
Returns the size of each (mono) sample in bytes.
Definition at line 241 of file audio_format.h.
|
inlinestatic |
Returns the floating point factor which converts a time span to a storage size in bytes.
Definition at line 277 of file audio_format.h.
const char* audio_format_to_string | ( | const struct audio_format * | af, |
struct audio_format_string * | s | ||
) |
Renders the audio_format object into a string, e.g.
for printing it in a log file.
af | the audio_format object |
s | a buffer to print into |
|
inlinestatic |
Returns false if the format is not valid for playback with MPD.
This function performs some basic validity checks.
Definition at line 190 of file audio_format.h.
|
inlinestatic |
Checks whether the number of channels is valid.
Definition at line 181 of file audio_format.h.
|
inlinestatic |
Checks whether the sample format is valid.
bits | the number of significant bits per sample |
Definition at line 160 of file audio_format.h.
|
inlinestatic |
Checks whether the sample rate is valid.
sample_rate | the sample rate in Hz |
Definition at line 149 of file audio_format.h.
const char* sample_format_to_string | ( | enum sample_format | format | ) |
Renders a sample_format enum into a string, e.g.
for printing it in a log file.
format | a sample_format enum value |