PipeWire  0.2.0
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 
53 #define PW_VERSION_LINK_EVENTS 0
54  uint32_t version;
55 
57  void (*destroy) (void *data);
58 
60  void (*free) (void *data);
61 
63  void (*info_changed) (void *data, const struct pw_link_info *info);
64 
67  void (*state_changed) (void *data, enum pw_link_state old,
68  enum pw_link_state state, const char *error);
69 
71  void (*port_unlinked) (void *data, struct pw_port *port);
72 };
73 
76 #define PW_LINK_PROP_PASSIVE "pipewire.link.passive"
77 
80 struct pw_link *
81 pw_link_new(struct pw_core *core,
82  struct pw_port *output,
83  struct pw_port *input,
84  struct spa_pod *format_filter,
85  struct pw_properties *properties ,
86  char **error,
87  size_t user_data_size );
88 
90 void pw_link_destroy(struct pw_link *link);
91 
93 void pw_link_add_listener(struct pw_link *link,
94  struct spa_hook *listener,
95  const struct pw_link_events *events,
96  void *data);
97 
99 int pw_link_register(struct pw_link *link,
100  struct pw_client *owner,
101  struct pw_global *parent,
102  struct pw_properties *properties );
103 
105 struct pw_core *pw_link_get_core(struct pw_link *link);
106 
109 void *pw_link_get_user_data(struct pw_link *link);
110 
112 const struct pw_link_info *pw_link_get_info(struct pw_link *link);
113 
115 struct pw_global *pw_link_get_global(struct pw_link *link);
116 
118 struct pw_port *pw_link_get_output(struct pw_link *link);
119 
121 struct pw_port *pw_link_get_input(struct pw_link *link);
122 
124 struct pw_link *pw_link_find(struct pw_port *output, struct pw_port *input);
125 
126 #ifdef __cplusplus
127 }
128 #endif
129 
130 #endif /* __PIPEWIRE_LINK_H__ */
A collection of key/value pairs.
Definition: properties.h:38
the core PipeWire object
pw_link_state
The different link states.
Definition: introspect.h:56
PipeWire client object class.
A global object visible to remote clients.
The port object.