PipeWire  0.2.0
client.h File Reference
Include dependency graph for client.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pw_client_events
 The events that a client can emit. More...
 

Macros

#define __USE_GNU
 
#define PW_TYPE__Client   PW_TYPE_OBJECT_BASE "Client"
 
#define PW_TYPE_CLIENT_BASE   PW_TYPE__Client ":"
 
#define PW_VERSION_CLIENT_EVENTS   0
 
#define PW_CLIENT_PROP_PROTOCOL   "pipewire.protocol"
 The name of the protocol used by the client, set by the protocol. More...
 
#define PW_CLIENT_PROP_UCRED_PID   "pipewire.ucred.pid"
 Client pid, set by protocol. More...
 
#define PW_CLIENT_PROP_UCRED_UID   "pipewire.ucred.uid"
 Client uid, set by protocol. More...
 
#define PW_CLIENT_PROP_UCRED_GID   "pipewire.ucred.gid"
 client gid, set by protocol More...
 

Functions

struct pw_clientpw_client_new (struct pw_core *core, struct ucred *ucred, struct pw_properties *properties, size_t user_data_size)
 Create a new client. More...
 
void pw_client_destroy (struct pw_client *client)
 Destroy a previously created client. More...
 
int pw_client_register (struct pw_client *client, struct pw_client *owner, struct pw_global *parent, struct pw_properties *properties)
 Finish configuration and register a client. More...
 
void * pw_client_get_user_data (struct pw_client *client)
 Get the client user data. More...
 
const struct pw_client_infopw_client_get_info (struct pw_client *client)
 Get the client information. More...
 
int pw_client_update_properties (struct pw_client *client, const struct spa_dict *dict)
 Update the client properties. More...
 
int pw_client_update_permissions (struct pw_client *client, const struct spa_dict *dict)
 Update the client permissions. More...
 
const struct pw_propertiespw_client_get_properties (struct pw_client *client)
 Get the client properties. More...
 
struct pw_corepw_client_get_core (struct pw_client *client)
 Get the core used to create this client. More...
 
struct pw_resourcepw_client_get_core_resource (struct pw_client *client)
 Get the client core resource. More...
 
struct pw_resourcepw_client_find_resource (struct pw_client *client, uint32_t id)
 Get a resource with the given id. More...
 
struct pw_globalpw_client_get_global (struct pw_client *client)
 Get the global associated with this client. More...
 
const struct ucred * pw_client_get_ucred (struct pw_client *client)
 Get the ucred from a client or NULL when not specified/valid. More...
 
void pw_client_add_listener (struct pw_client *client, struct spa_hook *listener, const struct pw_client_events *events, void *data)
 listen to events from this client More...
 
void pw_client_set_busy (struct pw_client *client, bool busy)
 Mark the client busy. More...
 

Macro Definition Documentation

◆ __USE_GNU

#define __USE_GNU

◆ PW_CLIENT_PROP_PROTOCOL

#define PW_CLIENT_PROP_PROTOCOL   "pipewire.protocol"

The name of the protocol used by the client, set by the protocol.

◆ PW_CLIENT_PROP_UCRED_GID

#define PW_CLIENT_PROP_UCRED_GID   "pipewire.ucred.gid"

client gid, set by protocol

Referenced by pw_client::pw_client_new().

◆ PW_CLIENT_PROP_UCRED_PID

#define PW_CLIENT_PROP_UCRED_PID   "pipewire.ucred.pid"

Client pid, set by protocol.

Referenced by pw_client::pw_client_new().

◆ PW_CLIENT_PROP_UCRED_UID

#define PW_CLIENT_PROP_UCRED_UID   "pipewire.ucred.uid"

Client uid, set by protocol.

Referenced by pw_client::pw_client_new().

◆ PW_TYPE__Client

#define PW_TYPE__Client   PW_TYPE_OBJECT_BASE "Client"

◆ PW_TYPE_CLIENT_BASE

#define PW_TYPE_CLIENT_BASE   PW_TYPE__Client ":"

◆ PW_VERSION_CLIENT_EVENTS

#define PW_VERSION_CLIENT_EVENTS   0

Function Documentation

◆ pw_client_add_listener()

void pw_client_add_listener ( struct pw_client client,
struct spa_hook *  listener,
const struct pw_client_events events,
void *  data 
)

listen to events from this client

◆ pw_client_destroy()

void pw_client_destroy ( struct pw_client client)

Destroy a previously created client.

◆ pw_client_find_resource()

struct pw_resource* pw_client_find_resource ( struct pw_client client,
uint32_t  id 
)

Get a resource with the given id.

References pw_map::pw_map_lookup().

◆ pw_client_get_core()

struct pw_core* pw_client_get_core ( struct pw_client client)

Get the core used to create this client.

◆ pw_client_get_core_resource()

struct pw_resource* pw_client_get_core_resource ( struct pw_client client)

Get the client core resource.

◆ pw_client_get_global()

struct pw_global* pw_client_get_global ( struct pw_client client)

Get the global associated with this client.

◆ pw_client_get_info()

const struct pw_client_info* pw_client_get_info ( struct pw_client client)

Get the client information.

◆ pw_client_get_properties()

const struct pw_properties* pw_client_get_properties ( struct pw_client client)

Get the client properties.

◆ pw_client_get_ucred()

const struct ucred* pw_client_get_ucred ( struct pw_client client)

Get the ucred from a client or NULL when not specified/valid.

◆ pw_client_get_user_data()

void* pw_client_get_user_data ( struct pw_client client)

Get the client user data.

◆ pw_client_new()

struct pw_client* pw_client_new ( struct pw_core core,
struct ucred *  ucred,
struct pw_properties properties,
size_t  user_data_size 
)

Create a new client.

This is mainly used by protocols.

Parameters
corethe core object
ucredoptional ucred
propertiesclient properties
user_data_sizeextra user data size

◆ pw_client_register()

int pw_client_register ( struct pw_client client,
struct pw_client owner,
struct pw_global parent,
struct pw_properties properties 
)

Finish configuration and register a client.

Parameters
clientthe client to register
owneroptional owner
parentthe client parent
propertiesextra properties

References pw_global_add_listener(), pw_global::pw_global_new(), pw_log::pw_log_debug(), and PW_VERSION_CLIENT.

◆ pw_client_set_busy()

void pw_client_set_busy ( struct pw_client client,
bool  busy 
)

Mark the client busy.

This can be used when an asynchronous operation is started and no further processing is allowed to happen for the client

References pw_log::pw_log_debug().

◆ pw_client_update_permissions()

int pw_client_update_permissions ( struct pw_client client,
const struct spa_dict *  dict 
)

Update the client permissions.

References permissions_update::client, and PW_CORE_PROXY_PERMISSIONS_DEFAULT.

◆ pw_client_update_properties()

int pw_client_update_properties ( struct pw_client client,
const struct spa_dict *  dict 
)

Update the client properties.