PipeWire: link.h Source File

PipeWire 0.2.5

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 struct pw_link_events {
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__ */
pw_link_events
link events added with pw_link_add_listener
Definition: link.h:52
pw_properties
A collection of key/value pairs.
Definition: properties.h:38
pw_link_events::state_changed
void(* state_changed)(void *data, enum pw_link_state old, enum pw_link_state state, const char *error)
The link state changed, error is only valid when the state is in error.
Definition: link.h:67
introspect.h
pw_link
PipeWire link object.
pw_link_events::port_unlinked
void(* port_unlinked)(void *data, struct pw_port *port)
A port is unlinked.
Definition: link.h:71
pw_link_events::info_changed
void(* info_changed)(void *data, const struct pw_link_info *info)
The info changed on a link.
Definition: link.h:63
core.h
pw_core
the core PipeWire object
pw_link_get_info
const struct pw_link_info * pw_link_get_info(struct pw_link *link)
Get the link info.
Definition: link.c:1345
pw_link::pw_link_destroy
void pw_link_destroy(struct pw_link *link)
Destroy a link.
Definition: link.c:1275
pw_link_add_listener
void pw_link_add_listener(struct pw_link *link, struct spa_hook *listener, const struct pw_link_events *events, void *data)
Add an event listener to link.
Definition: link.c:1315
pw_link_state
pw_link_state
The different link states.
Definition: introspect.h:56
pw_link_get_user_data
void * pw_link_get_user_data(struct pw_link *link)
Get the user_data of a link, the size of the memory is given when constructing the link...
Definition: link.c:1340
pw_link_get_core
struct pw_core * pw_link_get_core(struct pw_link *link)
Get the core of a link.
Definition: link.c:1335
pw_link_get_input
struct pw_port * pw_link_get_input(struct pw_link *link)
Get the input port of the link.
Definition: link.c:1360
pw_link_events::version
uint32_t version
Definition: link.h:54
pw_link_events::destroy
void(* destroy)(void *data)
A link is destroyed.
Definition: link.h:57
pw_client
PipeWire client object class.
pw_link_register
int pw_link_register(struct pw_link *link, struct pw_client *owner, struct pw_global *parent, struct pw_properties *properties)
Finish link configuration and register.
Definition: link.c:1223
pw_link_info
The link information.
Definition: introspect.h:204
pw_link_get_global
struct pw_global * pw_link_get_global(struct pw_link *link)
Get the global of the link.
Definition: link.c:1350
pw_link_events::free
void(* free)(void *data)
A link is freed.
Definition: link.h:60
pw_link::pw_link_new
struct pw_link * pw_link_new(struct pw_core *core, struct pw_port *output, struct pw_port *input, struct spa_pod *format_filter, struct pw_properties *properties, char **error, size_t user_data_size)
Make a new link between two ports.
Definition: link.c:1089
port.h
pw_link::pw_link_find
struct pw_link * pw_link_find(struct pw_port *output, struct pw_port *input)
Find the link between 2 ports.
Definition: link.c:1324
pw_global
A global object visible to remote clients.
pw_port
The port object.
pw_link_get_output
struct pw_port * pw_link_get_output(struct pw_link *link)
Get the output port of the link.
Definition: link.c:1355