PipeWire  0.1.4
global.h
Go to the documentation of this file.
1 /* PipeWire
2  * Copyright (C) 2017 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_GLOBAL_H__
21 #define __PIPEWIRE_GLOBAL_H__
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
49 struct pw_global;
50 
51 #include <pipewire/core.h>
52 #include <pipewire/client.h>
53 
54 typedef int (*pw_bind_func_t) (struct pw_global *global,
55  struct pw_client *client,
56  uint32_t permissions,
57  uint32_t version,
58  uint32_t id );
59 
60 struct pw_global *
62  struct pw_client *owner,
63  struct pw_global *parent,
64  uint32_t type,
65  uint32_t version,
67  void *object);
68 
69 uint32_t pw_global_get_permissions(struct pw_global *global, struct pw_client *client);
70 
71 struct pw_core *pw_global_get_core(struct pw_global *global);
72 
73 struct pw_client *pw_global_get_owner(struct pw_global *global);
74 
75 struct pw_global *pw_global_get_parent(struct pw_global *global);
76 
77 uint32_t pw_global_get_type(struct pw_global *global);
78 
79 uint32_t pw_global_get_version(struct pw_global *global);
80 
81 void *pw_global_get_object(struct pw_global *global);
82 
83 uint32_t pw_global_get_id(struct pw_global *global);
84 
85 int
86 pw_global_bind(struct pw_global *global,
87  struct pw_client *client,
88  uint32_t permissions,
89  uint32_t version,
90  uint32_t id);
91 
92 void pw_global_destroy(struct pw_global *global);
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif /* __PIPEWIRE_GLOBAL_H__ */
struct pw_global * pw_core_add_global(struct pw_core *core, struct pw_client *owner, struct pw_global *parent, uint32_t type, uint32_t version, pw_bind_func_t bind, void *object)
Create and add a new global to the core.
Definition: global.c:61
uint32_t type
type of interface
Definition: private.h:96
pw_bind_func_t bind
function to bind to the interface
Definition: private.h:98
struct pw_global * pw_global_get_parent(struct pw_global *global)
Definition: global.c:127
struct pw_client * owner
the owner of this object, NULL when the PipeWire server is the owner
Definition: private.h:89
int(* pw_bind_func_t)(struct pw_global *global, struct pw_client *client, uint32_t permissions, uint32_t version, uint32_t id)
Definition: global.h:54
A global object visible to all clients.
Definition: private.h:87
uint32_t pw_global_get_version(struct pw_global *global)
Definition: global.c:137
uint32_t pw_global_get_type(struct pw_global *global)
Definition: global.c:132
PipeWire client object class.
Definition: private.h:58
uint32_t pw_global_get_id(struct pw_global *global)
Definition: global.c:147
struct pw_global * parent
parent global
Definition: private.h:94
uint32_t pw_global_get_permissions(struct pw_global *global, struct pw_client *client)
Definition: global.c:36
struct pw_core * pw_global_get_core(struct pw_global *global)
Definition: global.c:116
struct pw_client * pw_global_get_owner(struct pw_global *global)
Definition: global.c:122
void * pw_global_get_object(struct pw_global *global)
Definition: global.c:142
int pw_global_bind(struct pw_global *global, struct pw_client *client, uint32_t permissions, uint32_t version, uint32_t id)
Bind to a global.
Definition: global.c:166
void pw_global_destroy(struct pw_global *global)
Destroy a global.
Definition: global.c:202
the core PipeWire object
Definition: private.h:103
struct pw_core * core
the core
Definition: private.h:88