PipeWire 1.6.8

Loading...
Searching...
No Matches
impl-device.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_DEVICE_H
6#define PIPEWIRE_IMPL_DEVICE_H
7
8#ifdef __cplusplus
9 extern "C" {
10#endif
11
21
26 struct pw_impl_device;
27
28#include <spa/monitor/device.h>
29
30#include <pipewire/context.h>
31#include <pipewire/global.h>
32#include <pipewire/properties.h>
33#include <pipewire/resource.h>
34
36 struct pw_impl_device_events {
37#define PW_VERSION_IMPL_DEVICE_EVENTS 0
38 uint32_t version;
39
41 void (*destroy) (void *data);
43 void (*free) (void *data);
45 void (*initialized) (void *data);
46
48 void (*info_changed) (void *data, const struct pw_device_info *info);
49};
50
51 struct pw_impl_device *pw_context_create_device(struct pw_context *context,
52 struct pw_properties *properties,
53 size_t user_data_size);
54
55 int pw_impl_device_register(struct pw_impl_device *device,
56 struct pw_properties *properties);
57
58 void pw_impl_device_destroy(struct pw_impl_device *device);
59
60 void *pw_impl_device_get_user_data(struct pw_impl_device *device);
61
63 int pw_impl_device_set_implementation(struct pw_impl_device *device, struct spa_device *spa_device);
65 struct spa_device *pw_impl_device_get_implementation(struct pw_impl_device *device);
66
68 struct pw_global *pw_impl_device_get_global(struct pw_impl_device *device);
69
71 void pw_impl_device_add_listener(struct pw_impl_device *device,
72 struct spa_hook *listener,
73 const struct pw_impl_device_events *events,
74 void *data);
75
76 int pw_impl_device_update_properties(struct pw_impl_device *device, const struct spa_dict *dict);
77
78 const struct pw_properties *pw_impl_device_get_properties(struct pw_impl_device *device);
79
80 int pw_impl_device_for_each_param(struct pw_impl_device *device,
81 int seq, uint32_t param_id,
82 uint32_t index, uint32_t max,
83 const struct spa_pod *filter,
84 int (*callback) (void *data, int seq,
85 uint32_t id, uint32_t index, uint32_t next,
86 struct spa_pod *param),
87 void *data);
91
92#ifdef __cplusplus
93}
94#endif
95
96#endif /* PIPEWIRE_IMPL_DEVICE_H */
global.h
pipewire/global.h
seq
uint32_t int seq
Definition core.h:432
pw_impl_device_get_user_data
void * pw_impl_device_get_user_data(struct pw_impl_device *device)
Definition impl-device.c:1022
pw_impl_device_destroy
void pw_impl_device_destroy(struct pw_impl_device *device)
Definition impl-device.c:222
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:1002
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:973
pw_impl_device_get_properties
const struct pw_properties * pw_impl_device_get_properties(struct pw_impl_device *device)
Definition impl-device.c:1008
pw_impl_device_register
int pw_impl_device_register(struct pw_impl_device *device, struct pw_properties *properties)
Definition impl-device.c:593
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:1034
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:1028
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:321
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:1014
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:170
properties.h
pipewire/properties.h
resource.h
pipewire/resource.h
device.h
spa/monitor/device.h
context.h
pipewire/context.h
pw_context
pw_device_info
The device information.
Definition device.h:47
pw_global
pw_impl_device_events
Device events, listen to them with pw_impl_device_add_listener.
Definition impl-device.h:41
pw_impl_device_events::destroy
void(* destroy)(void *data)
the device is destroyed
Definition impl-device.h:47
pw_impl_device_events::initialized
void(* initialized)(void *data)
the device is initialized
Definition impl-device.h:51
pw_impl_device_events::version
uint32_t version
Definition impl-device.h:44
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:54
pw_impl_device
pw_properties
Definition properties.h:39
spa_device
Definition device.h:50
spa_dict
Definition dict.h:51
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