Go to the documentation of this file.
25 #ifndef PIPEWIRE_IMPL_FACTORY_H
26 #define PIPEWIRE_IMPL_FACTORY_H
41 struct pw_impl_factory;
51 #define PW_VERSION_IMPL_FACTORY_EVENTS 0
63 #define PW_VERSION_IMPL_FACTORY_IMPLEMENTATION 0
67 void *(*create_object) (
void *
data,
68 struct pw_resource *resource,
80 size_t user_data_size);
112 struct pw_resource *resource,
119 struct pw_impl_factory *
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:38
#define PW_VERSION_FACTORY
Definition: factory.h:42
Definition: module-filter-chain.c:176
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_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:298
#define PW_KEY_OBJECT_ID
a global object id
Definition: src/pipewire/keys.h:66
int pw_global_register(struct pw_global *global)
Register a global object to the context registry.
Definition: global.c:125
struct pw_global * pw_impl_factory_get_global(struct pw_impl_factory *factory)
Get the global of this factory.
Definition: impl-factory.c:238
#define PW_KEY_MODULE_ID
module properties
Definition: src/pipewire/keys.h:249
void(* initialized)(void *data)
the factory is initialized
Definition: impl-factory.h:59
user data to add to an object
Definition: filter.c:75
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 object.
Definition: global.c:66
int pw_global_add_resource(struct pw_global *global, struct pw_resource *resource)
Add a resource to a global.
Definition: global.c:230
bool spa_streq(const char *s1, const char *s2)
Definition: string.h:50
#define spa_list_for_each(pos, head, member)
Definition: list.h:111
void * pw_impl_factory_get_user_data(struct pw_impl_factory *factory)
Definition: impl-factory.c:226
#define SPA_EXPORT
Definition: defs.h:208
Global events, use pw_global_add_listener.
Definition: global.h:68
Factory events, listen to them with pw_impl_factory_add_listener.
Definition: impl-factory.h:50
void spa_hook_list_append(struct spa_hook_list *list, struct spa_hook *hook, const void *funcs, void *data)
Append a hook.
Definition: hook.h:316
void(* destroy)(void *data)
the factory is destroyed
Definition: impl-factory.h:55
#define SPA_PTROFF(ptr_, offset_, type_)
Return the address (buffer + offset) as pointer of type.
Definition: defs.h:159
uint32_t version
Definition: impl-factory.h:64
struct spa_dict dict
dictionary of key/values
Definition: properties.h:50
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:255
void spa_list_remove(struct spa_list *elem)
Definition: list.h:69
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
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:295
int pw_impl_factory_register(struct pw_impl_factory *factory, struct pw_properties *properties)
Definition: impl-factory.c:176
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
Definition: utils/dict.h:48
#define spa_callbacks_call_res(callbacks, type, res, method, vers,...)
Invoke method named method in the callbacks.
Definition: hook.h:185
int pw_global_update_keys(struct pw_global *global, const struct spa_dict *dict, const char *const keys[])
Update the global properties, must be done when unregistered.
Definition: global.c:209
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_log_debug(...)
Definition: src/pipewire/log.h:89
Definition: module-protocol-native.c:103
#define PW_KEY_FACTORY_TYPE_VERSION
the version of the type created by a factory
Definition: src/pipewire/keys.h:263
void pw_impl_factory_destroy(struct pw_impl_factory *factory)
Definition: impl-factory.c:82
void pw_global_destroy(struct pw_global *global)
Destroy a global.
Definition: global.c:369
#define PW_KEY_FACTORY_TYPE_NAME
the name of the type created by a factory
Definition: src/pipewire/keys.h:262
#define PW_VERSION_GLOBAL_EVENTS
Definition: global.h:69
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
int pw_properties_set(struct pw_properties *properties, const char *key, const char *value)
Set a property value.
Definition: properties.c:435
void(* free)(void *data)
the factory is freed
Definition: impl-factory.h:57
The factory information.
Definition: factory.h:46
Definition: impl-factory.h:62
#define PW_KEY_FACTORY_NAME
the name of the factory
Definition: src/pipewire/keys.h:260
#define pw_factory_resource_info(r,...)
Definition: impl-factory.c:35
const struct pw_factory_info * pw_impl_factory_get_info(struct pw_impl_factory *factory)
Get the factory info.
Definition: impl-factory.c:232
const struct pw_properties * pw_impl_factory_get_properties(struct pw_impl_factory *factory)
Get the factory properties.
Definition: impl-factory.c:147
void spa_hook_remove(struct spa_hook *hook)
Remove a hook.
Definition: hook.h:336
#define PW_TYPE_INTERFACE_Factory
Definition: factory.h:40
void spa_hook_list_init(struct spa_hook_list *list)
Initialize a hook list to the empty list.
Definition: hook.h:305
#define NAME
Definition: impl-factory.c:33
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
#define PW_FACTORY_CHANGE_MASK_ALL
Definition: factory.h:52
struct pw_properties * pw_properties_new(const char *key,...) 1
Make a new properties object.
Definition: properties.c:98
#define SPA_CALLBACKS_INIT(_funcs, _data)
Initialize the set of functions funcs as a spa_callbacks, together with _data.
Definition: hook.h:142
int pw_properties_setf(struct pw_properties *properties, const char *key, const char *format,...) 1(3
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
Definition: properties.h:49
void spa_hook_list_clean(struct spa_hook_list *list)
Remove all hooks from the list.
Definition: hook.h:344
void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:364
uint32_t version
Definition: impl-factory.h:52
#define pw_log_error(...)
Definition: src/pipewire/log.h:86
#define spa_list_append(list, item)
Definition: list.h:81