PipeWire: pipewire/impl-link.h Source File

PipeWire 0.3.46

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
29extern "C" {
30#endif
31
41struct pw_impl_link;
42struct pw_impl_port;
43
44#include <pipewire/impl.h>
45
47struct 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
75struct 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
84void pw_impl_link_destroy(struct pw_impl_link *link);
85
87void 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
93int pw_impl_link_register(struct pw_impl_link *link,
94 struct pw_properties *properties );
95
97struct pw_context *pw_impl_link_get_context(struct pw_impl_link *link);
98
101void *pw_impl_link_get_user_data(struct pw_impl_link *link);
102
104const struct pw_link_info *pw_impl_link_get_info(struct pw_impl_link *link);
105
107struct pw_global *pw_impl_link_get_global(struct pw_impl_link *link);
108
110struct pw_impl_port *pw_impl_link_get_output(struct pw_impl_link *link);
111
113struct pw_impl_port *pw_impl_link_get_input(struct pw_impl_link *link);
114
116struct 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:1345
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:1502
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:1457
pw_impl_link_destroy
void pw_impl_link_destroy(struct pw_impl_link *link)
Destroy a link.
Definition: impl-link.c:1414
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:1490
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:1162
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:1496
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:1466
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:1508
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:1484
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:1478
pw_link_state
pw_link_state
The different link states.
Definition: link.h:65
impl.h
pipewire/impl.h
pw_context
pw_global
Definition: context.h:67
pw_impl_link_events
link events added with pw_impl_link_add_listener
Definition: impl-link.h:53
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:72
pw_impl_link_events::version
uint32_t version
Definition: impl-link.h:56
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:68
pw_impl_link_events::free
void(* free)(void *data)
A link is freed.
Definition: impl-link.h:62
pw_impl_link_events::destroy
void(* destroy)(void *data)
A link is destroyed.
Definition: impl-link.h:59
pw_impl_link_events::port_unlinked
void(* port_unlinked)(void *data, struct pw_impl_port *port)
A port is unlinked.
Definition: impl-link.h:76
pw_impl_link_events::initialized
void(* initialized)(void *data)
a Link is initialized
Definition: impl-link.h:65
pw_impl_link
pw_impl_port
Definition: impl.h:47
pw_link_info
The link information.
Definition: link.h:78
pw_link_info::state
enum pw_link_state state
the current state of the link
Definition: link.h:93
pw_link_info::error
const char * error
an error reason if state is error
Definition: link.h:94
pw_properties
Definition: properties.h:53
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:342
spa_pod
Definition: pod.h:63