Loading...
Searching...
No Matches
impl-metadata.h
Go to the documentation of this file.
/* PipeWire */
/* SPDX-FileCopyrightText: Copyright © 2021 Wim Taymans */
/* SPDX-License-Identifier: MIT */
#ifndef PIPEWIRE_IMPL_METADATA_H
#define PIPEWIRE_IMPL_METADATA_H
#ifdef __cplusplus
extern "C" {
#endif
struct pw_impl_metadata;
#include <pipewire/context.h>
#include <pipewire/impl-client.h>
#include <pipewire/global.h>
#include <pipewire/properties.h>
#include <pipewire/resource.h>
#include "pipewire/extensions/metadata.h"
struct pw_impl_metadata_events {
#define PW_VERSION_IMPL_METADATA_EVENTS 0
uint32_t version;
void (*destroy) (void *data);
void (*free) (void *data);
int (*property) (void *data,
uint32_t subject,
const char *key,
const char *type,
const char *value);
};
struct pw_impl_metadata *pw_context_create_metadata(struct pw_context *context,
const char *name, struct pw_properties *properties,
size_t user_data_size);
const struct pw_properties *pw_impl_metadata_get_properties(struct pw_impl_metadata *metadata);
int pw_impl_metadata_register(struct pw_impl_metadata *metadata,
struct pw_properties *properties);
void pw_impl_metadata_destroy(struct pw_impl_metadata *metadata);
void *pw_impl_metadata_get_user_data(struct pw_impl_metadata *metadata);
int pw_impl_metadata_set_implementation(struct pw_impl_metadata *metadata,
struct pw_metadata *impl);
struct pw_metadata *pw_impl_metadata_get_implementation(struct pw_impl_metadata *metadata);
struct pw_global *pw_impl_metadata_get_global(struct pw_impl_metadata *metadata);
void pw_impl_metadata_add_listener(struct pw_impl_metadata *metadata,
struct spa_hook *listener,
const struct pw_impl_metadata_events *events,
void *data);
int pw_impl_metadata_set_property(struct pw_impl_metadata *metadata,
uint32_t subject, const char *key, const char *type,
const char *value);
int pw_impl_metadata_set_propertyf(struct pw_impl_metadata *metadata,
uint32_t subject, const char *key, const char *type,
const char *fmt, ...) SPA_PRINTF_FUNC(5,6);
#ifdef __cplusplus
}
#endif
#endif /* PIPEWIRE_IMPL_METADATA_H */
global.h
pipewire/global.h
pw_impl_metadata_get_user_data
void * pw_impl_metadata_get_user_data(struct pw_impl_metadata *metadata)
Definition impl-metadata.c:567
pw_impl_metadata_register
int pw_impl_metadata_register(struct pw_impl_metadata *metadata, struct pw_properties *properties)
Definition impl-metadata.c:522
pw_impl_metadata_set_implementation
int pw_impl_metadata_set_implementation(struct pw_impl_metadata *metadata, struct pw_metadata *impl)
Definition impl-metadata.c:317
pw_impl_metadata_add_listener
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:579
pw_impl_metadata_get_implementation
struct pw_metadata * pw_impl_metadata_get_implementation(struct pw_impl_metadata *metadata)
Definition impl-metadata.c:337
pw_impl_metadata_get_global
struct pw_global * pw_impl_metadata_get_global(struct pw_impl_metadata *metadata)
Get the global of this metadata.
Definition impl-metadata.c:573
pw_impl_metadata_get_properties
const struct pw_properties * pw_impl_metadata_get_properties(struct pw_impl_metadata *metadata)
Get the metadata properties.
Definition impl-metadata.c:311
pw_impl_metadata_set_property
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:588
pw_context_create_metadata
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:267
pw_impl_metadata_set_propertyf
int pw_impl_metadata_set_propertyf(struct pw_impl_metadata *metadata, uint32_t subject, const char *key, const char *type, const char *fmt,...)
Definition impl-metadata.c:596
pw_impl_metadata_destroy
void pw_impl_metadata_destroy(struct pw_impl_metadata *metadata)
Definition impl-metadata.c:343
SPA_PRINTF_FUNC
#define SPA_PRINTF_FUNC(fmt, arg1)
Definition defs.h:297
impl-client.h
pipewire/impl-client.h
metadata.h
pipewire/extensions/metadata.h
properties.h
pipewire/properties.h
resource.h
pipewire/resource.h
context.h
pipewire/context.h
pw_context
pw_global
pw_impl_metadata_events
Metadata events, listen to them with pw_impl_metadata_add_listener.
Definition impl-metadata.h:37
pw_impl_metadata_events::destroy
void(* destroy)(void *data)
the metadata is destroyed
Definition impl-metadata.h:43
pw_impl_metadata_events::property
int(* property)(void *data, uint32_t subject, const char *key, const char *type, const char *value)
a property changed
Definition impl-metadata.h:48
pw_impl_metadata_events::version
uint32_t version
Definition impl-metadata.h:40
pw_impl_metadata
pw_metadata
pw_properties
Definition properties.h:39
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:427