Loading...
Searching...
No Matches
factory.h
Go to the documentation of this file.
/* PipeWire */
/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
/* SPDX-License-Identifier: MIT */
#ifndef PIPEWIRE_FACTORY_H
#define PIPEWIRE_FACTORY_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdarg.h>
#include <errno.h>
#include <spa/utils/defs.h>
#include <spa/utils/hook.h>
#include <pipewire/proxy.h>
#define PW_TYPE_INTERFACE_Factory PW_TYPE_INFO_INTERFACE_BASE "Factory"
#define PW_FACTORY_PERM_MASK PW_PERM_R|PW_PERM_M
#define PW_VERSION_FACTORY 3
struct pw_factory;
struct pw_factory_info {
uint32_t id;
const char *name;
const char *type;
uint32_t version;
#define PW_FACTORY_CHANGE_MASK_PROPS (1 << 0)
#define PW_FACTORY_CHANGE_MASK_ALL ((1 << 1)-1)
uint64_t change_mask;
struct spa_dict *props;
};
struct pw_factory_info *
pw_factory_info_update(struct pw_factory_info *info,
const struct pw_factory_info *update);
struct pw_factory_info *
pw_factory_info_merge(struct pw_factory_info *info,
const struct pw_factory_info *update, bool reset);
void
pw_factory_info_free(struct pw_factory_info *info);
#define PW_FACTORY_EVENT_INFO 0
#define PW_FACTORY_EVENT_NUM 1
struct pw_factory_events {
#define PW_VERSION_FACTORY_EVENTS 0
uint32_t version;
void (*info) (void *data, const struct pw_factory_info *info);
};
#define PW_FACTORY_METHOD_ADD_LISTENER 0
#define PW_FACTORY_METHOD_NUM 1
struct pw_factory_methods {
#define PW_VERSION_FACTORY_METHODS 0
uint32_t version;
int (*add_listener) (void *object,
struct spa_hook *listener,
const struct pw_factory_events *events,
void *data);
};
#define pw_factory_method(o,method,version,...) \
({ \
int _res = -ENOTSUP; \
spa_interface_call_res((struct spa_interface*)o, \
struct pw_factory_methods, _res, \
method, version, ##__VA_ARGS__); \
_res; \
})
#define pw_factory_add_listener(c,...) pw_factory_method(c,add_listener,0,__VA_ARGS__)
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* PIPEWIRE_FACTORY_H */
defs.h
spa/utils/defs.h
pw_factory_info_merge
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
pw_factory_info_update
struct pw_factory_info * pw_factory_info_update(struct pw_factory_info *info, const struct pw_factory_info *update)
Definition introspect.c:345
pw_factory_info_free
void pw_factory_info_free(struct pw_factory_info *info)
Definition introspect.c:352
hook.h
spa/utils/hook.h
proxy.h
pipewire/proxy.h
pw_factory_events
Factory events.
Definition factory.h:73
pw_factory_events::version
uint32_t version
Definition factory.h:76
pw_factory_events::info
void(* info)(void *data, const struct pw_factory_info *info)
Notify factory info.
Definition factory.h:82
pw_factory_info
The factory information.
Definition factory.h:44
pw_factory_info::version
uint32_t version
version of the objects
Definition factory.h:48
pw_factory_info::type
const char * type
type of the objects created by this factory
Definition factory.h:47
pw_factory_info::id
uint32_t id
id of the global
Definition factory.h:45
pw_factory_info::change_mask
uint64_t change_mask
bitfield of changed fields since last call
Definition factory.h:53
pw_factory_methods
Factory methods.
Definition factory.h:91
pw_factory_methods::version
uint32_t version
Definition factory.h:94
pw_factory_methods::add_listener
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_factory_events *events, void *data)
Definition factory.h:96
pw_factory
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