PipeWire: factory.h Source File

PipeWire 0.2.5

factory.h
Go to the documentation of this file.
1 /* PipeWire
2 * Copyright (C) 2016 Axis Communications AB
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20 #ifndef __PIPEWIRE_FACTORY_H__
21 #define __PIPEWIRE_FACTORY_H__
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #define PW_TYPE_INTERFACE__Factory PW_TYPE_INTERFACE_BASE "Factory"
28 #define PW_TYPE_FACTORY_BASE PW_TYPE_INTERFACE__Factory ":"
29
36 struct pw_factory;
37
38 #include <pipewire/core.h>
39 #include <pipewire/client.h>
40 #include <pipewire/global.h>
41 #include <pipewire/properties.h>
42 #include <pipewire/resource.h>
43
45 struct pw_factory_events {
46 #define PW_VERSION_FACRORY_EVENTS 0
47 uint32_t version;
48
50 void (*destroy) (void *data);
51 };
52
53 struct pw_factory_implementation {
54 #define PW_VERSION_FACTORY_IMPLEMENTATION 0
55 uint32_t version;
56
58 void *(*create_object) (void *data,
59 struct pw_resource *resource,
60 uint32_t type,
61 uint32_t version,
62 struct pw_properties *properties,
63 uint32_t new_id);
64 };
65
66 struct pw_factory *pw_factory_new(struct pw_core *core,
67 const char *name,
68 uint32_t type,
69 uint32_t version,
70 struct pw_properties *properties,
71 size_t user_data_size);
72
73 int pw_factory_register(struct pw_factory *factory,
74 struct pw_client *owner,
75 struct pw_global *parent,
76 struct pw_properties *properties);
77
78 void pw_factory_destroy(struct pw_factory *factory);
79
80 void *pw_factory_get_user_data(struct pw_factory *factory);
81
83 struct pw_global *pw_factory_get_global(struct pw_factory *factory);
84
86 void pw_factory_add_listener(struct pw_factory *factory,
87 struct spa_hook *listener,
88 const struct pw_factory_events *events,
89 void *data);
90
91 void pw_factory_set_implementation(struct pw_factory *factory,
92 const struct pw_factory_implementation *implementation,
93 void *data);
94
95 void *pw_factory_create_object(struct pw_factory *factory,
96 struct pw_resource *resource,
97 uint32_t type,
98 uint32_t version,
99 struct pw_properties *properties,
100 uint32_t new_id);
101
102 #ifdef __cplusplus
103 }
104 #endif
105
106 #endif /* __PIPEWIRE_FACTORY_H__ */
pw_factory_get_user_data
void * pw_factory_get_user_data(struct pw_factory *factory)
Definition: factory.c:170
pw_properties
A collection of key/value pairs.
Definition: properties.h:38
pw_factory_destroy
void pw_factory_destroy(struct pw_factory *factory)
Definition: factory.c:58
pw_factory_implementation::version
uint32_t version
Definition: factory.h:55
core.h
pw_core
the core PipeWire object
pw_factory_create_object
void * pw_factory_create_object(struct pw_factory *factory, struct pw_resource *resource, uint32_t type, uint32_t version, struct pw_properties *properties, uint32_t new_id)
Definition: factory.c:196
global.h
pw_factory_new
struct pw_factory * pw_factory_new(struct pw_core *core, const char *name, uint32_t type, uint32_t version, struct pw_properties *properties, size_t user_data_size)
Definition: factory.c:30
pw_factory_set_implementation
void pw_factory_set_implementation(struct pw_factory *factory, const struct pw_factory_implementation *implementation, void *data)
Definition: factory.c:188
pw_factory
PipeWire factory interface.
pw_factory_events::version
uint32_t version
Definition: factory.h:47
resource.h
pw_client
PipeWire client object class.
pw_resource
Client owned objects.
pw_factory_events::destroy
void(* destroy)(void *data)
the factory is destroyed
Definition: factory.h:50
pw_factory_register
int pw_factory_register(struct pw_factory *factory, struct pw_client *owner, struct pw_global *parent, struct pw_properties *properties)
Definition: factory.c:135
properties.h
pw_factory_get_global
struct pw_global * pw_factory_get_global(struct pw_factory *factory)
Get the global of this factory.
Definition: factory.c:175
pw_global
A global object visible to remote clients.
pw_factory_add_listener
void pw_factory_add_listener(struct pw_factory *factory, struct spa_hook *listener, const struct pw_factory_events *events, void *data)
Add an event listener.
Definition: factory.c:180
client.h
pw_factory_events
Factory events, listen to them with pw_factory_add_listener.
Definition: factory.h:45
pw_factory_implementation
Definition: factory.h:53