PipeWire: pipewire/impl-client.h Source File

PipeWire 1.2.4

Loading...
Searching...
No Matches
impl-client.h
Go to the documentation of this file.
1/* PipeWire */
2/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
3/* SPDX-License-Identifier: MIT */
4
5#ifndef PIPEWIRE_IMPL_CLIENT_H
6#define PIPEWIRE_IMPL_CLIENT_H
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12#include <spa/utils/hook.h>
13
63struct pw_impl_client;
64
65#include <pipewire/context.h>
66#include <pipewire/global.h>
67#include <pipewire/properties.h>
68#include <pipewire/resource.h>
69#include <pipewire/permission.h>
70
72struct pw_impl_client_events {
73#define PW_VERSION_IMPL_CLIENT_EVENTS 0
74 uint32_t version;
75
77 void (*destroy) (void *data);
78
80 void (*free) (void *data);
81
83 void (*initialized) (void *data);
84
86 void (*info_changed) (void *data, const struct pw_client_info *info);
87
89 void (*resource_added) (void *data, struct pw_resource *resource);
90
92 void (*resource_removed) (void *data, struct pw_resource *resource);
93
97 void (*busy_changed) (void *data, bool busy);
98};
99
101struct pw_impl_client *
102 pw_context_create_client(struct pw_impl_core *core,
103 struct pw_protocol *protocol,
104 struct pw_properties *properties,
105 size_t user_data_size );
106
108void pw_impl_client_destroy(struct pw_impl_client *client);
109
111int pw_impl_client_register(struct pw_impl_client *client,
112 struct pw_properties *properties);
113
115void *pw_impl_client_get_user_data(struct pw_impl_client *client);
116
118const struct pw_client_info *pw_impl_client_get_info(struct pw_impl_client *client);
119
121int pw_impl_client_update_properties(struct pw_impl_client *client, const struct spa_dict *dict);
122
124int pw_impl_client_update_permissions(struct pw_impl_client *client, uint32_t n_permissions,
125 const struct pw_permission *permissions);
126
128int pw_impl_client_check_permissions(struct pw_impl_client *client,
129 uint32_t global_id, uint32_t permissions);
130
132const struct pw_properties *pw_impl_client_get_properties(struct pw_impl_client *client);
133
135struct pw_context *pw_impl_client_get_context(struct pw_impl_client *client);
137struct pw_protocol *pw_impl_client_get_protocol(struct pw_impl_client *client);
138
140struct pw_resource *pw_impl_client_get_core_resource(struct pw_impl_client *client);
141
143struct pw_resource *pw_impl_client_find_resource(struct pw_impl_client *client, uint32_t id);
144
146struct pw_global *pw_impl_client_get_global(struct pw_impl_client *client);
147
149struct pw_mempool *pw_impl_client_get_mempool(struct pw_impl_client *client);
150
152void pw_impl_client_add_listener(struct pw_impl_client *client,
153 struct spa_hook *listener,
154 const struct pw_impl_client_events *events,
155 void *data);
156
157
160void pw_impl_client_set_busy(struct pw_impl_client *client, bool busy);
161
166#ifdef __cplusplus
167}
168#endif
169
170#endif /* PIPEWIRE_IMPL_CLIENT_H */
global.h
pipewire/global.h
pw_impl_client_get_user_data
void * pw_impl_client_get_user_data(struct pw_impl_client *client)
Get the client user data.
Definition impl-client.c:614
pw_impl_client_destroy
void pw_impl_client_destroy(struct pw_impl_client *client)
Destroy a previously created client.
Definition impl-client.c:660
pw_impl_client_add_listener
void pw_impl_client_add_listener(struct pw_impl_client *client, struct spa_hook *listener, const struct pw_impl_client_events *events, void *data)
listen to events from this client
Definition impl-client.c:687
pw_impl_client_set_busy
void pw_impl_client_set_busy(struct pw_impl_client *client, bool busy)
Mark the client busy.
Definition impl-client.c:790
pw_impl_client_check_permissions
int pw_impl_client_check_permissions(struct pw_impl_client *client, uint32_t global_id, uint32_t permissions)
check if a client has permissions for global_id, Since 0.3.9
Definition impl-client.c:800
pw_impl_client_get_protocol
struct pw_protocol * pw_impl_client_get_protocol(struct pw_impl_client *client)
Get the protocol used to create this client.
Definition impl-client.c:578
pw_impl_client_get_mempool
struct pw_mempool * pw_impl_client_get_mempool(struct pw_impl_client *client)
Get the mempool associated with this client, Since 0.3.74.
Definition impl-client.c:602
pw_impl_client_update_permissions
int pw_impl_client_update_permissions(struct pw_impl_client *client, uint32_t n_permissions, const struct pw_permission *permissions)
Update the client permissions.
Definition impl-client.c:720
pw_context_create_client
struct pw_impl_client * pw_context_create_client(struct pw_impl_core *core, struct pw_protocol *protocol, struct pw_properties *properties, size_t user_data_size)
Create a new client.
Definition impl-client.c:431
pw_impl_client_register
int pw_impl_client_register(struct pw_impl_client *client, struct pw_properties *properties)
Finish configuration and register a client.
Definition impl-client.c:519
pw_impl_client_get_info
const struct pw_client_info * pw_impl_client_get_info(struct pw_impl_client *client)
Get the client information.
Definition impl-client.c:696
pw_impl_client_get_properties
const struct pw_properties * pw_impl_client_get_properties(struct pw_impl_client *client)
Get the client properties.
Definition impl-client.c:608
pw_impl_client_update_properties
int pw_impl_client_update_properties(struct pw_impl_client *client, const struct spa_dict *dict)
Update the client properties.
Definition impl-client.c:712
pw_impl_client_get_context
struct pw_context * pw_impl_client_get_context(struct pw_impl_client *client)
Get the context used to create this client.
Definition impl-client.c:572
pw_impl_client_find_resource
struct pw_resource * pw_impl_client_find_resource(struct pw_impl_client *client, uint32_t id)
Get a resource with the given id.
Definition impl-client.c:590
pw_impl_client_get_global
struct pw_global * pw_impl_client_get_global(struct pw_impl_client *client)
Get the global associated with this client.
Definition impl-client.c:596
pw_impl_client_get_core_resource
struct pw_resource * pw_impl_client_get_core_resource(struct pw_impl_client *client)
Get the client core resource.
Definition impl-client.c:584
hook.h
spa/utils/hook.h
permission.h
pipewire/permission.h
properties.h
pipewire/properties.h
resource.h
pipewire/resource.h
context.h
pipewire/context.h
pw_client_info
The client information.
Definition client.h:46
pw_context
pw_global
pw_impl_client_events
The events that a client can emit.
Definition impl-client.h:77
pw_impl_client_events::busy_changed
void(* busy_changed)(void *data, bool busy)
emitted when the client becomes busy processing an asynchronous message.
Definition impl-client.h:103
pw_impl_client_events::version
uint32_t version
Definition impl-client.h:80
pw_impl_client_events::initialized
void(* initialized)(void *data)
the client is initialized
Definition impl-client.h:89
pw_impl_client_events::resource_added
void(* resource_added)(void *data, struct pw_resource *resource)
emitted when a new resource is added for client
Definition impl-client.h:95
pw_impl_client_events::info_changed
void(* info_changed)(void *data, const struct pw_client_info *info)
emitted when the client info changed
Definition impl-client.h:92
pw_impl_client_events::destroy
void(* destroy)(void *data)
emitted when the client is destroyed
Definition impl-client.h:83
pw_impl_client_events::free
void(* free)(void *data)
emitted right before the client is freed
Definition impl-client.h:86
pw_impl_client_events::resource_removed
void(* resource_removed)(void *data, struct pw_resource *resource)
emitted when a resource is removed
Definition impl-client.h:98
pw_impl_client
pw_impl_core
pw_mempool
A memory pool is a collection of pw_memblocks.
Definition mem.h:58
pw_permission
Definition permission.h:69
pw_properties
Definition properties.h:34
pw_protocol
pw_resource
spa_dict
Definition dict.h:39
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition hook.h:350