PipeWire 1.6.8

Loading...
Searching...
No Matches
profiler.h
Go to the documentation of this file.
1/* PipeWire */
2/* SPDX-FileCopyrightText: Copyright © 2020 Wim Taymans */
3/* SPDX-License-Identifier: MIT */
4
5#ifndef PIPEWIRE_EXT_PROFILER_H
6#define PIPEWIRE_EXT_PROFILER_H
7
8#include <spa/utils/defs.h>
9
10#ifdef __cplusplus
11 extern "C" {
12#endif
13
17
22#define PW_TYPE_INTERFACE_Profiler PW_TYPE_INFO_INTERFACE_BASE "Profiler"
23
24#define PW_VERSION_PROFILER 3
25 struct pw_profiler;
26
27#ifndef PW_API_PROFILER
28#define PW_API_PROFILER static inline
29#endif
30
31#define PW_EXTENSION_MODULE_PROFILER PIPEWIRE_MODULE_PREFIX "module-profiler"
32
33#define PW_PROFILER_PERM_MASK PW_PERM_R
34
35#define PW_PROFILER_EVENT_PROFILE 0
36#define PW_PROFILER_EVENT_NUM 1
37
39 struct pw_profiler_events {
40#define PW_VERSION_PROFILER_EVENTS 0
41 uint32_t version;
42
43 void (*profile) (void *data, const struct spa_pod *pod);
44};
45
46#define PW_PROFILER_METHOD_ADD_LISTENER 0
47#define PW_PROFILER_METHOD_NUM 1
48
50 struct pw_profiler_methods {
51#define PW_VERSION_PROFILER_METHODS 0
52 uint32_t version;
53
54 int (*add_listener) (void *object,
55 struct spa_hook *listener,
56 const struct pw_profiler_events *events,
57 void *data);
58};
59
62 PW_API_PROFILER int pw_profiler_add_listener(struct pw_profiler *object,
63 struct spa_hook *listener,
64 const struct pw_profiler_events *events,
65 void *data)
66{
67 return spa_api_method_r(int, -ENOTSUP,
68 pw_profiler, (struct spa_interface*)object, add_listener, 0,
69 listener, events, data);
70}
71
72#define PW_KEY_PROFILER_NAME "profiler.name"
73
75
77
78#ifdef __cplusplus
79} /* extern "C" */
80#endif
81
82#endif /* PIPEWIRE_EXT_PROFILER_H */
defs.h
spa/utils/defs.h
PW_API_PROFILER
#define PW_API_PROFILER
Definition profiler.h:36
pw_profiler_add_listener
PW_API_PROFILER int pw_profiler_add_listener(struct pw_profiler *object, struct spa_hook *listener, const struct pw_profiler_events *events, void *data)
Definition profiler.h:78
spa_api_method_r
#define spa_api_method_r(rtype, def, type, o, method, version,...)
Definition hook.h:291
pw_profiler_events
Profiler events
Definition profiler.h:51
pw_profiler_events::version
uint32_t version
Definition profiler.h:54
pw_profiler_events::profile
void(* profile)(void *data, const struct spa_pod *pod)
Definition profiler.h:56
pw_profiler_methods
Profiler methods
Definition profiler.h:65
pw_profiler_methods::add_listener
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_profiler_events *events, void *data)
Definition profiler.h:70
pw_profiler
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:427
spa_interface
Definition hook.h:148
spa_pod
Definition pod.h:57