PipeWire  0.3.33
build-12775836/doc/spa/debug/node.h
Go to the documentation of this file.
1 /* Simple Plugin API
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 SPA_DEBUG_NODE_H
26 #define SPA_DEBUG_NODE_H
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
37 #include <spa/node/node.h>
38 #include <spa/debug/dict.h>
39 
40 #ifndef spa_debug
41 #define spa_debug(...) ({ fprintf(stderr, __VA_ARGS__);fputc('\n', stderr); })
42 #endif
43 
44 /* static */ inline int spa_debug_port_info(int indent, const struct spa_port_info *info)
45 {
46  spa_debug("%*s" "struct spa_port_info %p:", indent, "", info);
47  spa_debug("%*s" " flags: \t%08" PRIx64, indent, "", info->flags);
48  spa_debug("%*s" " rate: \t%d/%d", indent, "", info->rate.num, info->rate.denom);
49  spa_debug("%*s" " props:", indent, "");
50  if (info->props)
51  spa_debug_dict(indent + 2, info->props);
52  else
53  spa_debug("%*s" " none", indent, "");
54  return 0;
55 }
56 
62 #ifdef __cplusplus
63 } /* extern "C" */
64 #endif
65 
66 #endif /* SPA_DEBUG_NODE_H */
spa_port_info::rate
struct spa_fraction rate
rate of sequence numbers on port
Definition: build-12775836/doc/spa/node/node.h:120
spa_port_info::flags
uint64_t flags
port flags
Definition: build-12775836/doc/spa/node/node.h:119
spa_debug
#define spa_debug(...)
Definition: build-12775836/doc/spa/debug/node.h:41
node.h
dict.h
spa_port_info
Port information structure.
Definition: build-12775836/doc/spa/node/node.h:94
spa_debug_dict
int spa_debug_dict(int indent, const struct spa_dict *dict)
Definition: debug/dict.h:43
spa_fraction::denom
uint32_t denom
Definition: defs.h:106
spa_debug_port_info
int spa_debug_port_info(int indent, const struct spa_port_info *info)
Definition: build-12775836/doc/spa/debug/node.h:44
spa_fraction::num
uint32_t num
Definition: defs.h:105
spa_port_info::props
const struct spa_dict * props
extra port properties
Definition: build-12775836/doc/spa/node/node.h:121