PipeWire: metadata.h Source File

PipeWire 0.3.71

Loading...
Searching...
No Matches
metadata.h
Go to the documentation of this file.
1/* PipeWire */
2/* SPDX-FileCopyrightText: Copyright © 2019 Wim Taymans */
3/* SPDX-License-Identifier: MIT */
4
5#ifndef PIPEWIRE_EXT_METADATA_H
6#define PIPEWIRE_EXT_METADATA_H
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12#include <spa/utils/defs.h>
13
22#define PW_TYPE_INTERFACE_Metadata PW_TYPE_INFO_INTERFACE_BASE "Metadata"
23
24#define PW_VERSION_METADATA 3
25struct pw_metadata;
26
27#define PW_EXTENSION_MODULE_METADATA PIPEWIRE_MODULE_PREFIX "module-metadata"
28
29#define PW_METADATA_EVENT_PROPERTY 0
30#define PW_METADATA_EVENT_NUM 1
31
33struct pw_metadata_events {
34#define PW_VERSION_METADATA_EVENTS 0
35 uint32_t version;
36
37 int (*property) (void *data,
38 uint32_t subject,
39 const char *key,
40 const char *type,
41 const char *value);
42};
43
44#define PW_METADATA_METHOD_ADD_LISTENER 0
45#define PW_METADATA_METHOD_SET_PROPERTY 1
46#define PW_METADATA_METHOD_CLEAR 2
47#define PW_METADATA_METHOD_NUM 3
48
50struct pw_metadata_methods {
51#define PW_VERSION_METADATA_METHODS 0
52 uint32_t version;
53
54 int (*add_listener) (void *object,
55 struct spa_hook *listener,
56 const struct pw_metadata_events *events,
57 void *data);
58
59 int (*set_property) (void *object,
60 uint32_t subject,
61 const char *key,
62 const char *type,
63 const char *value);
64
65 int (*clear) (void *object);
66};
67
68
69#define pw_metadata_method(o,method,version,...) \
70({ \
71 int _res = -ENOTSUP; \
72 spa_interface_call_res((struct spa_interface*)o, \
73 struct pw_metadata_methods, _res, \
74 method, version, ##__VA_ARGS__); \
75 _res; \
76})
77
78#define pw_metadata_add_listener(c,...) pw_metadata_method(c,add_listener,0,__VA_ARGS__)
79#define pw_metadata_set_property(c,...) pw_metadata_method(c,set_property,0,__VA_ARGS__)
80#define pw_metadata_clear(c) pw_metadata_method(c,clear,0)
81
82#define PW_KEY_METADATA_NAME "metadata.name"
83#define PW_KEY_METADATA_VALUES "metadata.values"
84
89#ifdef __cplusplus
90} /* extern "C" */
91#endif
92
93#endif /* PIPEWIRE_EXT_METADATA_H */
defs.h
spa/utils/defs.h
pw_metadata_events
Metadata events
Definition metadata.h:43
pw_metadata_events::version
uint32_t version
Definition metadata.h:46
pw_metadata_events::property
int(* property)(void *data, uint32_t subject, const char *key, const char *type, const char *value)
Definition metadata.h:48
pw_metadata_methods
Metadata methods
Definition metadata.h:65
pw_metadata_methods::clear
int(* clear)(void *object)
Definition metadata.h:81
pw_metadata_methods::add_listener
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_metadata_events *events, void *data)
Definition metadata.h:70
pw_metadata_methods::set_property
int(* set_property)(void *object, uint32_t subject, const char *key, const char *type, const char *value)
Definition metadata.h:75
pw_metadata_methods::version
uint32_t version
Definition metadata.h:68
pw_metadata
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:350