PipeWire 1.2.1
Loading...
Searching...
No Matches
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_FACTORY_H
6#define PIPEWIRE_FACTORY_H
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12#include <stdarg.h>
13#include <errno.h>
14
15#include <spa/utils/defs.h>
16#include <spa/utils/hook.h>
17
18#include <pipewire/proxy.h>
19
28#define PW_TYPE_INTERFACE_Factory PW_TYPE_INFO_INTERFACE_BASE "Factory"
29
30#define PW_FACTORY_PERM_MASK PW_PERM_R|PW_PERM_M
31
32#define PW_VERSION_FACTORY 3
34
37 uint32_t id;
38 const char *name;
39 const char *type;
41#define PW_FACTORY_CHANGE_MASK_PROPS (1 << 0)
42#define PW_FACTORY_CHANGE_MASK_ALL ((1 << 1)-1)
44 struct spa_dict *props;
45};
46
49 const struct pw_factory_info *update);
52 const struct pw_factory_info *update, bool reset);
53void
55
56
57#define PW_FACTORY_EVENT_INFO 0
58#define PW_FACTORY_EVENT_NUM 1
59
61struct pw_factory_events {
62#define PW_VERSION_FACTORY_EVENTS 0
63 uint32_t version;
69 void (*info) (void *data, const struct pw_factory_info *info);
70};
71
72#define PW_FACTORY_METHOD_ADD_LISTENER 0
73#define PW_FACTORY_METHOD_NUM 1
74
77#define PW_VERSION_FACTORY_METHODS 0
78 uint32_t version;
79
80 int (*add_listener) (void *object,
81 struct spa_hook *listener,
82 const struct pw_factory_events *events,
83 void *data);
84};
85
86#define pw_factory_method(o,method,version,...) \
87({ \
88 int _res = -ENOTSUP; \
89 spa_interface_call_res((struct spa_interface*)o, \
90 struct pw_factory_methods, _res, \
91 method, version, ##__VA_ARGS__); \
92 _res; \
93})
95#define pw_factory_add_listener(c,...) pw_factory_method(c,add_listener,0,__VA_ARGS__)
101#ifdef __cplusplus
102} /* extern "C" */
103#endif
104
105#endif /* PIPEWIRE_FACTORY_H */
spa/utils/defs.h
struct pw_factory_info * pw_factory_info_merge(struct pw_factory_info *info, const struct pw_factory_info *update, bool reset)
Definition introspect.c:316
struct pw_factory_info * pw_factory_info_update(struct pw_factory_info *info, const struct pw_factory_info *update)
Definition introspect.c:345
void pw_factory_info_free(struct pw_factory_info *info)
Definition introspect.c:352
spa/utils/hook.h
pipewire/proxy.h
Factory events.
Definition factory.h:73
uint32_t version
Definition factory.h:76
void(* info)(void *data, const struct pw_factory_info *info)
Notify factory info.
Definition factory.h:82
The factory information.
Definition factory.h:44
uint32_t version
version of the objects
Definition factory.h:48
const char * type
type of the objects created by this factory
Definition factory.h:47
uint32_t id
id of the global
Definition factory.h:45
uint64_t change_mask
bitfield of changed fields since last call
Definition factory.h:53
Factory methods.
Definition factory.h:91
uint32_t version
Definition factory.h:94
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_factory_events *events, void *data)
Definition factory.h:96
Definition dict.h:39
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:350