PipeWire: impl-device.h Source File

PipeWire 0.3.34

impl-device.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_DEVICE_H
26 #define PIPEWIRE_IMPL_DEVICE_H
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
46 struct pw_impl_device;
47
48 #include <spa/monitor/device.h>
49
50 #include <pipewire/context.h>
51 #include <pipewire/global.h>
52 #include <pipewire/properties.h>
53 #include <pipewire/resource.h>
54
56 struct pw_impl_device_events {
57 #define PW_VERSION_IMPL_DEVICE_EVENTS 0
58 uint32_t version;
59
61 void (*destroy) (void *data);
63 void (*free) (void *data);
65 void (*initialized) (void *data);
66
68 void (*info_changed) (void *data, const struct pw_device_info *info);
69 };
70
71 struct pw_impl_device *pw_context_create_device(struct pw_context *context,
72 struct pw_properties *properties,
73 size_t user_data_size);
74
75 int pw_impl_device_register(struct pw_impl_device *device,
76 struct pw_properties *properties);
77
78 void pw_impl_device_destroy(struct pw_impl_device *device);
79
80 void *pw_impl_device_get_user_data(struct pw_impl_device *device);
81
83 int pw_impl_device_set_implementation(struct pw_impl_device *device, struct spa_device *spa_device);
85 struct spa_device *pw_impl_device_get_implementation(struct pw_impl_device *device);
86
88 struct pw_global *pw_impl_device_get_global(struct pw_impl_device *device);
89
91 void pw_impl_device_add_listener(struct pw_impl_device *device,
92 struct spa_hook *listener,
93 const struct pw_impl_device_events *events,
94 void *data);
95
96 int pw_impl_device_update_properties(struct pw_impl_device *device, const struct spa_dict *dict);
97
98 const struct pw_properties *pw_impl_device_get_properties(struct pw_impl_device *device);
99
100 int pw_impl_device_for_each_param(struct pw_impl_device *device,
101 int seq, uint32_t param_id,
102 uint32_t index, uint32_t max,
103 const struct spa_pod *filter,
104 int (*callback) (void *data, int seq,
105 uint32_t id, uint32_t index, uint32_t next,
106 struct spa_pod *param),
107 void *data);
112 #ifdef __cplusplus
113 }
114 #endif
115
116 #endif /* PIPEWIRE_IMPL_DEVICE_H */
device.h
context.h
global.h
pw_impl_device_get_user_data
void * pw_impl_device_get_user_data(struct pw_impl_device *device)
Definition: impl-device.c:911
pw_impl_device_destroy
void pw_impl_device_destroy(struct pw_impl_device *device)
Definition: impl-device.c:194
pw_impl_device_set_implementation
int pw_impl_device_set_implementation(struct pw_impl_device *device, struct spa_device *spa_device)
Set the device implementation.
Definition: impl-device.c:874
pw_impl_device_get_global
struct pw_global * pw_impl_device_get_global(struct pw_impl_device *device)
Get the global of this device.
Definition: impl-device.c:917
pw_impl_device_get_implementation
struct spa_device * pw_impl_device_get_implementation(struct pw_impl_device *device)
Get the device implementation.
Definition: impl-device.c:891
pw_impl_device_register
int pw_impl_device_register(struct pw_impl_device *device, struct pw_properties *properties)
Definition: impl-device.c:554
pw_context_create_device
struct pw_impl_device * pw_context_create_device(struct pw_context *context, struct pw_properties *properties, size_t user_data_size)
Definition: impl-device.c:141
pw_impl_device_add_listener
void pw_impl_device_add_listener(struct pw_impl_device *device, struct spa_hook *listener, const struct pw_impl_device_events *events, void *data)
Add an event listener.
Definition: impl-device.c:923
pw_impl_device_for_each_param
int pw_impl_device_for_each_param(struct pw_impl_device *device, int seq, uint32_t param_id, uint32_t index, uint32_t max, const struct spa_pod *filter, int(*callback)(void *data, int seq, uint32_t id, uint32_t index, uint32_t next, struct spa_pod *param), void *data)
Definition: impl-device.c:293
pw_impl_device_update_properties
int pw_impl_device_update_properties(struct pw_impl_device *device, const struct spa_dict *dict)
Definition: impl-device.c:903
pw_impl_device_get_properties
const struct pw_properties * pw_impl_device_get_properties(struct pw_impl_device *device)
Definition: impl-device.c:897
properties.h
resource.h
data
user data to add to an object
Definition: filter.c:75
device
Definition: alsa-monitor.c:82
filter
Definition: filter.c:126
param
Definition: filter.c:80
pw_device_info
The device information.
Definition: pipewire/src/pipewire/device.h:43
pw_impl_device_events
Device events, listen to them with pw_impl_device_add_listener.
Definition: impl-device.h:56
pw_impl_device_events::free
void(* free)(void *data)
the device is freed
Definition: impl-device.h:63
pw_impl_device_events::destroy
void(* destroy)(void *data)
the device is destroyed
Definition: impl-device.h:61
pw_impl_device_events::initialized
void(* initialized)(void *data)
the device is initialized
Definition: impl-device.h:65
pw_impl_device_events::version
uint32_t version
Definition: impl-device.h:58
pw_impl_device_events::info_changed
void(* info_changed)(void *data, const struct pw_device_info *info)
the device info changed
Definition: impl-device.h:68
pw_properties
Definition: properties.h:49
spa_device
Definition: build/doc/spa/monitor/device.h:53
spa_dict
Definition: utils/dict.h:48
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