PipeWire  0.3.66
impl-metadata.h
Go to the documentation of this file.
1 /* PipeWire */
2 /* SPDX-FileCopyrightText: Copyright © 2021 Wim Taymans */
3 /* SPDX-License-Identifier: MIT */
4 
5 #ifndef PIPEWIRE_IMPL_METADATA_H
6 #define PIPEWIRE_IMPL_METADATA_H
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
21 struct pw_impl_metadata;
22 
23 #include <pipewire/context.h>
24 #include <pipewire/impl-client.h>
26 #include <pipewire/properties.h>
27 #include <pipewire/resource.h>
28 
30 
33 #define PW_VERSION_IMPL_METADATA_EVENTS 0
34  uint32_t version;
35 
37  void (*destroy) (void *data);
39  void (*free) (void *data);
40 
42  int (*property) (void *data,
43  uint32_t subject,
44  const char *key,
45  const char *type,
46  const char *value);
47 };
48 
50  const char *name, struct pw_properties *properties,
51  size_t user_data_size);
52 
54 const struct pw_properties *pw_impl_metadata_get_properties(struct pw_impl_metadata *metadata);
55 
56 int pw_impl_metadata_register(struct pw_impl_metadata *metadata,
57  struct pw_properties *properties);
58 
59 void pw_impl_metadata_destroy(struct pw_impl_metadata *metadata);
60 
61 void *pw_impl_metadata_get_user_data(struct pw_impl_metadata *metadata);
62 
64  struct pw_metadata *impl);
65 
67 
70 
73  struct spa_hook *listener,
74  const struct pw_impl_metadata_events *events,
75  void *data);
76 
79  uint32_t subject, const char *key, const char *type,
80  const char *value);
81 
83  uint32_t subject, const char *key, const char *type,
84  const char *fmt, ...) SPA_PRINTF_FUNC(5,6);
85 
90 #ifdef __cplusplus
91 }
92 #endif
93 
94 #endif /* PIPEWIRE_IMPL_METADATA_H */
pipewire/global.h
int pw_impl_metadata_set_propertyf(struct pw_impl_metadata *metadata, uint32_t subject, const char *key, const char *type, const char *fmt,...) 1(5
void * pw_impl_metadata_get_user_data(struct pw_impl_metadata *metadata)
Definition: impl-metadata.c:546
int pw_impl_metadata_register(struct pw_impl_metadata *metadata, struct pw_properties *properties)
Definition: impl-metadata.c:503
int pw_impl_metadata_set_implementation(struct pw_impl_metadata *metadata, struct pw_metadata *impl)
Definition: impl-metadata.c:315
struct pw_global * pw_impl_metadata_get_global(struct pw_impl_metadata *metadata)
Get the global of this metadata.
Definition: impl-metadata.c:552
const struct pw_properties * pw_impl_metadata_get_properties(struct pw_impl_metadata *metadata)
Get the metadata properties.
Definition: impl-metadata.c:309
void pw_impl_metadata_add_listener(struct pw_impl_metadata *metadata, struct spa_hook *listener, const struct pw_impl_metadata_events *events, void *data)
Add an event listener.
Definition: impl-metadata.c:558
struct pw_impl_metadata * pw_context_create_metadata(struct pw_context *context, const char *name, struct pw_properties *properties, size_t user_data_size)
Definition: impl-metadata.c:265
int pw_impl_metadata_set_property(struct pw_impl_metadata *metadata, uint32_t subject, const char *key, const char *type, const char *value)
Set a property.
Definition: impl-metadata.c:567
struct pw_metadata * pw_impl_metadata_get_implementation(struct pw_impl_metadata *metadata)
Definition: impl-metadata.c:335
void pw_impl_metadata_destroy(struct pw_impl_metadata *metadata)
Definition: impl-metadata.c:341
#define SPA_PRINTF_FUNC(fmt, arg1)
Definition: defs.h:269
pipewire/impl-client.h
pipewire/extensions/metadata.h
pipewire/properties.h
pipewire/resource.h
pipewire/context.h
Definition: src/pipewire/context.h:47
Metadata events, listen to them with pw_impl_metadata_add_listener.
Definition: impl-metadata.h:37
void(* destroy)(void *data)
the metadata is destroyed
Definition: impl-metadata.h:43
int(* property)(void *data, uint32_t subject, const char *key, const char *type, const char *value)
a property changed
Definition: impl-metadata.h:48
void(* free)(void *data)
the metadata is freed
Definition: impl-metadata.h:45
uint32_t version
Definition: impl-metadata.h:40
Definition: properties.h:33
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:331