From 3d0a2dec59335c52c2aee73d1043e97b3fa1b727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 8 Jun 2026 21:37:31 +0200 Subject: [PATCH] pipewire: Introduce well known tags Tags are meant to be high level properties or hints of a stream, e.g. scaling information. Tags are split into 'input' tags, set by consumers which typically would be hints about preferences, or 'output' tags which contain high level information about a stream, set by producers. Start by defining two tags: * `pipewire.output.stream.scale`, which could be the HiDPI scale of a streamed window, or the HiDPI scale of a streamed monitor. * `pipewire.input.stream.preferred-scale`, which can be used by a virtual monitor consumer to hint about what the preferred scale of the corresponding virtual monitor should be. --- src/pipewire/meson.build | 1 + src/pipewire/tags.h | 48 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/pipewire/tags.h diff --git a/src/pipewire/meson.build b/src/pipewire/meson.build index 9eaf4649b..dbef60135 100644 --- a/src/pipewire/meson.build +++ b/src/pipewire/meson.build @@ -39,6 +39,7 @@ pipewire_headers = [ 'proxy.h', 'resource.h', 'stream.h', + 'tags.h', 'thread.h', 'thread-loop.h', 'timer-queue.h', diff --git a/src/pipewire/tags.h b/src/pipewire/tags.h new file mode 100644 index 000000000..0709da1b3 --- /dev/null +++ b/src/pipewire/tags.h @@ -0,0 +1,48 @@ +/* PipeWire */ +/* SPDX-FileCopyrightText: Copyright © 2026 Red Hat */ +/* SPDX-License-Identifier: MIT */ + +#ifndef PIPEWIRE_TAGS_H +#define PIPEWIRE_TAGS_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup pw_stream_tags Well known stream tags + * + * A collection of tags that can be used for knows dynamic stream properties. + * + * \addtogroup pw_stream_tags + * \{ + */ + +/** + * Output tags, set by stream producers. + */ + +/**< Stream contents should be considered to be scaled according to the + * specified floating point number. */ +#define PW_STREAM_OUTPUT_TAG_SCALE "pipewire.output.stream.scale" + + +/** + * Input tags, set by stream consumers. + */ + +/**< Stream consumer prefers the producer produces content with the scale + * specified with this floating point number. +*/ +#define PW_STREAM_INPUT_TAG_PREFERRED_SCALE "pipewire.input.stream.preferred-scale" + +/** \} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* PIPEWIRE_TAGS_H */