PipeWire  0.1.5.1
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 #define PW_VERSION_FACTORY_IMPLEMENTATION 0
46  uint32_t version;
47 
49  void *(*create_object) (void *data,
50  struct pw_resource *resource,
51  uint32_t type,
52  uint32_t version,
53  struct pw_properties *properties,
54  uint32_t new_id);
55 };
56 
57 struct pw_factory *pw_factory_new(struct pw_core *core,
58  const char *name,
59  uint32_t type,
60  uint32_t version,
61  struct pw_properties *properties,
62  size_t user_data_size);
63 
64 void pw_factory_register(struct pw_factory *factory,
65  struct pw_client *owner,
66  struct pw_global *parent);
67 
68 void pw_factory_destroy(struct pw_factory *factory);
69 
70 void *pw_factory_get_user_data(struct pw_factory *factory);
71 
73 struct pw_global *pw_factory_get_global(struct pw_factory *factory);
74 
75 void pw_factory_set_implementation(struct pw_factory *factory,
76  const struct pw_factory_implementation *implementation,
77  void *data);
78 
79 void *pw_factory_create_object(struct pw_factory *factory,
80  struct pw_resource *resource,
81  uint32_t type,
82  uint32_t version,
83  struct pw_properties *properties,
84  uint32_t new_id);
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 
90 #endif /* __PIPEWIRE_FACTORY_H__ */
void * pw_factory_get_user_data(struct pw_factory *factory)
Definition: factory.c:125
A collection of key/value pairs.
Definition: properties.h:38
void pw_factory_destroy(struct pw_factory *factory)
Definition: factory.c:55
void pw_factory_register(struct pw_factory *factory, struct pw_client *owner, struct pw_global *parent)
Definition: factory.c:115
uint32_t version
Definition: factory.h:46
the core PipeWire 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:143
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:28
void pw_factory_set_implementation(struct pw_factory *factory, const struct pw_factory_implementation *implementation, void *data)
Definition: factory.c:135
PipeWire factory interface.
PipeWire client object class.
Client owned objects.
struct pw_global * pw_factory_get_global(struct pw_factory *factory)
Get the global of this factory.
Definition: factory.c:130
A global object visible to remote clients.
Definition: factory.h:44