PipeWire  0.1.8
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 
52 struct pw_global;
53 
54 #include <pipewire/core.h>
55 #include <pipewire/client.h>
56 #include <pipewire/properties.h>
57 
59 typedef int (*pw_bind_func_t) (struct pw_global *global,
60  struct pw_client *client,
61  uint32_t permissions,
62  uint32_t version,
63  uint32_t id );
64 
66 struct pw_global *
67 pw_global_new(struct pw_core *core,
68  uint32_t type,
69  uint32_t version,
70  struct pw_properties *properties,
71  pw_bind_func_t bind,
72  void *object );
73 
75 int pw_global_register(struct pw_global *global,
76  struct pw_client *owner,
77  struct pw_global *parent);
78 
80 uint32_t pw_global_get_permissions(struct pw_global *global, struct pw_client *client);
81 
83 struct pw_core *pw_global_get_core(struct pw_global *global);
84 
86 struct pw_client *pw_global_get_owner(struct pw_global *global);
87 
89 struct pw_global *pw_global_get_parent(struct pw_global *global);
90 
92 uint32_t pw_global_get_type(struct pw_global *global);
93 
95 uint32_t pw_global_get_version(struct pw_global *global);
96 
98 const struct pw_properties *pw_global_get_properties(struct pw_global *global);
99 
102 void *pw_global_get_object(struct pw_global *global);
103 
105 uint32_t pw_global_get_id(struct pw_global *global);
106 
108 int pw_global_bind(struct pw_global *global,
109  struct pw_client *client,
110  uint32_t permissions,
111  uint32_t version,
112  uint32_t id);
113 
115 void pw_global_destroy(struct pw_global *global);
116 
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 #endif /* __PIPEWIRE_GLOBAL_H__ */
A collection of key/value pairs.
Definition: properties.h:38
struct pw_global * pw_global_get_parent(struct pw_global *global)
Get the parent of a global.
Definition: global.c:154
the core PipeWire object
int(* pw_bind_func_t)(struct pw_global *global, struct pw_client *client, uint32_t permissions, uint32_t version, uint32_t id)
The function to let a client bind to a global.
Definition: global.h:59
uint32_t pw_global_get_version(struct pw_global *global)
Get the global version.
Definition: global.c:164
uint32_t pw_global_get_type(struct pw_global *global)
Get the global type.
Definition: global.c:159
int pw_global_register(struct pw_global *global, struct pw_client *owner, struct pw_global *parent)
register a global to the core registry
Definition: global.c:104
uint32_t pw_global_get_id(struct pw_global *global)
Get the unique id of the global.
Definition: global.c:179
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:198
PipeWire client object class.
void pw_global_destroy(struct pw_global *global)
Destroy a global.
Definition: global.c:234
uint32_t pw_global_get_permissions(struct pw_global *global, struct pw_client *client)
Get the permissions of the global for a given client.
Definition: global.c:38
struct pw_core * pw_global_get_core(struct pw_global *global)
Get the core object of this global.
Definition: global.c:144
struct pw_client * pw_global_get_owner(struct pw_global *global)
Get the owner of the global.
Definition: global.c:149
A global object visible to remote clients.
struct pw_global * pw_global_new(struct pw_core *core, uint32_t type, uint32_t version, struct pw_properties *properties, pw_bind_func_t bind, void *object)
Create a new global.
Definition: global.c:64
void * pw_global_get_object(struct pw_global *global)
Get the object associated with the global.
Definition: global.c:174
const struct pw_properties * pw_global_get_properties(struct pw_global *global)
Get the global properties.
Definition: global.c:169