PipeWire: profiler.h Source File

PipeWire 0.3.71

Loading...
Searching...
No Matches
src/pipewire/extensions/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#define PW_EXTENSION_MODULE_PROFILER PIPEWIRE_MODULE_PREFIX "module-profiler"
28
29#define PW_PROFILER_EVENT_PROFILE 0
30#define PW_PROFILER_EVENT_NUM 1
31
33struct pw_profiler_events {
34#define PW_VERSION_PROFILER_EVENTS 0
35 uint32_t version;
36
37 void (*profile) (void *data, const struct spa_pod *pod);
38};
39
40#define PW_PROFILER_METHOD_ADD_LISTENER 0
41#define PW_PROFILER_METHOD_NUM 1
42
44struct pw_profiler_methods {
45#define PW_VERSION_PROFILER_METHODS 0
46 uint32_t version;
47
48 int (*add_listener) (void *object,
49 struct spa_hook *listener,
50 const struct pw_profiler_events *events,
51 void *data);
52};
53
54#define pw_profiler_method(o,method,version,...) \
55({ \
56 int _res = -ENOTSUP; \
57 spa_interface_call_res((struct spa_interface*)o, \
58 struct pw_profiler_methods, _res, \
59 method, version, ##__VA_ARGS__); \
60 _res; \
61})
62
63#define pw_profiler_add_listener(c,...) pw_profiler_method(c,add_listener,0,__VA_ARGS__)
64
65#define PW_KEY_PROFILER_NAME "profiler.name"
66
71#ifdef __cplusplus
72} /* extern "C" */
73#endif
74
75#endif /* PIPEWIRE_EXT_PROFILER_H */
defs.h
spa/utils/defs.h
pw_profiler_events
Profiler events
Definition src/pipewire/extensions/profiler.h:43
pw_profiler_events::version
uint32_t version
Definition src/pipewire/extensions/profiler.h:46
pw_profiler_events::profile
void(* profile)(void *data, const struct spa_pod *pod)
Definition src/pipewire/extensions/profiler.h:48
pw_profiler_methods
Profiler methods
Definition src/pipewire/extensions/profiler.h:57
pw_profiler_methods::add_listener
int(* add_listener)(void *object, struct spa_hook *listener, const struct pw_profiler_events *events, void *data)
Definition src/pipewire/extensions/profiler.h:62
pw_profiler
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:350
spa_pod
Definition pod/pod.h:43