PipeWire  0.1.4
link.h
Go to the documentation of this file.
1 /* PipeWire
2  * Copyright (C) 2015 Wim Taymans <wim.taymans@gmail.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef __PIPEWIRE_LINK_H__
21 #define __PIPEWIRE_LINK_H__
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
31 struct pw_link;
32 
33 #include <pipewire/core.h>
34 #include <pipewire/introspect.h>
35 #include <pipewire/port.h>
36 
37 #define PW_TYPE__Link PW_TYPE_OBJECT_BASE "Link"
38 #define PW_TYPE_LINK_BASE PW_TYPE__Link ":"
39 
52 #define PW_VERSION_LINK_EVENTS 0
53  uint32_t version;
54 
55  void (*destroy) (void *data);
56 
57  void (*free) (void *data);
58 
59  void (*info_changed) (void *data, const struct pw_link_info *info);
60 
61  void (*state_changed) (void *data, enum pw_link_state old,
62  enum pw_link_state state, const char *error);
63 
64  void (*port_unlinked) (void *data, struct pw_port *port);
65 };
66 
69 struct pw_link *
70 pw_link_new(struct pw_core *core,
71  struct pw_global *parent,
72  struct pw_port *output,
73  struct pw_port *input,
74  struct spa_format *format_filter,
75  struct pw_properties *properties ,
76  char **error,
77  size_t user_data_size );
78 
80 void pw_link_destroy(struct pw_link *link);
81 
82 void pw_link_add_listener(struct pw_link *link,
83  struct spa_hook *listener,
84  const struct pw_link_events *events,
85  void *data);
86 
87 
88 struct pw_core *pw_link_get_core(struct pw_link *link);
89 
90 void *pw_link_get_user_data(struct pw_link *link);
91 
92 const struct pw_link_info *pw_link_get_info(struct pw_link *link);
93 
95 struct pw_global *pw_link_get_global(struct pw_link *link);
96 
98 struct pw_port *pw_link_get_output(struct pw_link *link);
99 
101 struct pw_port *pw_link_get_input(struct pw_link *link);
102 
104 struct pw_link *pw_link_find(struct pw_port *output, struct pw_port *input);
105 
107 void pw_link_inc_idle(struct pw_link *link);
108 
112 bool pw_link_activate(struct pw_link *link);
113 
115 bool pw_link_deactivate(struct pw_link *link);
116 
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 #endif /* __PIPEWIRE_LINK_H__ */
A collection of key/value pairs.
Definition: properties.h:38
A global object visible to all clients.
Definition: private.h:87
pw_link_state
The different link states.
Definition: introspect.h:56
struct spa_list link
link in node port_list
Definition: private.h:247
struct spa_list link
link in core list of globals
Definition: private.h:92
struct spa_graph_port port
Definition: private.h:275
The port object.
Definition: private.h:246
the core PipeWire object
Definition: private.h:103