PipeWire  0.2.7
control.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_CONTROL_H__
21 #define __PIPEWIRE_CONTROL_H__
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #define PW_TYPE__Control "PipeWire:Object:Control"
28 #define PW_TYPE_CONTROL_BASE PW_TYPE__Control ":"
29 
30 #include <spa/utils/hook.h>
31 
42 struct pw_control;
43 
44 #include <pipewire/core.h>
45 #include <pipewire/introspect.h>
46 #include <pipewire/node.h>
47 
50 #define PW_VERSION_PORT_EVENTS 0
51  uint32_t version;
52 
54  void (*destroy) (void *data);
55 
57  void (*free) (void *data);
58 
60  void (*linked) (void *data, struct pw_control *other);
62  void (*unlinked) (void *data, struct pw_control *other);
63 
64 };
65 
67 struct pw_port *pw_control_get_port(struct pw_control *control);
68 
70 void pw_control_add_listener(struct pw_control *control,
71  struct spa_hook *listener,
72  const struct pw_control_events *events,
73  void *data);
74 
75 int pw_control_link(struct pw_control *control, struct pw_control *other);
76 int pw_control_unlink(struct pw_control *control, struct pw_control *other);
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif /* __PIPEWIRE_CONTROL_H__ */
introspect.h
pw_control_unlink
int pw_control_unlink(struct pw_control *control, struct pw_control *other)
Definition: control.c:205
PW_MEMBLOCK_FLAG_MAP_READWRITE
#define PW_MEMBLOCK_FLAG_MAP_READWRITE
Definition: mem.h:39
control.h
pw_control_get_port
SPA_EXPORT struct pw_port * pw_control_get_port(struct pw_control *control)
Get the control parent port or NULL when not set.
Definition: control.c:124
pw_control_events
Port events, use pw_control_add_listener.
Definition: control.h:49
pw_control_link
SPA_EXPORT int pw_control_link(struct pw_control *control, struct pw_control *other)
Definition: control.c:139
pw_memblock::pw_memblock_alloc
SPA_EXPORT int pw_memblock_alloc(enum pw_memblock_flags flags, size_t size, struct pw_memblock **mem)
Create a new memblock.
Definition: mem.c:154
pw_control_add_listener
SPA_EXPORT void pw_control_add_listener(struct pw_control *control, struct spa_hook *listener, const struct pw_control_events *events, void *data)
Add an event listener on the control.
Definition: control.c:130
pw_control
The control object.
pw_control_add_listener
void pw_control_add_listener(struct pw_control *control, struct spa_hook *listener, const struct pw_control_events *events, void *data)
Add an event listener on the control.
Definition: control.c:130
pw_control_events::linked
void(* linked)(void *data, struct pw_control *other)
control is linked to another control
Definition: control.h:60
impl
Definition: control.c:25
pw_type::map
struct spa_type_map * map
the type mapper
Definition: type.h:52
pw_control_get_port
struct pw_port * pw_control_get_port(struct pw_control *control)
Get the control parent port or NULL when not set.
Definition: control.c:124
pw_type
PipeWire type support struct.
Definition: type.h:51
pw_control_link
int pw_control_link(struct pw_control *control, struct pw_control *other)
Definition: control.c:139
pw_utils::pw_spa_pod_copy
static struct spa_pod * pw_spa_pod_copy(const struct spa_pod *pod)
Copy a pod structure
Definition: utils.h:52
PW_MEMBLOCK_FLAG_SEAL
@ PW_MEMBLOCK_FLAG_SEAL
Definition: mem.h:33
pw_type::core
uint32_t core
Definition: type.h:54
pw_port
The port object.
node.h
pw_memblock::ptr
void * ptr
ptr to mapped memory
Definition: mem.h:47
pw_control_destroy
void pw_control_destroy(struct pw_control *control)
Definition: control.c:85
pw_memblock::pw_memblock_free
SPA_EXPORT void pw_memblock_free(struct pw_memblock *mem)
Free a memblock.
Definition: mem.c:255
pw_control_events::destroy
void(* destroy)(void *data)
The control is destroyed.
Definition: control.h:54
pw_control_new
struct pw_control * pw_control_new(struct pw_core *core, struct pw_port *port, const struct spa_pod *param, size_t user_data_size)
Definition: control.c:32
pw_control_events::version
uint32_t version
Definition: control.h:51
pw_memblock
Memory block structure.
Definition: mem.h:43
pw_core
the core PipeWire object
pw_control_events::free
void(* free)(void *data)
The control is freed.
Definition: control.h:57
pw_control_events::unlinked
void(* unlinked)(void *data, struct pw_control *other)
control is unlinked from another control
Definition: control.h:62
PW_MEMBLOCK_FLAG_WITH_FD
@ PW_MEMBLOCK_FLAG_WITH_FD
Definition: mem.h:32
impl::mem
struct pw_memblock * mem
Definition: control.c:28
pw_type::param
struct spa_type_param param
Definition: type.h:71
core.h
pw_type::param_io
struct spa_type_param_io param_io
Definition: type.h:79
impl::this
struct pw_control this
Definition: control.c:26
pw_type::port
uint32_t port
Definition: type.h:57
pw_log::pw_log_warn
void pw_log_warn(const char *format,...)
Log a warning message.
pw_log::pw_log_debug
void pw_log_debug(const char *format,...)
Log a debug message.
pw_control_unlink
SPA_EXPORT int pw_control_unlink(struct pw_control *control, struct pw_control *other)
Definition: control.c:205