File: proxy.h

package info (click to toggle)
wireplumber 0.5.12-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,244 kB
  • sloc: ansic: 41,043; python: 391; sh: 62; makefile: 57; xml: 23
file content (103 lines) | stat: -rw-r--r-- 2,850 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/* WirePlumber
 *
 * Copyright © 2020 Collabora Ltd.
 *    @author George Kiagiadakis <george.kiagiadakis@collabora.com>
 *
 * SPDX-License-Identifier: MIT
 */

#ifndef __WIREPLUMBER_PROXY_H__
#define __WIREPLUMBER_PROXY_H__

#include "object.h"

G_BEGIN_DECLS

struct pw_proxy;

/*!
 * \brief Flags to be used as WpObjectFeatures for WpProxy subclasses.
 * \ingroup wpproxy
 */
typedef enum { /*< flags >*/
  /* standard features */
  WP_PROXY_FEATURE_BOUND                       = (1 << 0),

  /* WpPipewireObjectInterface */
  WP_PIPEWIRE_OBJECT_FEATURE_INFO              = (1 << 4),
  WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PROPS       = (1 << 5),
  WP_PIPEWIRE_OBJECT_FEATURE_PARAM_FORMAT      = (1 << 6),
  WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PROFILE     = (1 << 7),
  WP_PIPEWIRE_OBJECT_FEATURE_PARAM_PORT_CONFIG = (1 << 8),
  WP_PIPEWIRE_OBJECT_FEATURE_PARAM_ROUTE       = (1 << 9),

  /*!
   * The minimal feature set for proxies implementing WpPipewireObject.
   * This is a subset of \em WP_PIPEWIRE_OBJECT_FEATURES_ALL
   */
  WP_PIPEWIRE_OBJECT_FEATURES_MINIMAL =
      (WP_PROXY_FEATURE_BOUND | WP_PIPEWIRE_OBJECT_FEATURE_INFO),

  /*!
   * The complete common feature set for proxies implementing
   * WpPipewireObject. This is a subset of \em WP_OBJECT_FEATURES_ALL
   */
  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),

  WP_PROXY_FEATURE_CUSTOM_START                = (1 << 16), /*< skip >*/
} WpProxyFeatures;

/*!
 * \brief The WpProxy GType
 * \ingroup wpproxy
 */
#define WP_TYPE_PROXY (wp_proxy_get_type ())
WP_API
G_DECLARE_DERIVABLE_TYPE (WpProxy, wp_proxy, WP, PROXY, WpObject)

struct _WpProxyClass
{
  WpObjectClass parent_class;

  /*! \brief the PipeWire type of the interface that is being proxied by
   *  this class (ex. `PW_TYPE_INTERFACE_Node` for WpNode */
  const gchar * pw_iface_type;

  /*! \brief the PipeWire version of the interface that is being
   *  proxied by this class */
  guint32 pw_iface_version;

  /* signals */

  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);

  /*< private >*/
  WP_PADDING(6)
};

WP_API
guint32 wp_proxy_get_bound_id (WpProxy * self);

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

WP_API
struct pw_proxy * wp_proxy_get_pw_proxy (WpProxy * self);

/* for subclasses only */

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

G_END_DECLS

#endif