# PipeWire Proxy

struct WpProxy

  Base class for all objects that expose PipeWire objects using `pw_proxy` underneath.

  This base class cannot be instantiated. It provides handling of pw_proxy’s events and exposes common functionality.

  GObject Properties

  bound-id

    The id that this object has on the registry

    `guint` | `G_PARAM_READABLE`

  pw-proxy

    The `struct pw_proxy *`

    `gpointer` | `G_PARAM_READABLE`

  GObject Signals

  bound

        void
        bound_callback (WpProxy * self,
                        guint id,
                        gpointer user_data)

    Parameters:

    - `id` - the bound id of the proxy

    Flags: G_SIGNAL_RUN_FIRST

  pw-proxy-created

        void
        pw_proxy_created_callback (WpProxy * self,
                                   gpointer object,
                                   gpointer user_data)

    Parameters:

    - `object` - pointer to the pw_proxy that was just created

    Flags: G_SIGNAL_RUN_FIRST

  pw-proxy-destroyed

        void
        pw_proxy_destroyed_callback (WpProxy * self,
                                     gpointer user_data)

    Flags: G_SIGNAL_RUN_FIRST

  error

        void
        error_callback (WpProxy * self,
                        gint seq, gint res, const gchar *message,
                        gpointer user_data)

    Emitted when an error occurs on the remote object. The parameters are exactly the same as on the underlying pw_proxy error callback.

    Parameters:

    - `seq` - the sequence number of the operation that caused the error

    - `res` - the error code

    - `message` - a description of the error

    Flags: G_SIGNAL_RUN_FIRST

struct _WpProxyClass

  Public Members

  WpObjectClass parent_class
  const gchar *pw_iface_type

    the PipeWire type of the interface that is being proxied by this class (ex. `PW_TYPE_INTERFACE_Node` for WpNode

  guint32 pw_iface_version

    the PipeWire version of the interface that is being proxied by this class

  void (*pw_proxy_created)(WpProxy *self, struct pw_proxy *proxy)
  void (*pw_proxy_destroyed)(WpProxy *self)
  void (*bound)(WpProxy *self, guint32 id)
  void (*error)(WpProxy *self, int seq, int res, const char *message)

enum WpProxyFeatures

  Flags to be used as WpObjectFeatures for WpProxy subclasses.

  Values:

  enumerator WP_PROXY_FEATURE_BOUND = (1 << 0)
  enumerator WP_PIPEWIRE_OBJECT_FEATURE_INFO = (1 << 4)
  enumerator WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PROPS = (1 << 5)
  enumerator WP_PIPEWIRE_OBJECT_FEATURE_PARAM_FORMAT = (1 << 6)
  enumerator WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PROFILE = (1 << 7)
  enumerator WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PORT_CONFIG = (1 << 8)
  enumerator WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ROUTE = (1 << 9)
  enumerator WP_PIPEWIRE_OBJECT_FEATURES_MINIMAL = (WP_PROXY_FEATURE_BOUND | WP_PIPEWIRE_OBJECT_FEATURE_INFO)

    The minimal feature set for proxies implementing WpPipewireObject. This is a subset of WP_PIPEWIRE_OBJECT_FEATURES_ALL

  enumerator WP_PIPEWIRE_OBJECT_FEATURES_ALL = (WP_PIPEWIRE_OBJECT_FEATURES_MINIMAL | WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PROPS | WP_PIPEWIRE_OBJECT_FEATURE_PARAM_FORMAT | WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PROFILE | WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PORT_CONFIG | WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ROUTE)

    The complete common feature set for proxies implementing WpPipewireObject. This is a subset of WP_OBJECT_FEATURES_ALL

  enumerator WP_PROXY_FEATURE_CUSTOM_START = (1 << 16)

guint32 wp_proxy_get_bound_id(WpProxy *self)

  Returns the proxy bound id.

  The bound id is the id that this object has on the PipeWire registry (a.k.a. the global id). The object must have the WP_PROXY_FEATURE_BOUND feature before this method can be called.

  Remark

  Requires WP_PROXY_FEATURE_BOUND

  Parameters:

    - self – the proxy

  Returns:

    the bound id of this object

const gchar *wp_proxy_get_interface_type(WpProxy *self, guint32 *version)

  Gets the interface type of the proxied object.

  Parameters:

    - self – the proxy

    - version – (out) (optional): the version of the interface

  Returns:

    the PipeWire type of the interface that is being proxied

struct pw_proxy *wp_proxy_get_pw_proxy(WpProxy *self)

  Gets the `pw_proxy` wrapped by this proxy object.

  Parameters:

    - self – the proxy

  Returns:

    a pointer to the underlying `pw_proxy` object

void wp_proxy_set_pw_proxy(WpProxy *self, struct pw_proxy *proxy)

  Private method to be used by subclasses to set the `pw_proxy` pointer when it is available.

  This can be called only if there is no `pw_proxy` already set. Takes ownership of proxy.

WP_TYPE_PROXY (wp_proxy_get_type ())

  The WpProxy GType.