PipeWire: impl-link.h Source File

PipeWire 0.3.34

impl-link.h
Go to the documentation of this file.
1 /* PipeWire
2 *
3 * Copyright © 2018 Wim Taymans
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25 #ifndef PIPEWIRE_IMPL_LINK_H
26 #define PIPEWIRE_IMPL_LINK_H
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
41 struct pw_impl_link;
42 struct pw_impl_port;
43
44 #include <pipewire/impl.h>
45
47 struct pw_impl_link_events {
48 #define PW_VERSION_IMPL_LINK_EVENTS 0
49 uint32_t version;
50
52 void (*destroy) (void *data);
53
55 void (*free) (void *data);
56
58 void (*initialized) (void *data);
59
61 void (*info_changed) (void *data, const struct pw_link_info *info);
62
65 void (*state_changed) (void *data, enum pw_link_state old,
66 enum pw_link_state state, const char *error);
67
69 void (*port_unlinked) (void *data, struct pw_impl_port *port);
70 };
71
72
75 struct pw_impl_link *
76 pw_context_create_link(struct pw_context *context,
77 struct pw_impl_port *output,
78 struct pw_impl_port *input,
79 struct spa_pod *format_filter,
80 struct pw_properties *properties ,
81 size_t user_data_size );
82
84 void pw_impl_link_destroy(struct pw_impl_link *link);
85
87 void pw_impl_link_add_listener(struct pw_impl_link *link,
88 struct spa_hook *listener,
89 const struct pw_impl_link_events *events,
90 void *data);
91
93 int pw_impl_link_register(struct pw_impl_link *link,
94 struct pw_properties *properties );
95
97 struct pw_context *pw_impl_link_get_context(struct pw_impl_link *link);
98
101 void *pw_impl_link_get_user_data(struct pw_impl_link *link);
102
104 const struct pw_link_info *pw_impl_link_get_info(struct pw_impl_link *link);
105
107 struct pw_global *pw_impl_link_get_global(struct pw_impl_link *link);
108
110 struct pw_impl_port *pw_impl_link_get_output(struct pw_impl_link *link);
111
113 struct pw_impl_port *pw_impl_link_get_input(struct pw_impl_link *link);
114
116 struct pw_impl_link *pw_impl_link_find(struct pw_impl_port *output, struct pw_impl_port *input);
117
122 #ifdef __cplusplus
123 }
124 #endif
125
126 #endif /* PIPEWIRE_IMPL_LINK_H */
pw_impl_link_register
int pw_impl_link_register(struct pw_impl_link *link, struct pw_properties *properties)
Finish link configuration and register.
Definition: impl-link.c:1243
pw_impl_link_get_input
struct pw_impl_port * pw_impl_link_get_input(struct pw_impl_link *link)
Get the input port of the link.
Definition: impl-link.c:1401
pw_impl_link_get_user_data
void * pw_impl_link_get_user_data(struct pw_impl_link *link)
Get the user_data of a link, the size of the memory is given when constructing the link.
Definition: impl-link.c:1377
pw_context_create_link
struct pw_impl_link * pw_context_create_link(struct pw_context *context, struct pw_impl_port *output, struct pw_impl_port *input, struct spa_pod *format_filter, struct pw_properties *properties, size_t user_data_size)
Make a new link between two ports.
Definition: impl-link.c:1065
pw_impl_link_add_listener
void pw_impl_link_add_listener(struct pw_impl_link *link, struct spa_hook *listener, const struct pw_impl_link_events *events, void *data)
Add an event listener to link.
Definition: impl-link.c:1350
pw_impl_link_destroy
void pw_impl_link_destroy(struct pw_impl_link *link)
Destroy a link.
Definition: impl-link.c:1307
pw_impl_link_get_context
struct pw_context * pw_impl_link_get_context(struct pw_impl_link *link)
Get the context of a link.
Definition: impl-link.c:1371
pw_impl_link_get_info
const struct pw_link_info * pw_impl_link_get_info(struct pw_impl_link *link)
Get the link info.
Definition: impl-link.c:1383
pw_impl_link_get_global
struct pw_global * pw_impl_link_get_global(struct pw_impl_link *link)
Get the global of the link.
Definition: impl-link.c:1389
pw_impl_link_get_output
struct pw_impl_port * pw_impl_link_get_output(struct pw_impl_link *link)
Get the output port of the link.
Definition: impl-link.c:1395
pw_impl_link_find
struct pw_impl_link * pw_impl_link_find(struct pw_impl_port *output, struct pw_impl_port *input)
Find the link between 2 ports.
Definition: impl-link.c:1359
pw_link_state
pw_link_state
The different link states.
Definition: link.h:58
impl.h
data
user data to add to an object
Definition: filter.c:75
link
Definition: module-filter-chain.c:180
port
Definition: buffers.c:44
pw_impl_link_events
link events added with pw_impl_link_add_listener
Definition: impl-link.h:47
pw_impl_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: impl-link.h:65
pw_impl_link_events::version
uint32_t version
Definition: impl-link.h:49
pw_impl_link_events::info_changed
void(* info_changed)(void *data, const struct pw_link_info *info)
The info changed on a link.
Definition: impl-link.h:61
pw_impl_link_events::free
void(* free)(void *data)
A link is freed.
Definition: impl-link.h:55
pw_impl_link_events::destroy
void(* destroy)(void *data)
A link is destroyed.
Definition: impl-link.h:52
pw_impl_link_events::port_unlinked
void(* port_unlinked)(void *data, struct pw_impl_port *port)
A port is unlinked.
Definition: impl-link.h:69
pw_impl_link_events::initialized
void(* initialized)(void *data)
a Link is initialized
Definition: impl-link.h:58
pw_link_info
The link information.
Definition: link.h:71
pw_link_info::state
enum pw_link_state state
the current state of the link
Definition: link.h:82
pw_link_info::error
const char * error
an error reason if state is error
Definition: link.h:83
pw_properties
Definition: properties.h:49
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:295
spa_pod
Definition: pod/pod.h:50