Go to the documentation of this file.
25 #ifndef SPA_UTILS_RESULT_H
26 #define SPA_UTILS_RESULT_H
40 #define SPA_ASYNC_BIT (1 << 30)
41 #define SPA_ASYNC_SEQ_MASK (SPA_ASYNC_BIT - 1)
42 #define SPA_ASYNC_MASK (~SPA_ASYNC_SEQ_MASK)
44 #define SPA_RESULT_IS_OK(res) ((res) >= 0)
45 #define SPA_RESULT_IS_ERROR(res) ((res) < 0)
46 #define SPA_RESULT_IS_ASYNC(res) (((res) & SPA_ASYNC_MASK) == SPA_ASYNC_BIT)
48 #define SPA_RESULT_ASYNC_SEQ(res) ((res) & SPA_ASYNC_SEQ_MASK)
49 #define SPA_RESULT_RETURN_ASYNC(seq) (SPA_ASYNC_BIT | SPA_RESULT_ASYNC_SEQ(seq))
51 #define spa_strerror(err) \
54 if (SPA_RESULT_IS_ASYNC(err)) \
struct pw_loop * pw_context_get_main_loop(struct pw_context *context)
get the context main loop
Definition: context.c:567
int int const char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:487
Definition: module-filter-chain.c:170
Definition: pod/pod.h:175
#define PW_KEY_MEDIA_ROLE
Role: Movie, Music, Camera, Screen, Communication, Game, Notification, DSP, Production,...
Definition: src/pipewire/keys.h:281
@ SPA_TYPE_Float
Definition: build-12683127/doc/spa/utils/type.h:50
#define NAME
Definition: restore-stream.c:51
#define PW_KEY_APP_ID
a textual id for identifying an application logically.
Definition: src/pipewire/keys.h:109
const char * key
Definition: utils/dict.h:42
#define pw_loop_update_timer(l,...)
Definition: src/pipewire/loop.h:78
#define SPA_POD_OBJECT_FOREACH(obj, iter)
Definition: iter.h:123
int spa_json_get_float(struct spa_json *iter, float *res)
Definition: json.h:245
@ SPA_PROP_mute
mute (Bool)
Definition: props.h:81
int spa_pod_builder_float(struct spa_pod_builder *builder, float val)
Definition: builder.h:265
@ SPA_TYPE_Id
Definition: build-12683127/doc/spa/utils/type.h:47
int spa_json_enter_object(struct spa_json *iter, struct spa_json *sub)
Definition: json.h:212
uint32_t type
Definition: build-12683127/doc/spa/utils/type.h:138
const struct spa_type_info spa_type_audio_channel[]
Definition: param/audio/type-info.h:159
user data to add to an object
Definition: filter.c:75
uint8_t data[MAX_BUFFER]
Definition: module-profiler.c:87
bool spa_streq(const char *s1, const char *s2)
Definition: string.h:50
Definition: pod/pod.h:199
#define spa_list_for_each(pos, head, member)
Definition: list.h:111
#define spa_aprintf(_fmt,...)
Definition: defs.h:323
Definition: src/pipewire/loop.h:47
unsigned int restored
Definition: restore-stream.c:81
struct spa_hook listener
Definition: access-flatpak.c:46
char * key
Definition: restore-stream.c:80
struct pw_properties * props
Definition: module-example-sink.c:81
#define PW_KEY_MEDIA_NAME
media name.
Definition: src/pipewire/keys.h:286
@ SPA_PROP_channelMap
a channelmap array (Array (Id enum spa_audio_channel))
Definition: props.h:89
int spa_pod_builder_push_object(struct spa_pod_builder *builder, struct spa_pod_frame *frame, uint32_t type, uint32_t id)
Definition: builder.h:426
bool spa_strstartswith(const char *s, const char *prefix)
Definition: string.h:71
struct spa_hook listener
Definition: restore-stream.c:83
uint32_t id
Definition: module-echo-cancel.c:139
#define SPA_POD_BUILDER_INIT(buffer, size)
Definition: builder.h:71
@ SPA_PARAM_Props
properties as SPA_TYPE_OBJECT_Props
Definition: param.h:46
Definition: build-12683127/doc/spa/support/loop.h:58
struct spa_dict dict
dictionary of key/values
Definition: properties.h:50
#define pw_loop_destroy_source(l,...)
Definition: src/pipewire/loop.h:80
Definition: utils/dict.h:41
#define SESSION_KEY
Definition: restore-stream.c:52
void * spa_pod_builder_pop(struct spa_pod_builder *builder, struct spa_pod_frame *frame)
Definition: builder.h:175
@ SPA_PROP_volume
a volume (Float), 0.0 silence, 1.0 normal
Definition: props.h:80
const char * name
Definition: build-12683127/doc/spa/utils/type.h:140
#define SAVE_INTERVAL
Definition: restore-stream.c:55
Definition: media-session.c:119
int spa_pod_builder_bool(struct spa_pod_builder *builder, bool val)
Definition: builder.h:233
int spa_pod_get_bool(const struct spa_pod *pod, bool *value)
Definition: iter.h:156
struct timespec now
Definition: default-profile.c:87
#define SPA_N_ELEMENTS(arr)
Definition: defs.h:109
#define SPA_AUDIO_MAX_CHANNELS
Definition: audio/raw.h:43
#define PW_TYPE_INTERFACE_Node
Definition: src/pipewire/node.h:50
struct data data
Definition: stream.c:151
void pw_properties_clear(struct pw_properties *properties)
Clear a properties object.
Definition: properties.c:277
int spa_pod_builder_array(struct spa_pod_builder *builder, uint32_t child_size, uint32_t child_type, uint32_t n_elems, const void *elems)
Definition: builder.h:377
#define spa_dict_for_each(item, dict)
Definition: utils/dict.h:58
#define PW_KEY_NODE_NAME
node name
Definition: src/pipewire/keys.h:138
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:295
#define PW_KEY_APP_NAME
application keys
Definition: src/pipewire/keys.h:108
void spa_json_init(struct spa_json *iter, const char *data, size_t size)
Definition: json.h:59
unsigned int sync
Definition: restore-stream.c:71
char * media_class
Definition: restore-stream.c:79
uint32_t key
key of property, list of valid keys depends on the object type
Definition: pod/pod.h:200
@ SPA_LOG_LEVEL_DEBUG
Definition: build-12683127/doc/spa/support/log.h:51
struct impl * impl
Definition: restore-stream.c:78
#define pw_log_level_enabled(lev)
Check if a loglevel is enabled.
Definition: src/pipewire/log.h:78
#define pw_node_set_param(c,...)
Definition: src/pipewire/node.h:201
int spa_json_get_string(struct spa_json *iter, char *res, int maxlen)
Definition: json.h:358
struct spa_hook metadata_listener
Definition: settings.c:46
const char * value
Definition: utils/dict.h:43
#define spa_strerror(err)
Definition: result.h:51
#define PW_ID_CORE
default ID for the core object after connect
Definition: core.h:66
@ SPA_TYPE_OBJECT_Props
Definition: build-12683127/doc/spa/utils/type.h:89
#define pw_loop_add_timer(l,...)
Definition: src/pipewire/loop.h:77
#define pw_log_debug(...)
Definition: src/pipewire/log.h:89
int spa_json_next(struct spa_json *iter, const char **value)
Get the next token.
Definition: json.h:72
int spa_pod_get_float(const struct spa_pod *pod, float *value)
Definition: iter.h:208
int spa_pod_builder_prop(struct spa_pod_builder *builder, uint32_t key, uint32_t flags)
Definition: builder.h:441
@ SPA_AUDIO_CHANNEL_UNKNOWN
unspecified
Definition: audio/raw.h:169
struct pw_context * context
Definition: settings.c:43
#define PW_KEY_MEDIA_CLASS
class Ex: "Video/Source"
Definition: src/pipewire/keys.h:285
int pw_properties_set(struct pw_properties *properties, const char *key, const char *value)
Set a property value.
Definition: properties.c:435
struct sm_media_session * session
Definition: access-flatpak.c:45
uint32_t spa_pod_copy_array(const struct spa_pod *pod, uint32_t type, void *values, uint32_t max_values)
Definition: iter.h:344
const char * spa_debug_type_short_name(const char *name)
Definition: types.h:60
@ SPA_PROP_channelVolumes
a volume array, one volume per channel (Array of Float)
Definition: props.h:85
int spa_json_enter_array(struct spa_json *iter, struct spa_json *sub)
Definition: json.h:222
void spa_hook_remove(struct spa_hook *hook)
Remove a hook.
Definition: hook.h:336
struct spa_source * idle_timeout
Definition: default-nodes.c:61
#define pw_log_info(...)
Definition: src/pipewire/log.h:88
struct sm_node * obj
Definition: restore-stream.c:75
int sm_restore_stream_start(struct sm_media_session *session)
Definition: restore-stream.c:531
int spa_debug_pod(int indent, const struct spa_type_info *info, const struct spa_pod *pod)
Definition: debug/pod.h:200
struct spa_pod value
Definition: pod/pod.h:212
int spa_json_get_bool(struct spa_json *iter, bool *res)
Definition: json.h:299
struct pw_properties * pw_properties_new(const char *key,...) 1
Make a new properties object.
Definition: properties.c:98
struct pw_metadata * metadata
Definition: restore-stream.c:66
#define PREFIX
Definition: restore-stream.c:53
struct pw_impl_metadata * metadata
Definition: settings.c:44
uint32_t id
Definition: restore-stream.c:77
Definition: properties.h:49
void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:364
#define pw_log_error(...)
Definition: src/pipewire/log.h:86