global.h
Go to the documentation of this file.
/* PipeWire
* Copyright (C) 2017 Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __PIPEWIRE_GLOBAL_H__
#define __PIPEWIRE_GLOBAL_H__
#ifdef __cplusplus
extern "C" {
#endif
struct pw_global;
#include <pipewire/core.h>
#include <pipewire/client.h>
#include <pipewire/properties.h>
struct pw_global_events {
#define PW_VERSION_GLOBAL_EVENTS 1
uint32_t version;
void (*destroy) (void *data);
void (*free) (void *data);
/* bind the global */
void (*bind) (void *data,
struct pw_client *client,
uint32_t permissions,
uint32_t version,
uint32_t id );
/* permissions for the global changed, Since version 1 */
void (*permissions_changed) (void *data,
struct pw_client *client,
uint32_t old_permissions,
uint32_t new_permissions);
};
struct pw_global *
pw_global_new(struct pw_core *core,
uint32_t type,
uint32_t version,
struct pw_properties *properties,
void *object );
int pw_global_register(struct pw_global *global,
struct pw_client *owner,
struct pw_global *parent);
void pw_global_add_listener(struct pw_global *global,
struct spa_hook *listener,
const struct pw_global_events *events,
void *data);
uint32_t pw_global_get_permissions(struct pw_global *global, struct pw_client *client);
struct pw_core *pw_global_get_core(struct pw_global *global);
struct pw_client *pw_global_get_owner(struct pw_global *global);
struct pw_global *pw_global_get_parent(struct pw_global *global);
uint32_t pw_global_get_type(struct pw_global *global);
uint32_t pw_global_get_version(struct pw_global *global);
const struct pw_properties *pw_global_get_properties(struct pw_global *global);
void *pw_global_get_object(struct pw_global *global);
uint32_t pw_global_get_id(struct pw_global *global);
int pw_global_bind(struct pw_global *global,
struct pw_client *client,
uint32_t permissions,
uint32_t version,
uint32_t id);
void pw_global_destroy(struct pw_global *global);
#ifdef __cplusplus
}
#endif
#endif /* __PIPEWIRE_GLOBAL_H__ */
pw_properties
A collection of key/value pairs.
Definition: properties.h:38
pw_global_events::version
uint32_t version
Definition: global.h:61
pw_global_destroy
void pw_global_destroy(struct pw_global *global)
Destroy a global.
pw_global_bind
int pw_global_bind(struct pw_global *global, struct pw_client *client, uint32_t permissions, uint32_t version, uint32_t id)
Let a client bind to a global.
pw_global_get_parent
struct pw_global * pw_global_get_parent(struct pw_global *global)
Get the parent of a global.
Definition: global.c:154
core.h
pw_core
the core PipeWire object
pw_global_get_version
uint32_t pw_global_get_version(struct pw_global *global)
Get the global version.
Definition: global.c:166
pw_global_get_type
uint32_t pw_global_get_type(struct pw_global *global)
Get the global type.
Definition: global.c:160
pw_global_events::free
void(* free)(void *data)
The global is freed.
Definition: global.h:67
pw_global_get_id
uint32_t pw_global_get_id(struct pw_global *global)
Get the unique id of the global.
Definition: global.c:184
pw_global_add_listener
void pw_global_add_listener(struct pw_global *global, struct spa_hook *listener, const struct pw_global_events *events, void *data)
Add an event listener on the global.
Definition: global.c:190
pw_global_events::destroy
void(* destroy)(void *data)
The global is destroyed.
Definition: global.h:64
pw_global_events::permissions_changed
void(* permissions_changed)(void *data, struct pw_client *client, uint32_t old_permissions, uint32_t new_permissions)
Definition: global.h:77
pw_client
PipeWire client object class.
pw_global_register
int pw_global_register(struct pw_global *global, struct pw_client *owner, struct pw_global *parent)
Register a global object to the core registry.
pw_global_get_permissions
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:37
pw_global_new
struct pw_global * pw_global_new(struct pw_core *core, uint32_t type, uint32_t version, struct pw_properties *properties, void *object)
Create a new global object.
pw_global_get_core
struct pw_core * pw_global_get_core(struct pw_global *global)
Get the core object of this global.
Definition: global.c:142
properties.h
pw_global_get_owner
struct pw_client * pw_global_get_owner(struct pw_global *global)
Get the owner of the global.
Definition: global.c:148
pw_global_events
Global events, use pw_global_add_listener.
Definition: global.h:59
pw_global
A global object visible to remote clients.
pw_global_get_object
void * pw_global_get_object(struct pw_global *global)
Get the object associated with the global.
Definition: global.c:178
pw_global_events::bind
void(* bind)(void *data, struct pw_client *client, uint32_t permissions, uint32_t version, uint32_t id)
Definition: global.h:70
pw_global_get_properties
const struct pw_properties * pw_global_get_properties(struct pw_global *global)
Get the global properties.
Definition: global.c:172
client.h