PipeWire 1.4.1
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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#ifdef __cplusplus
9extern "C" {
10#endif
11
12#include <spa/utils/defs.h>
13
22#define PW_TYPE_INTERFACE_Profiler PW_TYPE_INFO_INTERFACE_BASE "Profiler"
23
24#define PW_VERSION_PROFILER 3
25struct pw_profiler;
26
27#ifndef PW_API_PROFILER
28#define PW_API_PROFILER static inline
29#endif
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
39struct 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
51#define PW_VERSION_PROFILER_METHODS 0
52 uint32_t version;
54 int (*add_listener) (void *object,
55 struct spa_hook *listener,
56 const struct pw_profiler_events *events,
57 void *data);
58};
59
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);
71
72#define PW_KEY_PROFILER_NAME "profiler.name"
73
78#ifdef __cplusplus
79} /* extern "C" */
80#endif
81
82#endif /* PIPEWIRE_EXT_PROFILER_H */
spa/utils/defs.h
#define PW_API_PROFILER
Definition profiler.h:36
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
#define spa_api_method_r(rtype, def, type, o, method, version,...)
Definition hook.h:291
Profiler events
Definition profiler.h:51
uint32_t version
Definition profiler.h:54
void(* profile)(void *data, const struct spa_pod *pod)
Definition profiler.h:56
Profiler methods
Definition profiler.h:65
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_profiler_events *events, void *data)
Definition profiler.h:70
uint32_t version
Definition profiler.h:68
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:427
Definition hook.h:148
Definition pod.h:43