PipeWire: pipewire/impl-factory.h Source File

PipeWire 0.3.51

impl-factory.h
Go to the documentation of this file.
1/* PipeWire
2 *
3 * Copyright © 2018 Wim Taymans
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef PIPEWIRE_IMPL_FACTORY_H
26#define PIPEWIRE_IMPL_FACTORY_H
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
41struct pw_impl_factory;
42
43#include <pipewire/context.h>
44#include <pipewire/impl-client.h>
45#include <pipewire/global.h>
46#include <pipewire/properties.h>
47#include <pipewire/resource.h>
48
50struct pw_impl_factory_events {
51#define PW_VERSION_IMPL_FACTORY_EVENTS 0
52 uint32_t version;
53
55 void (*destroy) (void *data);
57 void (*free) (void *data);
59 void (*initialized) (void *data);
60};
61
62struct pw_impl_factory_implementation {
63#define PW_VERSION_IMPL_FACTORY_IMPLEMENTATION 0
64 uint32_t version;
65
67 void *(*create_object) (void *data,
68 struct pw_resource *resource,
69 const char *type,
70 uint32_t version,
71 struct pw_properties *properties,
72 uint32_t new_id);
73};
74
75struct pw_impl_factory *pw_context_create_factory(struct pw_context *context,
76 const char *name,
77 const char *type,
78 uint32_t version,
79 struct pw_properties *properties,
80 size_t user_data_size);
81
83const struct pw_properties *pw_impl_factory_get_properties(struct pw_impl_factory *factory);
84
86const struct pw_factory_info *pw_impl_factory_get_info(struct pw_impl_factory *factory);
87
89int pw_impl_factory_update_properties(struct pw_impl_factory *factory, const struct spa_dict *dict);
90
91int pw_impl_factory_register(struct pw_impl_factory *factory,
92 struct pw_properties *properties);
93
94void pw_impl_factory_destroy(struct pw_impl_factory *factory);
95
96void *pw_impl_factory_get_user_data(struct pw_impl_factory *factory);
97
99struct pw_global *pw_impl_factory_get_global(struct pw_impl_factory *factory);
100
102void pw_impl_factory_add_listener(struct pw_impl_factory *factory,
103 struct spa_hook *listener,
104 const struct pw_impl_factory_events *events,
105 void *data);
106
107void pw_impl_factory_set_implementation(struct pw_impl_factory *factory,
108 const struct pw_impl_factory_implementation *implementation,
109 void *data);
110
111void *pw_impl_factory_create_object(struct pw_impl_factory *factory,
112 struct pw_resource *resource,
113 const char *type,
114 uint32_t version,
115 struct pw_properties *properties,
116 uint32_t new_id);
117
119struct pw_impl_factory *
120 pw_context_find_factory(struct pw_context *context ,
121 const char *name );
122
127#ifdef __cplusplus
128}
129#endif
130
131#endif /* PIPEWIRE_IMPL_FACTORY_H */
context.h
pipewire/context.h
global.h
pipewire/global.h
pw_impl_factory_destroy
void pw_impl_factory_destroy(struct pw_impl_factory *factory)
Definition: impl-factory.c:83
pw_impl_factory_update_properties
int pw_impl_factory_update_properties(struct pw_impl_factory *factory, const struct spa_dict *dict)
Update the factory properties.
Definition: impl-factory.c:154
pw_impl_factory_get_info
const struct pw_factory_info * pw_impl_factory_get_info(struct pw_impl_factory *factory)
Get the factory info.
Definition: impl-factory.c:236
pw_impl_factory_set_implementation
void pw_impl_factory_set_implementation(struct pw_impl_factory *factory, const struct pw_impl_factory_implementation *implementation, void *data)
Definition: impl-factory.c:257
pw_impl_factory_create_object
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:265
pw_context_create_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:39
pw_impl_factory_register
int pw_impl_factory_register(struct pw_impl_factory *factory, struct pw_properties *properties)
Definition: impl-factory.c:177
pw_impl_factory_add_listener
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:248
pw_context_find_factory
struct pw_impl_factory * pw_context_find_factory(struct pw_context *context, const char *name)
Find a factory by name.
Definition: impl-factory.c:291
pw_impl_factory_get_global
struct pw_global * pw_impl_factory_get_global(struct pw_impl_factory *factory)
Get the global of this factory.
Definition: impl-factory.c:242
pw_impl_factory_get_user_data
void * pw_impl_factory_get_user_data(struct pw_impl_factory *factory)
Definition: impl-factory.c:230
pw_impl_factory_get_properties
const struct pw_properties * pw_impl_factory_get_properties(struct pw_impl_factory *factory)
Get the factory properties.
Definition: impl-factory.c:148
impl-client.h
pipewire/impl-client.h
properties.h
pipewire/properties.h
resource.h
pipewire/resource.h
pw_context
pw_factory_info
The factory information.
Definition: factory.h:61
pw_global
Definition: context.h:67
pw_impl_factory_events
Factory events, listen to them with pw_impl_factory_add_listener.
Definition: impl-factory.h:55
pw_impl_factory_events::version
uint32_t version
Definition: impl-factory.h:58
pw_impl_factory_events::initialized
void(* initialized)(void *data)
the factory is initialized
Definition: impl-factory.h:65
pw_impl_factory_events::destroy
void(* destroy)(void *data)
the factory is destroyed
Definition: impl-factory.h:61
pw_impl_factory_events::free
void(* free)(void *data)
the factory is freed
Definition: impl-factory.h:63
pw_impl_factory_implementation
Definition: impl-factory.h:68
pw_impl_factory_implementation::version
uint32_t version
Definition: impl-factory.h:71
pw_impl_factory
pw_properties
Definition: properties.h:53
pw_resource
Definition: impl.h:49
spa_dict
Definition: dict.h:59
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:351