PipeWire: pipewire/impl-factory.h Source File

PipeWire 1.0.1

Loading...
Searching...
No Matches
impl-factory.h
Go to the documentation of this file.
1/* PipeWire */
2/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
3/* SPDX-License-Identifier: MIT */
4
5#ifndef PIPEWIRE_IMPL_FACTORY_H
6#define PIPEWIRE_IMPL_FACTORY_H
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
21struct pw_impl_factory;
22
23#include <pipewire/context.h>
24#include <pipewire/impl-client.h>
25#include <pipewire/global.h>
26#include <pipewire/properties.h>
27#include <pipewire/resource.h>
28
30struct pw_impl_factory_events {
31#define PW_VERSION_IMPL_FACTORY_EVENTS 0
32 uint32_t version;
33
35 void (*destroy) (void *data);
37 void (*free) (void *data);
39 void (*initialized) (void *data);
40};
41
42struct pw_impl_factory_implementation {
43#define PW_VERSION_IMPL_FACTORY_IMPLEMENTATION 0
44 uint32_t version;
45
47 void *(*create_object) (void *data,
48 struct pw_resource *resource,
49 const char *type,
50 uint32_t version,
51 struct pw_properties *properties,
52 uint32_t new_id);
53};
54
55struct pw_impl_factory *pw_context_create_factory(struct pw_context *context,
56 const char *name,
57 const char *type,
58 uint32_t version,
59 struct pw_properties *properties,
60 size_t user_data_size);
61
63const struct pw_properties *pw_impl_factory_get_properties(struct pw_impl_factory *factory);
64
66const struct pw_factory_info *pw_impl_factory_get_info(struct pw_impl_factory *factory);
67
69int pw_impl_factory_update_properties(struct pw_impl_factory *factory, const struct spa_dict *dict);
70
71int pw_impl_factory_register(struct pw_impl_factory *factory,
72 struct pw_properties *properties);
73
74void pw_impl_factory_destroy(struct pw_impl_factory *factory);
75
76void *pw_impl_factory_get_user_data(struct pw_impl_factory *factory);
77
79struct pw_global *pw_impl_factory_get_global(struct pw_impl_factory *factory);
80
82void pw_impl_factory_add_listener(struct pw_impl_factory *factory,
83 struct spa_hook *listener,
84 const struct pw_impl_factory_events *events,
85 void *data);
86
87void pw_impl_factory_set_implementation(struct pw_impl_factory *factory,
88 const struct pw_impl_factory_implementation *implementation,
89 void *data);
90
91void *pw_impl_factory_create_object(struct pw_impl_factory *factory,
92 struct pw_resource *resource,
93 const char *type,
94 uint32_t version,
95 struct pw_properties *properties,
96 uint32_t new_id);
97
99struct pw_impl_factory *
100 pw_context_find_factory(struct pw_context *context ,
101 const char *name );
102
107#ifdef __cplusplus
108}
109#endif
110
111#endif /* PIPEWIRE_IMPL_FACTORY_H */
global.h
pipewire/global.h
pw_impl_factory_destroy
void pw_impl_factory_destroy(struct pw_impl_factory *factory)
Definition impl-factory.c:64
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:135
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:218
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:239
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:247
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:20
pw_impl_factory_register
int pw_impl_factory_register(struct pw_impl_factory *factory, struct pw_properties *properties)
Definition impl-factory.c:158
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:230
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:273
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:224
pw_impl_factory_get_user_data
void * pw_impl_factory_get_user_data(struct pw_impl_factory *factory)
Definition impl-factory.c:212
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:129
impl-client.h
pipewire/impl-client.h
properties.h
pipewire/properties.h
resource.h
pipewire/resource.h
context.h
pipewire/context.h
pw_context
pw_factory_info
The factory information.
Definition factory.h:44
pw_global
pw_impl_factory_events
Factory events, listen to them with pw_impl_factory_add_listener.
Definition impl-factory.h:35
pw_impl_factory_events::version
uint32_t version
Definition impl-factory.h:38
pw_impl_factory_events::initialized
void(* initialized)(void *data)
the factory is initialized
Definition impl-factory.h:45
pw_impl_factory_events::destroy
void(* destroy)(void *data)
the factory is destroyed
Definition impl-factory.h:41
pw_impl_factory_events::free
void(* free)(void *data)
the factory is freed
Definition impl-factory.h:43
pw_impl_factory_implementation
Definition impl-factory.h:48
pw_impl_factory_implementation::version
uint32_t version
Definition impl-factory.h:51
pw_impl_factory
pw_properties
Definition properties.h:33
pw_resource
spa_dict
Definition dict.h:39
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:350