Go to the documentation of this file.
25 #ifndef PIPEWIRE_IMPL_FACTORY_H
26 #define PIPEWIRE_IMPL_FACTORY_H
48 #define PW_VERSION_IMPL_FACTORY_EVENTS 0
60 #define PW_VERSION_IMPL_FACTORY_IMPLEMENTATION 0
64 void *(*create_object) (
void *
data,
77 size_t user_data_size);
100 struct spa_hook *listener,
static uint32_t int int res
Definition: core.h:326
#define PW_VERSION_FACTORY
Definition: factory.h:42
#define pw_log_error(...)
SPA_EXPORT void pw_global_destroy(struct pw_global *global)
Destroy a global.
Definition: global.c:377
SPA_EXPORT void * pw_impl_factory_create_object(struct pw_impl_factory *factory, struct pw_resource *resource, const char *type, uint32_t version, struct pw_properties *properties, uint32_t new_id)
Definition: impl-factory.c:261
void(* initialized)(void *data)
the factory is initialized
Definition: impl-factory.h:56
#define PW_KEY_OBJECT_ID
a global object id
Definition: keys.h:60
SPA_EXPORT int pw_impl_factory_update_properties(struct pw_impl_factory *factory, const struct spa_dict *dict)
Update the factory properties.
Definition: impl-factory.c:153
const struct pw_properties * pw_impl_factory_get_properties(struct pw_impl_factory *factory)
Get the factory properties.
Definition: impl-factory.c:147
SPA_EXPORT struct pw_impl_factory * pw_context_create_factory(struct pw_context *context, const char *name, const char *type, uint32_t version, struct pw_properties *properties, size_t user_data_size)
Definition: impl-factory.c:37
Global events, use pw_global_add_listener.
Definition: global.h:65
PipeWire client object class.
Factory events, listen to them with pw_impl_factory_add_listener.
Definition: impl-factory.h:47
struct pw_global * pw_impl_factory_get_global(struct pw_impl_factory *factory)
Get the global of this factory.
Definition: impl-factory.c:238
const struct pw_factory_info * pw_impl_factory_get_info(struct pw_impl_factory *factory)
Get the factory info.
Definition: impl-factory.c:232
#define PW_KEY_MODULE_ID
module properties
Definition: keys.h:207
void pw_global_add_listener(struct pw_global *global, struct spa_hook *listener, const struct pw_global_events *events, void *data)
Add an event listener on the global.
Definition: global.c:262
void(* destroy)(void *data)
the factory is destroyed
Definition: impl-factory.h:52
#define PW_KEY_FACTORY_TYPE_NAME
the name of the type created by a factory
Definition: keys.h:220
A global object visible to remote clients.
uint32_t version
Definition: impl-factory.h:61
struct spa_dict dict
dictionary of key/values
Definition: properties.h:46
void pw_impl_factory_add_listener(struct pw_impl_factory *factory, struct spa_hook *listener, const struct pw_impl_factory_events *events, void *data)
Add an event listener.
Definition: impl-factory.c:244
SPA_EXPORT int pw_properties_setf(struct pw_properties *properties, const char *key, const char *format,...)
Set a property value by format.
Definition: properties.c:433
struct pw_impl_factory * pw_context_create_factory(struct pw_context *context, const char *name, const char *type, uint32_t version, struct pw_properties *properties, size_t user_data_size)
Definition: impl-factory.c:37
void * pw_impl_factory_get_user_data(struct pw_impl_factory *factory)
Definition: impl-factory.c:226
SPA_EXPORT void * pw_impl_factory_get_user_data(struct pw_impl_factory *factory)
Definition: impl-factory.c:226
SPA_EXPORT void pw_impl_factory_set_implementation(struct pw_impl_factory *factory, const struct pw_impl_factory_implementation *implementation, void *data)
Definition: impl-factory.c:253
int pw_global_update_keys(struct pw_global *global, const struct spa_dict *dict, const char *keys[])
Update the global properties, must be done when unregistered.
Definition: global.c:215
#define pw_log_debug(...)
SPA_EXPORT int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:263
SPA_EXPORT struct pw_global * pw_impl_factory_get_global(struct pw_impl_factory *factory)
Get the global of this factory.
Definition: impl-factory.c:238
int pw_global_add_resource(struct pw_global *global, struct pw_resource *resource)
Add a resource to a global.
Definition: global.c:237
void * pw_impl_factory_create_object(struct pw_impl_factory *factory, struct pw_resource *resource, const char *type, uint32_t version, struct pw_properties *properties, uint32_t new_id)
Definition: impl-factory.c:261
SPA_EXPORT void pw_impl_factory_destroy(struct pw_impl_factory *factory)
Definition: impl-factory.c:82
void pw_impl_factory_set_implementation(struct pw_impl_factory *factory, const struct pw_impl_factory_implementation *implementation, void *data)
Definition: impl-factory.c:253
SPA_EXPORT int pw_impl_factory_register(struct pw_impl_factory *factory, struct pw_properties *properties)
Definition: impl-factory.c:176
SPA_EXPORT int pw_properties_set(struct pw_properties *properties, const char *key, const char *value)
Set a property value.
Definition: properties.c:400
SPA_EXPORT const struct pw_factory_info * pw_impl_factory_get_info(struct pw_impl_factory *factory)
Get the factory info.
Definition: impl-factory.c:232
#define PW_VERSION_GLOBAL_EVENTS
Definition: global.h:66
SPA_EXPORT struct pw_impl_factory * pw_context_find_factory(struct pw_context *context, const char *name)
Find a factory by name.
Definition: impl-factory.c:287
void pw_impl_factory_destroy(struct pw_impl_factory *factory)
Definition: impl-factory.c:82
void(* free)(void *data)
the factory is freed
Definition: impl-factory.h:54
The factory information.
Definition: factory.h:46
Definition: impl-factory.h:59
int pw_impl_factory_register(struct pw_impl_factory *factory, struct pw_properties *properties)
Definition: impl-factory.c:176
#define pw_factory_resource_info(r,...)
Definition: impl-factory.c:34
struct pw_resource * pw_resource_new(struct pw_impl_client *client, uint32_t id, uint32_t permissions, const char *type, uint32_t version, size_t user_data_size)
Make a new resource for client.
Definition: resource.c:43
#define PW_KEY_FACTORY_NAME
the name of the factory
Definition: keys.h:218
SPA_EXPORT struct pw_global * pw_global_new(struct pw_context *context, const char *type, uint32_t version, struct pw_properties *properties, pw_global_bind_func_t func, void *object)
Create a new global.
Definition: global.c:67
#define PW_TYPE_INTERFACE_Factory
Definition: factory.h:40
SPA_EXPORT struct pw_properties * pw_properties_new(const char *key,...)
Make a new properties object.
Definition: properties.c:98
#define NAME
Definition: impl-factory.c:32
SPA_EXPORT int pw_global_register(struct pw_global *global)
register a global to the context registry
Definition: global.c:128
SPA_EXPORT const struct pw_properties * pw_impl_factory_get_properties(struct pw_impl_factory *factory)
Get the factory properties.
Definition: impl-factory.c:147
PipeWire factory interface.
#define PW_FACTORY_CHANGE_MASK_ALL
Definition: factory.h:52
#define PW_KEY_FACTORY_TYPE_VERSION
the version of the type created by a factory
Definition: keys.h:221
int pw_impl_factory_update_properties(struct pw_impl_factory *factory, const struct spa_dict *dict)
Update the factory properties.
Definition: impl-factory.c:153
#define PW_FACTORY_CHANGE_MASK_PROPS
Definition: factory.h:51
A collection of key/value pairs.
Definition: properties.h:45
SPA_EXPORT void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:335
uint32_t version
Definition: impl-factory.h:49
SPA_EXPORT void pw_impl_factory_add_listener(struct pw_impl_factory *factory, struct spa_hook *listener, const struct pw_impl_factory_events *events, void *data)
Add an event listener.
Definition: impl-factory.c:244