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.
This commit is contained in:
Jonas Ådahl 2026-06-08 21:37:31 +02:00
parent 64d3ed4710
commit 3d0a2dec59
2 changed files with 49 additions and 0 deletions

View file

@ -39,6 +39,7 @@ pipewire_headers = [
'proxy.h', 'proxy.h',
'resource.h', 'resource.h',
'stream.h', 'stream.h',
'tags.h',
'thread.h', 'thread.h',
'thread-loop.h', 'thread-loop.h',
'timer-queue.h', 'timer-queue.h',

48
src/pipewire/tags.h Normal file
View file

@ -0,0 +1,48 @@
/* PipeWire */
/* SPDX-FileCopyrightText: Copyright © 2026 Red Hat */
/* SPDX-License-Identifier: MIT */
#ifndef PIPEWIRE_TAGS_H
#define PIPEWIRE_TAGS_H
#include <pipewire/utils.h>
#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 */