PipeWire  0.1.5.1
type.h
Go to the documentation of this file.
1 /* PipeWire
2  * Copyright (C) 2015 Wim Taymans <wim.taymans@gmail.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef __PIPEWIRE_TYPE_H__
21 #define __PIPEWIRE_TYPE_H__
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include <spa/type-map.h>
28 #include <spa/event-node.h>
29 #include <spa/command-node.h>
30 #include <spa/monitor.h>
31 #include <spa/param-alloc.h>
32 
33 #include <pipewire/map.h>
34 
35 #define PW_TYPE_BASE "PipeWire:"
36 
37 #define PW_TYPE__Object PW_TYPE_BASE "Object"
38 #define PW_TYPE_OBJECT_BASE PW_TYPE__Object ":"
39 
40 #define PW_TYPE__Interface PW_TYPE_BASE "Interface"
41 #define PW_TYPE_INTERFACE_BASE PW_TYPE__Interface ":"
42 
48 struct pw_type {
49  struct spa_type_map *map;
51  uint32_t core;
52  uint32_t registry;
53  uint32_t node;
54  uint32_t factory;
55  uint32_t link;
56  uint32_t client;
57  uint32_t module;
58 
59  uint32_t spa_log;
60  uint32_t spa_node;
61  uint32_t spa_clock;
62  uint32_t spa_monitor;
63  uint32_t spa_format;
64  uint32_t spa_props;
65 
66  struct spa_type_meta meta;
67  struct spa_type_data data;
68  struct spa_type_event_node event_node;
69  struct spa_type_command_node command_node;
70  struct spa_type_monitor monitor;
71  struct spa_type_param_alloc_buffers param_alloc_buffers;
72  struct spa_type_param_alloc_meta_enable param_alloc_meta_enable;
73  struct spa_type_param_alloc_video_padding param_alloc_video_padding;
74 };
75 
76 void
77 pw_type_init(struct pw_type *type);
78 
79 bool
80 pw_pod_remap_data(uint32_t type, void *body, uint32_t size, struct pw_map *types);
81 
82 static inline bool
83 pw_pod_remap(struct spa_pod *pod, struct pw_map *types)
84 {
85  return pw_pod_remap_data(pod->type, SPA_POD_BODY(pod), pod->size, types);
86 }
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif /* __PIPEWIRE_TYPE_H__ */
uint32_t spa_props
Definition: type.h:64
uint32_t spa_monitor
Definition: type.h:62
uint32_t spa_log
Definition: type.h:59
uint32_t node
Definition: type.h:53
struct spa_type_map * map
the type mapper
Definition: type.h:49
uint32_t core
Definition: type.h:51
uint32_t spa_clock
Definition: type.h:61
uint32_t client
Definition: type.h:56
struct spa_type_command_node command_node
Definition: type.h:69
PipeWire type support struct.
Definition: type.h:48
uint32_t factory
Definition: type.h:54
uint32_t registry
Definition: type.h:52
struct spa_type_monitor monitor
Definition: type.h:70
void pw_type_init(struct pw_type *type)
Initializes the type system.
Definition: type.c:36
uint32_t link
Definition: type.h:55
uint32_t spa_node
Definition: type.h:60
struct spa_type_param_alloc_buffers param_alloc_buffers
Definition: type.h:71
struct spa_type_param_alloc_video_padding param_alloc_video_padding
Definition: type.h:73
uint32_t module
Definition: type.h:57
struct spa_type_meta meta
Definition: type.h:66
bool pw_pod_remap_data(uint32_t type, void *body, uint32_t size, struct pw_map *types)
Definition: type.c:65
struct spa_type_event_node event_node
Definition: type.h:68
struct spa_type_data data
Definition: type.h:67
struct spa_type_param_alloc_meta_enable param_alloc_meta_enable
Definition: type.h:72
uint32_t spa_format
Definition: type.h:63
A map.
Definition: map.h:44