impl-client.h
Go to the documentation of this file.
/* PipeWire
*
* Copyright © 2018 Wim Taymans
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef PIPEWIRE_IMPL_CLIENT_H
#define PIPEWIRE_IMPL_CLIENT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <spa/utils/hook.h>
struct pw_impl_client;
#include <pipewire/context.h>
#include <pipewire/global.h>
#include <pipewire/properties.h>
#include <pipewire/resource.h>
#include <pipewire/permission.h>
struct pw_impl_client_events {
#define PW_VERSION_IMPL_CLIENT_EVENTS 0
uint32_t version;
void (*destroy) (void *data);
void (*free) (void *data);
void (*initialized) (void *data);
void (*info_changed) (void *data, const struct pw_client_info *info);
void (*resource_added) (void *data, struct pw_resource *resource);
void (*resource_removed) (void *data, struct pw_resource *resource);
void (*busy_changed) (void *data, bool busy);
};
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 );
void pw_impl_client_destroy(struct pw_impl_client *client);
int pw_impl_client_register(struct pw_impl_client *client,
struct pw_properties *properties);
void *pw_impl_client_get_user_data(struct pw_impl_client *client);
const struct pw_client_info *pw_impl_client_get_info(struct pw_impl_client *client);
int pw_impl_client_update_properties(struct pw_impl_client *client, const struct spa_dict *dict);
int pw_impl_client_update_permissions(struct pw_impl_client *client, uint32_t n_permissions,
const struct pw_permission *permissions);
int pw_impl_client_check_permissions(struct pw_impl_client *client,
uint32_t global_id, uint32_t permissions);
const struct pw_properties *pw_impl_client_get_properties(struct pw_impl_client *client);
struct pw_context *pw_impl_client_get_context(struct pw_impl_client *client);
struct pw_protocol *pw_impl_client_get_protocol(struct pw_impl_client *client);
struct pw_resource *pw_impl_client_get_core_resource(struct pw_impl_client *client);
struct pw_resource *pw_impl_client_find_resource(struct pw_impl_client *client, uint32_t id);
struct pw_global *pw_impl_client_get_global(struct pw_impl_client *client);
void pw_impl_client_add_listener(struct pw_impl_client *client,
struct spa_hook *listener,
const struct pw_impl_client_events *events,
void *data);
void pw_impl_client_set_busy(struct pw_impl_client *client, bool busy);
#ifdef __cplusplus
}
#endif
#endif /* PIPEWIRE_IMPL_CLIENT_H */
context.h
pipewire/context.h
global.h
pipewire/global.h
pw_impl_client_destroy
void pw_impl_client_destroy(struct pw_impl_client *client)
Destroy a previously created client.
Definition: impl-client.c:593
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:629
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:732
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:538
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:638
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:742
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:399
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:662
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:550
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:574
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:568
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:544
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:486
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:654
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:562
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:556
hook.h
spa/utils/hook.h
permission.h
pipewire/permission.h
properties.h
pipewire/properties.h
resource.h
pipewire/resource.h
pw_client_info
The client information.
Definition: client.h:63
pw_context
pw_global
Definition: context.h:67
pw_impl_client_events
The events that a client can emit.
Definition: impl-client.h:95
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:121
pw_impl_client_events::version
uint32_t version
Definition: impl-client.h:98
pw_impl_client_events::initialized
void(* initialized)(void *data)
the client is initialized
Definition: impl-client.h:107
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:113
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:110
pw_impl_client_events::destroy
void(* destroy)(void *data)
emitted when the client is destroyed
Definition: impl-client.h:101
pw_impl_client_events::free
void(* free)(void *data)
emitted right before the client is freed
Definition: impl-client.h:104
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:116
pw_impl_client
pw_impl_core
pw_permission
Definition: permission.h:80
pw_properties
Definition: properties.h:53
pw_protocol
pw_resource
Definition: impl.h:49
spa_dict
Definition: dict.h:59
spa_hook
A hook, contains the structure with functions and the data passed to the functions.
Definition: hook.h:342