WirePlumber

The WirePlumber Daemon

  • Getting started
  • Installing WirePlumber
  • Running the WirePlumber daemon
  • Configuration
  • Locations of WirePlumber's files
  • Debug Logging
  • Running multiple instances

WirePlumber's Design

  • Understanding Session Management
  • Understanding WirePlumber
  • Events and Hooks

WirePlumber's Policies

  • Client Access Control
  • Linking Policy
  • Smart Filters
  • Automatic Software DSP

The WirePlumber Library

  • C API Documentation
    • Library Initialization
    • Core
    • Registry
    • Connection
    • Context
    • WpObject
    • Object Manager
    • Object Interest
    • Iterator
    • Transitions
    • Error Codes
    • Debug Logging
    • PipeWire Proxy
    • PipeWire Object
    • PipeWire Global Object Proxy
    • PipeWire Node
    • PipeWire Port
    • PipeWire Link
    • PipeWire Device
    • Streams
    • Stream Links
      • WpStreamLink
      • WpAudioStreamLink
      • WpVideoStreamLink
      • WpStreamLinkFeatures
        • WP_STREAM_LINK_FEATURE_ACTIVE
      • wp_stream_link_get_output_stream()
      • wp_stream_link_get_input_stream()
      • wp_stream_link_get_subject_stream()
      • wp_stream_link_get_links_count()
      • wp_stream_link_new_links_iterator()
      • wp_stream_link_reconfigure_ports()
      • WP_TYPE_STREAM_LINK
      • WP_TYPE_AUDIO_STREAM_LINK
      • WP_TYPE_VIDEO_STREAM_LINK
    • Stream Manager
    • Stream Link Manager
    • PipeWire Client
    • WpPermissionManager
    • PipeWire Metadata
    • Spa Device
    • Local Nodes
    • Local Modules
    • Properties Dictionary
    • Spa Type Information
    • Spa Json
    • Spa Pod (Plain Old Data)
    • Plugins
    • Events
    • Event Dispatcher
    • Event Hooks
    • Component Loader
    • Settings
    • Static Configuration
    • PipeWire Factory
    • State Storage
    • Json Utilities
    • Process Utilities
    • Base Directories File Lookup

Scripting

  • Lua API Documentation
  • Existing Scripts
  • Custom Scripts

Man Pages

  • wireplumber(1)
  • wpconfig(1)
  • wpctl(1)
  • wpdot(1)
  • wpexec(1)

Resources

  • Contributing to WirePlumber
  • Testing
  • Community Resources
  • Releases
WirePlumber
  • C API Documentation
  • Stream Links
  • View page source
Previous Next

Stream Links

digraph inheritance { rankdir=LR; GObject -> WpObject; WpObject -> WpStreamLink; WpStreamLink -> WpAudioStreamLink; WpStreamLink -> WpVideoStreamLink; }

struct WpStreamLink

WpStreamLink is an abstract base class that manages a set of PipeWire links between an output stream and an input stream. It automatically creates and destroys the individual port-level links as needed based on the port configuration of both streams.

This class provides a higher-level abstraction over individual PipeWire links, allowing applications to establish connections between entire streams rather than managing individual ports. It handles the complexity of matching ports with compatible configurations and managing their lifecycle.

WpStreamLink is an abstract class with two concrete implementations:

  • WpAudioStreamLink: links two audio streams with channel-based port matching

  • WpVideoStreamLink: links two video streams

When activated, a stream link will establish all necessary port-level links between the output and input streams. If the streams change their port configuration, the stream link will automatically recover and update the underlying PipeWire links accordingly. When deactivated or destroyed, all associated links are cleaned up.

A stream link emits signals when individual PipeWire links are added or removed, allowing applications to monitor the linking status. It also emits link-error when one of those links enters the error state, so that the failure can be reported back to the client that owns the stream.

struct WpAudioStreamLink

A WpStreamLink between two WpAudioStream objects. Before it creates the PipeWire links, it configures the ports of both ends: one of the two streams is the main one, whose ports are configured from its own node properties, and the other one is then configured to match it. The stream whose kind is WP_STREAM_KIND_TARGET is the main one; the output stream is used otherwise.

struct WpVideoStreamLink

A WpStreamLink between two WpVideoStream objects. Video ports are not configured, so this class only creates and destroys the PipeWire links.

enum WpStreamLinkFeatures

Flags to be used as WpObjectFeatures on WpStreamLink.

Values:

enumerator WP_STREAM_LINK_FEATURE_ACTIVE = (1 << 0)

Loads the stream link

WpStream *wp_stream_link_get_output_stream(WpStreamLink *self, gboolean *is_monitor)

Gets the output stream of the stream link.

Parameters:
  • self -- the stream link

  • is_monitor -- (out) (optional): if the output stream is a monitor or not

Returns:

(transfer full): the output stream

WpStream *wp_stream_link_get_input_stream(WpStreamLink *self)

Gets the input stream of the stream link.

Parameters:
  • self -- the stream link

Returns:

(transfer full): the input stream

WpStream *wp_stream_link_get_subject_stream(WpStreamLink *self)

Gets the stream that asked for this link.

This is the stream whose policy decision created the link; it is either the output or the input stream. Links that were discovered on the graph and adopted by the WpStreamLinkManager have no subject.

Parameters:
  • self -- the stream link

Returns:

(transfer full) (nullable): the subject stream

guint wp_stream_link_get_links_count(WpStreamLink *self)

Gets the total number of pipewire links.

Parameters:
  • self -- the stream link

Returns:

the total number of pipewire links

WpIterator *wp_stream_link_new_links_iterator(WpStreamLink *self)

Iterates through all the pipewire link objects that link both streams.

Parameters:
  • self -- the stream link

Returns:

(transfer full): a WpIterator that iterates over all the pipewire link objects that link both streams.

gboolean wp_stream_link_reconfigure_ports(WpStreamLink *self)

Configures the ports of both streams again and recreates the links.

Use this when something that the port configuration depends on has changed, such as a stream.features.audio.* setting. Configuring the ports of one of the two streams directly is not equivalent: the two streams have to agree on one configuration, and it is this object that decides which one that is.

Nothing is done, and FALSE is returned, for a stream link that is not active yet, one whose links were only adopted from the graph and one whose media type needs no port configuration.

Parameters:
  • self -- the stream link

Returns:

TRUE if the ports of both streams are being configured again

WP_TYPE_STREAM_LINK (wp_stream_link_get_type ())

The WpStreamLink GType.

WP_TYPE_AUDIO_STREAM_LINK (wp_audio_stream_link_get_type ())

The WpAudioStreamLink GType.

WP_TYPE_VIDEO_STREAM_LINK (wp_video_stream_link_get_type ())

The WpVideoStreamLink GType.

Previous Next

© Copyright 2020-2025, Collabora & contributors.

Built with Sphinx using a theme provided by Read the Docs.