PipeWire
0.3.33
|
Data Structures | |
struct | spa_rectangle |
struct | spa_point |
struct | spa_region |
struct | spa_fraction |
struct | spa_dict_item |
struct | spa_dict |
struct | spa_list |
struct | spa_ringbuffer |
A ringbuffer type. More... | |
Macros | |
#define | SPA_ANSI_RESET "\x1B[0m" |
Ansi escape sequences. More... | |
#define | SPA_ANSI_BOLD "\x1B[1m" |
#define | SPA_ANSI_ITALIC "\x1B[3m" |
#define | SPA_ANSI_UNDERLINE "\x1B[4m" |
#define | SPA_ANSI_BLACK "\x1B[0;30m" |
#define | SPA_ANSI_RED "\x1B[0;31m" |
#define | SPA_ANSI_GREEN "\x1B[0;32m" |
#define | SPA_ANSI_YELLOW "\x1B[0;33m" |
#define | SPA_ANSI_BLUE "\x1B[0;34m" |
#define | SPA_ANSI_MAGENTA "\x1B[0;35m" |
#define | SPA_ANSI_CYAN "\x1B[0;36m" |
#define | SPA_ANSI_WHITE "\x1B[0;37m" |
#define | SPA_ANSI_BRIGHT_BLACK "\x1B[90m" |
#define | SPA_ANSI_BRIGHT_RED "\x1B[91m" |
#define | SPA_ANSI_BRIGHT_GREEN "\x1B[92m" |
#define | SPA_ANSI_BRIGHT_YELLOW "\x1B[93m" |
#define | SPA_ANSI_BRIGHT_BLUE "\x1B[94m" |
#define | SPA_ANSI_BRIGHT_MAGENTA "\x1B[95m" |
#define | SPA_ANSI_BRIGHT_CYAN "\x1B[96m" |
#define | SPA_ANSI_BRIGHT_WHITE "\x1B[97m" |
#define | SPA_ANSI_BOLD_BLACK "\x1B[1;30m" |
#define | SPA_ANSI_BOLD_RED "\x1B[1;31m" |
#define | SPA_ANSI_BOLD_GREEN "\x1B[1;32m" |
#define | SPA_ANSI_BOLD_YELLOW "\x1B[1;33m" |
#define | SPA_ANSI_BOLD_BLUE "\x1B[1;34m" |
#define | SPA_ANSI_BOLD_MAGENTA "\x1B[1;35m" |
#define | SPA_ANSI_BOLD_CYAN "\x1B[1;36m" |
#define | SPA_ANSI_BOLD_WHITE "\x1B[1;37m" |
#define | SPA_ANSI_DARK_BLACK "\x1B[2;30m" |
#define | SPA_ANSI_DARK_RED "\x1B[2;31m" |
#define | SPA_ANSI_DARK_GREEN "\x1B[2;32m" |
#define | SPA_ANSI_DARK_YELLOW "\x1B[2;33m" |
#define | SPA_ANSI_DARK_BLUE "\x1B[2;34m" |
#define | SPA_ANSI_DARK_MAGENTA "\x1B[2;35m" |
#define | SPA_ANSI_DARK_CYAN "\x1B[2;36m" |
#define | SPA_ANSI_DARK_WHITE "\x1B[2;37m" |
#define | SPA_ANSI_BG_BLACK "\x1B[0;40m" |
#define | SPA_ANSI_BG_RED "\x1B[0;41m" |
#define | SPA_ANSI_BG_GREEN "\x1B[0;42m" |
#define | SPA_ANSI_BG_YELLOW "\x1B[0;43m" |
#define | SPA_ANSI_BG_BLUE "\x1B[0;44m" |
#define | SPA_ANSI_BG_MAGENTA "\x1B[0;45m" |
#define | SPA_ANSI_BG_CYAN "\x1B[0;46m" |
#define | SPA_ANSI_BG_WHITE "\x1B[0;47m" |
#define | SPA_ANSI_BG_BRIGHT_BLACK "\x1B[100m" |
#define | SPA_ANSI_BG_BRIGHT_RED "\x1B[101m" |
#define | SPA_ANSI_BG_BRIGHT_GREEN "\x1B[102m" |
#define | SPA_ANSI_BG_BRIGHT_YELLOW "\x1B[103m" |
#define | SPA_ANSI_BG_BRIGHT_BLUE "\x1B[104m" |
#define | SPA_ANSI_BG_BRIGHT_MAGENTA "\x1B[105m" |
#define | SPA_ANSI_BG_BRIGHT_CYAN "\x1B[106m" |
#define | SPA_ANSI_BG_BRIGHT_WHITE "\x1B[107m" |
#define | SPA_FALLTHROUGH /* FALLTHROUGH */ |
SPA_FALLTHROUGH is an annotation to suppress compiler warnings about switch cases that fall through without a break or return statement. More... | |
#define | SPA_FLAG_MASK(field, mask, flag) (((field) & (mask)) == (flag)) |
#define | SPA_FLAG_IS_SET(field, flag) SPA_FLAG_MASK(field,flag,flag) |
#define | SPA_FLAG_SET(field, flag) ((field) |= (flag)) |
#define | SPA_FLAG_CLEAR(field, flag) ((field) &= ~(flag)) |
#define | SPA_FLAG_UPDATE(field, flag, val) ((val) ? SPA_FLAG_SET(field,flag) : SPA_FLAG_CLEAR(field,flag)) |
#define | SPA_DIRECTION_REVERSE(d) ((d) ^ 1) |
#define | SPA_RECTANGLE(width, height) (struct spa_rectangle){ width, height } |
#define | SPA_POINT(x, y) (struct spa_point){ x, y } |
#define | SPA_REGION(x, y, width, height) (struct spa_region){ SPA_POINT(x,y), SPA_RECTANGLE(width,height) } |
#define | SPA_FRACTION(num, denom) (struct spa_fraction){ num, denom } |
#define | SPA_N_ELEMENTS(arr) (sizeof(arr) / sizeof((arr)[0])) |
#define | SPA_FOR_EACH_ELEMENT(arr, ptr) for (ptr = arr; (void*)ptr < SPA_PTROFF(arr, sizeof(arr), void); ptr++) |
Array iterator macro. More... | |
#define | SPA_MIN(a, b) |
#define | SPA_MAX(a, b) |
#define | SPA_CLAMP(v, low, high) |
#define | SPA_SWAP(a, b) |
#define | SPA_TYPECHECK(type, x) |
#define | SPA_PTROFF(ptr_, offset_, type_) ((type_*)((uint8_t*)(ptr_) + (int)(offset_))) |
Return the address (buffer + offset) as pointer of type. More... | |
#define | SPA_PTROFF_ALIGN(ptr_, offset_, alignment_, type_) SPA_PTR_ALIGN(SPA_PTROFF(ptr_,offset_,type_),alignment_,type_) |
#define | SPA_MEMBER(b, o, t) SPA_PTROFF(b,o,t) |
Deprecated, use SPA_PTROFF and SPA_PTROFF_ALIGN instead. More... | |
#define | SPA_MEMBER_ALIGN(b, o, a, t) SPA_PTROFF_ALIGN(b,o,a,t) |
#define | SPA_CONTAINER_OF(p, t, m) (t*)((uint8_t*)p - offsetof (t,m)) |
#define | SPA_PTRDIFF(p1, p2) ((uint8_t*)(p1) - (uint8_t*)(p2)) |
#define | SPA_PTR_TO_INT(p) ((int) ((intptr_t) (p))) |
#define | SPA_INT_TO_PTR(u) ((void*) ((intptr_t) (u))) |
#define | SPA_PTR_TO_UINT32(p) ((uint32_t) ((uintptr_t) (p))) |
#define | SPA_UINT32_TO_PTR(u) ((void*) ((uintptr_t) (u))) |
#define | SPA_TIME_INVALID ((int64_t)INT64_MIN) |
#define | SPA_IDX_INVALID ((unsigned int)-1) |
#define | SPA_ID_INVALID ((uint32_t)0xffffffff) |
#define | SPA_NSEC_PER_SEC (1000000000ll) |
#define | SPA_NSEC_PER_MSEC (1000000ll) |
#define | SPA_NSEC_PER_USEC (1000ll) |
#define | SPA_USEC_PER_SEC (1000000ll) |
#define | SPA_USEC_PER_MSEC (1000ll) |
#define | SPA_MSEC_PER_SEC (1000ll) |
#define | SPA_TIMESPEC_TO_NSEC(ts) ((ts)->tv_sec * SPA_NSEC_PER_SEC + (ts)->tv_nsec) |
#define | SPA_TIMESPEC_TO_USEC(ts) ((ts)->tv_sec * SPA_USEC_PER_SEC + (ts)->tv_nsec / SPA_NSEC_PER_USEC) |
#define | SPA_TIMEVAL_TO_NSEC(tv) ((tv)->tv_sec * SPA_NSEC_PER_SEC + (tv)->tv_usec * SPA_NSEC_PER_USEC) |
#define | SPA_TIMEVAL_TO_USEC(tv) ((tv)->tv_sec * SPA_USEC_PER_SEC + (tv)->tv_usec) |
#define | SPA_PRINTF_FUNC(fmt, arg1) |
#define | SPA_ALIGNED(align) |
#define | SPA_DEPRECATED |
#define | SPA_EXPORT |
#define | SPA_SENTINEL |
#define | SPA_UNUSED |
#define | SPA_NORETURN |
#define | SPA_RESTRICT |
#define | SPA_ROUND_DOWN_N(num, align) ((num) & ~((align) - 1)) |
#define | SPA_ROUND_UP_N(num, align) SPA_ROUND_DOWN_N((num) + ((align) - 1),align) |
#define | SPA_PTR_ALIGNMENT(p, align) ((intptr_t)(p) & ((align)-1)) |
#define | SPA_IS_ALIGNED(p, align) (SPA_PTR_ALIGNMENT(p,align) == 0) |
#define | SPA_PTR_ALIGN(p, align, type) (type*)SPA_ROUND_UP_N((intptr_t)(p), (intptr_t)(align)) |
#define | SPA_LIKELY(x) (x) |
#define | SPA_UNLIKELY(x) (x) |
#define | SPA_STRINGIFY_1(...) #__VA_ARGS__ |
#define | SPA_STRINGIFY(...) SPA_STRINGIFY_1(__VA_ARGS__) |
#define | spa_return_if_fail(expr) |
#define | spa_return_val_if_fail(expr, val) |
#define | spa_assert_se(expr) |
#define | spa_nop() do {} while (false) |
#define | spa_assert(expr) spa_assert_se(expr) |
#define | spa_assert_not_reached() |
#define | spa_memzero(x, l) (memset((x), 0, (l))) |
#define | spa_zero(x) (spa_memzero(&(x), sizeof(x))) |
#define | spa_memcpy(d, s, n) memcpy(d,s,n) |
#define | spa_memmove(d, s, n) memmove(d,s,n) |
#define | spa_aprintf(_fmt, ...) |
#define | SPA_DICT_ITEM_INIT(key, value) (struct spa_dict_item) { key, value } |
#define | SPA_DICT_INIT(items, n_items) (struct spa_dict) { 0, n_items, items } |
#define | SPA_DICT_INIT_ARRAY(items) (struct spa_dict) { 0, SPA_N_ELEMENTS(items), items } |
#define | spa_dict_for_each(item, dict) |
#define | SPA_LIST_INIT(list) (struct spa_list){ list, list } |
#define | spa_list_is_empty(l) ((l)->next == (l)) |
#define | spa_list_first(head, type, member) SPA_CONTAINER_OF((head)->next, type, member) |
#define | spa_list_last(head, type, member) SPA_CONTAINER_OF((head)->prev, type, member) |
#define | spa_list_append(list, item) spa_list_insert((list)->prev, item) |
#define | spa_list_prepend(list, item) spa_list_insert(list, item) |
#define | spa_list_is_end(pos, head, member) (&(pos)->member == (head)) |
#define | spa_list_next(pos, member) SPA_CONTAINER_OF((pos)->member.next, __typeof__(*pos), member) |
#define | spa_list_prev(pos, member) SPA_CONTAINER_OF((pos)->member.prev, __typeof__(*pos), member) |
#define | spa_list_consume(pos, head, member) |
#define | spa_list_for_each_next(pos, head, curr, member) |
#define | spa_list_for_each_prev(pos, head, curr, member) |
#define | spa_list_for_each(pos, head, member) spa_list_for_each_next(pos, head, head, member) |
#define | spa_list_for_each_reverse(pos, head, member) spa_list_for_each_prev(pos, head, head, member) |
#define | spa_list_for_each_safe_next(pos, tmp, head, curr, member) |
#define | spa_list_for_each_safe_prev(pos, tmp, head, curr, member) |
#define | spa_list_for_each_safe(pos, tmp, head, member) spa_list_for_each_safe_next(pos, tmp, head, head, member) |
#define | spa_list_for_each_safe_reverse(pos, tmp, head, member) spa_list_for_each_safe_prev(pos, tmp, head, head, member) |
#define | spa_list_cursor_start(cursor, head, member) spa_list_prepend(head, &(cursor).member) |
#define | spa_list_for_each_cursor(pos, cursor, head, member) |
#define | spa_list_cursor_end(cursor, member) spa_list_remove(&(cursor).member) |
#define | SPA_ASYNC_BIT (1 << 30) |
#define | SPA_ASYNC_SEQ_MASK (SPA_ASYNC_BIT - 1) |
#define | SPA_ASYNC_MASK (~SPA_ASYNC_SEQ_MASK) |
#define | SPA_RESULT_IS_OK(res) ((res) >= 0) |
#define | SPA_RESULT_IS_ERROR(res) ((res) < 0) |
#define | SPA_RESULT_IS_ASYNC(res) (((res) & SPA_ASYNC_MASK) == SPA_ASYNC_BIT) |
#define | SPA_RESULT_ASYNC_SEQ(res) ((res) & SPA_ASYNC_SEQ_MASK) |
#define | SPA_RESULT_RETURN_ASYNC(seq) (SPA_ASYNC_BIT | SPA_RESULT_ASYNC_SEQ(seq)) |
#define | spa_strerror(err) |
#define | SPA_RINGBUFFER_INIT() (struct spa_ringbuffer) { 0, 0 } |
Enumerations | |
enum | spa_direction { SPA_DIRECTION_INPUT = 0, SPA_DIRECTION_OUTPUT = 1 } |
Functions | |
int | spa_dict_item_compare (const void *i1, const void *i2) |
void | spa_dict_qsort (struct spa_dict *dict) |
const struct spa_dict_item * | spa_dict_lookup_item (const struct spa_dict *dict, const char *key) |
const char * | spa_dict_lookup (const struct spa_dict *dict, const char *key) |
void | spa_list_init (struct spa_list *list) |
void | spa_list_insert (struct spa_list *list, struct spa_list *elem) |
void | spa_list_insert_list (struct spa_list *list, struct spa_list *other) |
void | spa_list_remove (struct spa_list *elem) |
void | spa_ringbuffer_init (struct spa_ringbuffer *rbuf) |
Initialize a spa_ringbuffer with size. More... | |
void | spa_ringbuffer_set_avail (struct spa_ringbuffer *rbuf, uint32_t size) |
Sets the pointers so that the ringbuffer contains size bytes. More... | |
int32_t | spa_ringbuffer_get_read_index (struct spa_ringbuffer *rbuf, uint32_t *index) |
Get the read index and available bytes for reading. More... | |
void | spa_ringbuffer_read_data (struct spa_ringbuffer *rbuf, const void *buffer, uint32_t size, uint32_t offset, void *data, uint32_t len) |
Read len bytes from rbuf starting offset. More... | |
void | spa_ringbuffer_read_update (struct spa_ringbuffer *rbuf, int32_t index) |
Update the read pointer to index. More... | |
int32_t | spa_ringbuffer_get_write_index (struct spa_ringbuffer *rbuf, uint32_t *index) |
Get the write index and the number of bytes inside the ringbuffer. More... | |
void | spa_ringbuffer_write_data (struct spa_ringbuffer *rbuf, void *buffer, uint32_t size, uint32_t offset, const void *data, uint32_t len) |
Write len bytes to buffer starting offset. More... | |
void | spa_ringbuffer_write_update (struct spa_ringbuffer *rbuf, int32_t index) |
Update the write pointer to index. More... | |
bool | spa_streq (const char *s1, const char *s2) |
bool | spa_strneq (const char *s1, const char *s2, size_t len) |
bool | spa_strstartswith (const char *s, const char *prefix) |
bool | spa_strendswith (const char *s, const char *suffix) |
bool | spa_atoi32 (const char *str, int32_t *val, int base) |
Convert str to an int32_t with the given base and store the result in val. More... | |
bool | spa_atou32 (const char *str, uint32_t *val, int base) |
Convert str to an uint32_t with the given base and store the result in val. More... | |
bool | spa_atoi64 (const char *str, int64_t *val, int base) |
Convert str to an int64_t with the given base and store the result in val. More... | |
bool | spa_atou64 (const char *str, uint64_t *val, int base) |
Convert str to an uint64_t with the given base and store the result in val. More... | |
bool | spa_atob (const char *str) |
Convert str to a boolean. More... | |
int | spa_vscnprintf (char *buffer, size_t size, const char *format, va_list args) |
int | spa_scnprintf (char *buffer, size_t size, const char *format,...) |
bool | spa_atof (const char *str, float *val) |
Convert str to a float and store the result in val. More... | |
bool | spa_atod (const char *str, double *val) |
Convert str to a double and store the result in val. More... | |
#define SPA_ALIGNED | ( | align | ) |
#define SPA_ANSI_BG_BLACK "\x1B[0;40m" |
#define SPA_ANSI_BG_BLUE "\x1B[0;44m" |
#define SPA_ANSI_BG_BRIGHT_BLACK "\x1B[100m" |
#define SPA_ANSI_BG_BRIGHT_BLUE "\x1B[104m" |
#define SPA_ANSI_BG_BRIGHT_CYAN "\x1B[106m" |
#define SPA_ANSI_BG_BRIGHT_GREEN "\x1B[102m" |
#define SPA_ANSI_BG_BRIGHT_MAGENTA "\x1B[105m" |
#define SPA_ANSI_BG_BRIGHT_RED "\x1B[101m" |
#define SPA_ANSI_BG_BRIGHT_WHITE "\x1B[107m" |
#define SPA_ANSI_BG_BRIGHT_YELLOW "\x1B[103m" |
#define SPA_ANSI_BG_CYAN "\x1B[0;46m" |
#define SPA_ANSI_BG_GREEN "\x1B[0;42m" |
#define SPA_ANSI_BG_MAGENTA "\x1B[0;45m" |
#define SPA_ANSI_BG_RED "\x1B[0;41m" |
#define SPA_ANSI_BG_WHITE "\x1B[0;47m" |
#define SPA_ANSI_BG_YELLOW "\x1B[0;43m" |
#define SPA_ANSI_BLACK "\x1B[0;30m" |
#define SPA_ANSI_BLUE "\x1B[0;34m" |
#define SPA_ANSI_BOLD "\x1B[1m" |
#define SPA_ANSI_BOLD_BLACK "\x1B[1;30m" |
#define SPA_ANSI_BOLD_BLUE "\x1B[1;34m" |
#define SPA_ANSI_BOLD_CYAN "\x1B[1;36m" |
#define SPA_ANSI_BOLD_GREEN "\x1B[1;32m" |
#define SPA_ANSI_BOLD_MAGENTA "\x1B[1;35m" |
#define SPA_ANSI_BOLD_RED "\x1B[1;31m" |
#define SPA_ANSI_BOLD_WHITE "\x1B[1;37m" |
#define SPA_ANSI_BOLD_YELLOW "\x1B[1;33m" |
#define SPA_ANSI_BRIGHT_BLACK "\x1B[90m" |
#define SPA_ANSI_BRIGHT_BLUE "\x1B[94m" |
#define SPA_ANSI_BRIGHT_CYAN "\x1B[96m" |
#define SPA_ANSI_BRIGHT_GREEN "\x1B[92m" |
#define SPA_ANSI_BRIGHT_MAGENTA "\x1B[95m" |
#define SPA_ANSI_BRIGHT_RED "\x1B[91m" |
#define SPA_ANSI_BRIGHT_WHITE "\x1B[97m" |
#define SPA_ANSI_BRIGHT_YELLOW "\x1B[93m" |
#define SPA_ANSI_CYAN "\x1B[0;36m" |
#define SPA_ANSI_DARK_BLACK "\x1B[2;30m" |
#define SPA_ANSI_DARK_BLUE "\x1B[2;34m" |
#define SPA_ANSI_DARK_CYAN "\x1B[2;36m" |
#define SPA_ANSI_DARK_GREEN "\x1B[2;32m" |
#define SPA_ANSI_DARK_MAGENTA "\x1B[2;35m" |
#define SPA_ANSI_DARK_RED "\x1B[2;31m" |
#define SPA_ANSI_DARK_WHITE "\x1B[2;37m" |
#define SPA_ANSI_DARK_YELLOW "\x1B[2;33m" |
#define SPA_ANSI_GREEN "\x1B[0;32m" |
#define SPA_ANSI_ITALIC "\x1B[3m" |
#define SPA_ANSI_MAGENTA "\x1B[0;35m" |
#define SPA_ANSI_RED "\x1B[0;31m" |
#define SPA_ANSI_RESET "\x1B[0m" |
Ansi escape sequences.
Note that the color names are approximate only and the actual rendering of the color depends on the terminal.
#define SPA_ANSI_UNDERLINE "\x1B[4m" |
#define SPA_ANSI_WHITE "\x1B[0;37m" |
#define SPA_ANSI_YELLOW "\x1B[0;33m" |
#define spa_aprintf | ( | _fmt, | |
... | |||
) |
#define spa_assert | ( | expr | ) | spa_assert_se(expr) |
#define spa_assert_not_reached | ( | ) |
#define spa_assert_se | ( | expr | ) |
#define SPA_ASYNC_BIT (1 << 30) |
#define SPA_ASYNC_MASK (~SPA_ASYNC_SEQ_MASK) |
#define SPA_ASYNC_SEQ_MASK (SPA_ASYNC_BIT - 1) |
#define SPA_CLAMP | ( | v, | |
low, | |||
high | |||
) |
#define SPA_CONTAINER_OF | ( | p, | |
t, | |||
m | |||
) | (t*)((uint8_t*)p - offsetof (t,m)) |
#define SPA_DEPRECATED |
#define spa_dict_for_each | ( | item, | |
dict | |||
) |
#define SPA_DICT_INIT | ( | items, | |
n_items | |||
) | (struct spa_dict) { 0, n_items, items } |
#define SPA_DICT_INIT_ARRAY | ( | items | ) | (struct spa_dict) { 0, SPA_N_ELEMENTS(items), items } |
#define SPA_DICT_ITEM_INIT | ( | key, | |
value | |||
) | (struct spa_dict_item) { key, value } |
#define SPA_DIRECTION_REVERSE | ( | d | ) | ((d) ^ 1) |
#define SPA_EXPORT |
#define SPA_FALLTHROUGH /* FALLTHROUGH */ |
SPA_FALLTHROUGH is an annotation to suppress compiler warnings about switch cases that fall through without a break or return statement.
SPA_FALLTHROUGH is only needed on cases that have code:
switch (foo) { case 1: // These cases have no code. No fallthrough annotations are needed. case 2: case 3: foo = 4; // This case has code, so a fallthrough annotation is needed: SPA_FALLTHROUGH; default: return foo; }
#define SPA_FLAG_CLEAR | ( | field, | |
flag | |||
) | ((field) &= ~(flag)) |
#define SPA_FLAG_IS_SET | ( | field, | |
flag | |||
) | SPA_FLAG_MASK(field,flag,flag) |
#define SPA_FLAG_MASK | ( | field, | |
mask, | |||
flag | |||
) | (((field) & (mask)) == (flag)) |
#define SPA_FLAG_SET | ( | field, | |
flag | |||
) | ((field) |= (flag)) |
#define SPA_FLAG_UPDATE | ( | field, | |
flag, | |||
val | |||
) | ((val) ? SPA_FLAG_SET(field,flag) : SPA_FLAG_CLEAR(field,flag)) |
#define SPA_FOR_EACH_ELEMENT | ( | arr, | |
ptr | |||
) | for (ptr = arr; (void*)ptr < SPA_PTROFF(arr, sizeof(arr), void); ptr++) |
Array iterator macro.
Usage:
#define SPA_FRACTION | ( | num, | |
denom | |||
) | (struct spa_fraction){ num, denom } |
#define SPA_ID_INVALID ((uint32_t)0xffffffff) |
#define SPA_IDX_INVALID ((unsigned int)-1) |
#define SPA_INT_TO_PTR | ( | u | ) | ((void*) ((intptr_t) (u))) |
#define SPA_IS_ALIGNED | ( | p, | |
align | |||
) | (SPA_PTR_ALIGNMENT(p,align) == 0) |
#define SPA_LIKELY | ( | x | ) | (x) |
#define spa_list_append | ( | list, | |
item | |||
) | spa_list_insert((list)->prev, item) |
#define spa_list_consume | ( | pos, | |
head, | |||
member | |||
) |
#define spa_list_cursor_end | ( | cursor, | |
member | |||
) | spa_list_remove(&(cursor).member) |
#define spa_list_cursor_start | ( | cursor, | |
head, | |||
member | |||
) | spa_list_prepend(head, &(cursor).member) |
#define spa_list_first | ( | head, | |
type, | |||
member | |||
) | SPA_CONTAINER_OF((head)->next, type, member) |
#define spa_list_for_each | ( | pos, | |
head, | |||
member | |||
) | spa_list_for_each_next(pos, head, head, member) |
#define spa_list_for_each_cursor | ( | pos, | |
cursor, | |||
head, | |||
member | |||
) |
#define spa_list_for_each_next | ( | pos, | |
head, | |||
curr, | |||
member | |||
) |
#define spa_list_for_each_prev | ( | pos, | |
head, | |||
curr, | |||
member | |||
) |
#define spa_list_for_each_reverse | ( | pos, | |
head, | |||
member | |||
) | spa_list_for_each_prev(pos, head, head, member) |
#define spa_list_for_each_safe | ( | pos, | |
tmp, | |||
head, | |||
member | |||
) | spa_list_for_each_safe_next(pos, tmp, head, head, member) |
#define spa_list_for_each_safe_next | ( | pos, | |
tmp, | |||
head, | |||
curr, | |||
member | |||
) |
#define spa_list_for_each_safe_prev | ( | pos, | |
tmp, | |||
head, | |||
curr, | |||
member | |||
) |
#define spa_list_for_each_safe_reverse | ( | pos, | |
tmp, | |||
head, | |||
member | |||
) | spa_list_for_each_safe_prev(pos, tmp, head, head, member) |
#define SPA_LIST_INIT | ( | list | ) | (struct spa_list){ list, list } |
#define spa_list_is_empty | ( | l | ) | ((l)->next == (l)) |
#define spa_list_is_end | ( | pos, | |
head, | |||
member | |||
) | (&(pos)->member == (head)) |
#define spa_list_last | ( | head, | |
type, | |||
member | |||
) | SPA_CONTAINER_OF((head)->prev, type, member) |
#define spa_list_next | ( | pos, | |
member | |||
) | SPA_CONTAINER_OF((pos)->member.next, __typeof__(*pos), member) |
#define spa_list_prepend | ( | list, | |
item | |||
) | spa_list_insert(list, item) |
#define spa_list_prev | ( | pos, | |
member | |||
) | SPA_CONTAINER_OF((pos)->member.prev, __typeof__(*pos), member) |
#define SPA_MAX | ( | a, | |
b | |||
) |
#define SPA_MEMBER | ( | b, | |
o, | |||
t | |||
) | SPA_PTROFF(b,o,t) |
Deprecated, use SPA_PTROFF and SPA_PTROFF_ALIGN instead.
#define SPA_MEMBER_ALIGN | ( | b, | |
o, | |||
a, | |||
t | |||
) | SPA_PTROFF_ALIGN(b,o,a,t) |
#define spa_memcpy | ( | d, | |
s, | |||
n | |||
) | memcpy(d,s,n) |
#define spa_memmove | ( | d, | |
s, | |||
n | |||
) | memmove(d,s,n) |
#define spa_memzero | ( | x, | |
l | |||
) | (memset((x), 0, (l))) |
#define SPA_MIN | ( | a, | |
b | |||
) |
#define SPA_MSEC_PER_SEC (1000ll) |
#define SPA_N_ELEMENTS | ( | arr | ) | (sizeof(arr) / sizeof((arr)[0])) |
#define spa_nop | ( | ) | do {} while (false) |
#define SPA_NORETURN |
#define SPA_NSEC_PER_MSEC (1000000ll) |
#define SPA_NSEC_PER_SEC (1000000000ll) |
#define SPA_NSEC_PER_USEC (1000ll) |
#define SPA_POINT | ( | x, | |
y | |||
) | (struct spa_point){ x, y } |
#define SPA_PRINTF_FUNC | ( | fmt, | |
arg1 | |||
) |
#define SPA_PTR_ALIGN | ( | p, | |
align, | |||
type | |||
) | (type*)SPA_ROUND_UP_N((intptr_t)(p), (intptr_t)(align)) |
#define SPA_PTR_ALIGNMENT | ( | p, | |
align | |||
) | ((intptr_t)(p) & ((align)-1)) |
#define SPA_PTR_TO_INT | ( | p | ) | ((int) ((intptr_t) (p))) |
#define SPA_PTR_TO_UINT32 | ( | p | ) | ((uint32_t) ((uintptr_t) (p))) |
#define SPA_PTRDIFF | ( | p1, | |
p2 | |||
) | ((uint8_t*)(p1) - (uint8_t*)(p2)) |
#define SPA_PTROFF | ( | ptr_, | |
offset_, | |||
type_ | |||
) | ((type_*)((uint8_t*)(ptr_) + (int)(offset_))) |
Return the address (buffer + offset) as pointer of type.
#define SPA_PTROFF_ALIGN | ( | ptr_, | |
offset_, | |||
alignment_, | |||
type_ | |||
) | SPA_PTR_ALIGN(SPA_PTROFF(ptr_,offset_,type_),alignment_,type_) |
#define SPA_RECTANGLE | ( | width, | |
height | |||
) | (struct spa_rectangle){ width, height } |
#define SPA_REGION | ( | x, | |
y, | |||
width, | |||
height | |||
) | (struct spa_region){ SPA_POINT(x,y), SPA_RECTANGLE(width,height) } |
#define SPA_RESTRICT |
#define SPA_RESULT_ASYNC_SEQ | ( | res | ) | ((res) & SPA_ASYNC_SEQ_MASK) |
#define SPA_RESULT_IS_ASYNC | ( | res | ) | (((res) & SPA_ASYNC_MASK) == SPA_ASYNC_BIT) |
#define SPA_RESULT_IS_ERROR | ( | res | ) | ((res) < 0) |
#define SPA_RESULT_IS_OK | ( | res | ) | ((res) >= 0) |
#define SPA_RESULT_RETURN_ASYNC | ( | seq | ) | (SPA_ASYNC_BIT | SPA_RESULT_ASYNC_SEQ(seq)) |
#define spa_return_if_fail | ( | expr | ) |
#define spa_return_val_if_fail | ( | expr, | |
val | |||
) |
#define SPA_RINGBUFFER_INIT | ( | ) | (struct spa_ringbuffer) { 0, 0 } |
#define SPA_ROUND_DOWN_N | ( | num, | |
align | |||
) | ((num) & ~((align) - 1)) |
#define SPA_ROUND_UP_N | ( | num, | |
align | |||
) | SPA_ROUND_DOWN_N((num) + ((align) - 1),align) |
#define SPA_SENTINEL |
#define spa_strerror | ( | err | ) |
#define SPA_STRINGIFY | ( | ... | ) | SPA_STRINGIFY_1(__VA_ARGS__) |
#define SPA_STRINGIFY_1 | ( | ... | ) | #__VA_ARGS__ |
#define SPA_SWAP | ( | a, | |
b | |||
) |
#define SPA_TIME_INVALID ((int64_t)INT64_MIN) |
#define SPA_TIMESPEC_TO_NSEC | ( | ts | ) | ((ts)->tv_sec * SPA_NSEC_PER_SEC + (ts)->tv_nsec) |
#define SPA_TIMESPEC_TO_USEC | ( | ts | ) | ((ts)->tv_sec * SPA_USEC_PER_SEC + (ts)->tv_nsec / SPA_NSEC_PER_USEC) |
#define SPA_TIMEVAL_TO_NSEC | ( | tv | ) | ((tv)->tv_sec * SPA_NSEC_PER_SEC + (tv)->tv_usec * SPA_NSEC_PER_USEC) |
#define SPA_TIMEVAL_TO_USEC | ( | tv | ) | ((tv)->tv_sec * SPA_USEC_PER_SEC + (tv)->tv_usec) |
#define SPA_TYPECHECK | ( | type, | |
x | |||
) |
#define SPA_UINT32_TO_PTR | ( | u | ) | ((void*) ((uintptr_t) (u))) |
#define SPA_UNLIKELY | ( | x | ) | (x) |
#define SPA_UNUSED |
#define SPA_USEC_PER_MSEC (1000ll) |
#define SPA_USEC_PER_SEC (1000000ll) |
#define spa_zero | ( | x | ) | (spa_memzero(&(x), sizeof(x))) |
enum spa_direction |
|
inline |
Convert str to a boolean.
Allowed boolean values are "true" and a literal "1", anything else is false.
References spa_streq().
|
inline |
Convert str to a double and store the result in val.
On failure, the value of val is unmodified.
|
inline |
Convert str to a float and store the result in val.
On failure, the value of val is unmodified.
|
inline |
Convert str to an int32_t with the given base and store the result in val.
On failure, the value of val is unmodified.
|
inline |
Convert str to an int64_t with the given base and store the result in val.
On failure, the value of val is unmodified.
|
inline |
Convert str to an uint32_t with the given base and store the result in val.
On failure, the value of val is unmodified.
|
inline |
Convert str to an uint64_t with the given base and store the result in val.
On failure, the value of val is unmodified.
|
inline |
References spa_dict_item::key.
Referenced by spa_dict_lookup_item(), and spa_dict_qsort().
|
inline |
|
inline |
References spa_dict::flags, spa_dict::items, spa_dict_item::key, item::key, spa_dict::n_items, SPA_DICT_FLAG_SORTED, spa_dict_for_each, spa_dict_item_compare(), SPA_DICT_ITEM_INIT, and SPA_FLAG_IS_SET.
Referenced by spa_dict_lookup().
|
inline |
References spa_dict::flags, spa_dict::items, spa_dict::n_items, SPA_DICT_FLAG_SORTED, spa_dict_item_compare(), and SPA_FLAG_SET.
|
inline |
References SPA_LIST_INIT.
Referenced by pipewire__module_init(), pw_context_create_device(), pw_context_create_node(), pw_context_create_port(), pw_control_new(), pw_mempool_alloc(), pw_protocol_new(), sm_access_flatpak_start(), sm_access_portal_start(), sm_bluez5_monitor_start(), sm_libcamera_monitor_start(), sm_policy_ep_start(), sm_suspend_node_start(), sm_v4l2_monitor_start(), spa_graph_init(), spa_graph_node_init(), spa_graph_run(), and spa_hook_list_init().
References spa_list::next, and spa_list::prev.
References spa_list::next, spa_list::prev, and spa_list_is_empty.
Referenced by spa_hook_list_isolate(), and spa_hook_list_join().
|
inline |
References spa_list::next, and spa_list::prev.
Referenced by pw_control_destroy(), pw_control_remove_link(), pw_filter_destroy(), pw_filter_disconnect(), pw_filter_remove_port(), pw_impl_client_destroy(), pw_impl_core_destroy(), pw_impl_factory_destroy(), pw_impl_link_destroy(), pw_impl_metadata_destroy(), pw_impl_module_destroy(), pw_impl_node_set_driver(), pw_memmap_free(), pw_protocol_destroy(), pw_resource_destroy(), pw_stream_destroy(), pw_stream_disconnect(), pw_work_queue_add(), spa_graph_link_remove(), spa_graph_node_remove(), spa_graph_port_remove(), and spa_hook_remove().
|
inline |
Get the read index and available bytes for reading.
rbuf | a spa_ringbuffer |
index | the value of readindex, should be taken modulo the size of the ringbuffer memory to get the offset in the ringbuffer memory |
References spa_ringbuffer::readindex, and spa_ringbuffer::writeindex.
|
inline |
Get the write index and the number of bytes inside the ringbuffer.
rbuf | a spa_ringbuffer |
index | the value of writeindex, should be taken modulo the size of the ringbuffer memory to get the offset in the ringbuffer memory |
References spa_ringbuffer::readindex, and spa_ringbuffer::writeindex.
|
inline |
Initialize a spa_ringbuffer with size.
rbuf | a spa_ringbuffer |
References SPA_RINGBUFFER_INIT.
Referenced by pipewire__module_init().
|
inline |
Read len bytes from rbuf starting offset.
offset must be taken modulo size and len should be smaller than size.
rbuf | a struct spa_ringbuffer |
buffer | memory to read from |
size | the size of buffer |
offset | offset in buffer to read from |
data | destination memory |
len | number of bytes to read |
References spa_memcpy, SPA_MIN, SPA_PTROFF, and SPA_UNLIKELY.
|
inline |
Update the read pointer to index.
rbuf | a spa_ringbuffer |
index | new index |
References spa_ringbuffer::readindex.
|
inline |
Sets the pointers so that the ringbuffer contains size bytes.
rbuf | a spa_ringbuffer |
size | the target size of rbuf |
References spa_ringbuffer::readindex, and spa_ringbuffer::writeindex.
|
inline |
Write len bytes to buffer starting offset.
offset must be taken modulo size and len should be smaller than size.
rbuf | a spa_ringbuffer |
buffer | memory to write to |
size | the size of buffer |
offset | offset in buffer to write to |
data | source memory |
len | number of bytes to write |
References spa_memcpy, SPA_MIN, SPA_PTROFF, and SPA_UNLIKELY.
|
inline |
Update the write pointer to index.
rbuf | a spa_ringbuffer |
index | new index |
References spa_ringbuffer::writeindex.
|
inline |
References spa_vscnprintf().
|
inline |
References spa_assert_se, spa_streq(), and SPA_UNLIKELY.
|
inline |
If both a and b are NULL, the two are considered equal.
References SPA_LIKELY.
Referenced by pipewire__module_init(), pw_check_option(), pw_context_find_export_type(), pw_context_find_factory(), pw_context_find_protocol(), pw_context_parse_conf_section(), pw_global_is_type(), pw_protocol_get_marshal(), sm_media_session_match_rules(), spa_atob(), and spa_strendswith().
|
inline |
If both a and b are NULL, the two are considered equal.
References SPA_LIKELY.
|
inline |
References spa_assert_se, and SPA_UNLIKELY.
|
inline |
References spa_assert_se, SPA_LIKELY, and SPA_UNLIKELY.
Referenced by spa_scnprintf().