PipeWire 1.6.8

Loading...
Searching...
No Matches
impl-link.h
Go to the documentation of this file.
1/* PipeWire */
2/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
3/* SPDX-License-Identifier: MIT */
4
5#ifndef PIPEWIRE_IMPL_LINK_H
6#define PIPEWIRE_IMPL_LINK_H
7
8#ifdef __cplusplus
9 extern "C" {
10#endif
11
16
21 struct pw_impl_link;
22 struct pw_impl_port;
23
24#include <pipewire/impl.h>
25
27 struct pw_impl_link_events {
28#define PW_VERSION_IMPL_LINK_EVENTS 0
29 uint32_t version;
30
32 void (*destroy) (void *data);
33
35 void (*free) (void *data);
36
38 void (*initialized) (void *data);
39
41 void (*info_changed) (void *data, const struct pw_link_info *info);
42
45 void (*state_changed) (void *data, enum pw_link_state old,
46 enum pw_link_state state, const char *error);
47
49 void (*port_unlinked) (void *data, struct pw_impl_port *port);
50};
51
52
55 struct pw_impl_link *
56 pw_context_create_link(struct pw_context *context,
57 struct pw_impl_port *output,
58 struct pw_impl_port *input,
59 struct spa_pod *format_filter,
60 struct pw_properties *properties ,
61 size_t user_data_size );
62
64 void pw_impl_link_destroy(struct pw_impl_link *link);
65
67 void pw_impl_link_add_listener(struct pw_impl_link *link,
68 struct spa_hook *listener,
69 const struct pw_impl_link_events *events,
70 void *data);
71
73 int pw_impl_link_register(struct pw_impl_link *link,
74 struct pw_properties *properties );
75
77 struct pw_context *pw_impl_link_get_context(struct pw_impl_link *link);
78
81 void *pw_impl_link_get_user_data(struct pw_impl_link *link);
82
84 const struct pw_link_info *pw_impl_link_get_info(struct pw_impl_link *link);
85
87 struct pw_global *pw_impl_link_get_global(struct pw_impl_link *link);
88
90 struct pw_impl_port *pw_impl_link_get_output(struct pw_impl_link *link);
91
93 struct pw_impl_port *pw_impl_link_get_input(struct pw_impl_link *link);
94
96 struct pw_impl_link *pw_impl_link_find(struct pw_impl_port *output, struct pw_impl_port *input);
97
101
102#ifdef __cplusplus
103}
104#endif
105
106#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:1681
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:1842
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:1797
pw_impl_link_destroy
void pw_impl_link_destroy(struct pw_impl_link *link)
Destroy a link.
Definition impl-link.c:1749
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:1830
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:1486
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:1836
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:1806
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:1848
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:1824
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:1818
pw_link_state
pw_link_state
The different link states.
Definition link.h:54
impl.h
pipewire/impl.h
pw_context
pw_global
pw_impl_link_events
link events added with pw_impl_link_add_listener
Definition impl-link.h:33
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:52
pw_impl_link_events::version
uint32_t version
Definition impl-link.h:36
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:48
pw_impl_link_events::destroy
void(* destroy)(void *data)
A link is destroyed.
Definition impl-link.h:39
pw_impl_link_events::port_unlinked
void(* port_unlinked)(void *data, struct pw_impl_port *port)
A port is unlinked.
Definition impl-link.h:56
pw_impl_link_events::initialized
void(* initialized)(void *data)
a Link is initialized
Definition impl-link.h:45
pw_impl_link
pw_impl_port
pw_link_info
The link information.
Definition link.h:67
pw_properties
Definition properties.h:39
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:427
spa_pod
Definition pod.h:57