PipeWire 1.5.0
|
This document explains how stream specific metadata is transported in the PipeWire graph.
The metadata is a dictionary of string key/value pairs with information such as the author, track, copyright, album information etc.
Applications need to be able to query the Tag of a port/node/stream.
Linked Nodes need to be informed of the upstream and downstream tags.
It needs to be possible to dynamically update the tags of a port/node/stream and this should inform all linked ports/nodes of the updated tags.
A node might need to know all the upstream and downstream tags. Each node can add or remove metadata in the Tag param.
A mixer node might need to combine the Tags of the two input streams and generate a combined tag.
The fundamental object for implementing metadata reporting in PipeWire is the Tag object.
It consists of a direction (input/output) and one or more generic dictionaries with string key/value pairs.
The direction of the tag object determines how the object propagates in the graph.
PipeWire will automatically propagate Tag objects from ports to all linked ports in the graph. Output Tag objects on output ports are propagated to linked input ports and input Tag objects on input ports are propagated to linked output ports.
If a port has links with multiple other ports, the Tag objects are merged by appending the dictionaties to the Tag param. Intermediate nodes or sinks are allowed to take the multiple dictionaries in a Tag and combine them into one dictionary if they would like to do so.
This way, Output Tag always describes the aggragated total upstream metadata of signal up to the port and Input tag describes the aggregated downstream metadata of the signal from the port.
Tag params on the ports can be updated as needed. This can happen because some upstream or downstream Tag changed or when the metadata of a node/port/stream changes.