PipeWire  0.3.40
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 *
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 
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 
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 */
pipewire/impl.h
Definition: context.h:67
Definition: impl.h:47
Definition: properties.h:53
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:342
Definition: pod.h:63