PipeWire: Media Session Module: Restore Stream

PipeWire 0.4.1

Media Session Module: Restore Stream

The Restore Stream modules monitors pw_node of media class `"Stream/..."` and `"Audio/..."` and saves the SPA_PROP_volume, SPA_PROP_mute, and SPA_PROP_channelMap parameters to the `route-settings` state file and the `route-settings` metadata objects.

When a stream re-appears and matches a saved state, the parameters are restored to their respective values. Additionally, the target node is saved so the stream can be re-associated with that node, if possible.

To match a stream with a previously saved state, this module uses one of PW_KEY_MEDIA_ROLE, PW_KEY_APP_ID, PW_KEY_APP_NAME, PW_KEY_MEDIA_NAME, and PW_KEY_NODE_NAME, whichever applies.

The state file is `$XDG_STATE_HOME/pipewire/media-session.d/restore-stream`.

The `route-settings` metadata object is owned by this module.