mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
Add owner resource to global and node
Use the resource as the owner for various objects. Work on makeing the client-node an extension
This commit is contained in:
parent
b608599220
commit
fb361706d4
16 changed files with 66 additions and 153 deletions
|
|
@ -63,6 +63,8 @@ struct buffer_id {
|
||||||
struct stream {
|
struct stream {
|
||||||
struct pw_stream this;
|
struct pw_stream this;
|
||||||
|
|
||||||
|
uint32_t type_client_node;
|
||||||
|
|
||||||
uint32_t n_possible_formats;
|
uint32_t n_possible_formats;
|
||||||
struct spa_format **possible_formats;
|
struct spa_format **possible_formats;
|
||||||
|
|
||||||
|
|
@ -203,6 +205,7 @@ struct pw_stream *pw_stream_new(struct pw_context *context,
|
||||||
|
|
||||||
this->context = context;
|
this->context = context;
|
||||||
this->name = strdup(name);
|
this->name = strdup(name);
|
||||||
|
impl->type_client_node = spa_type_map_get_id(context->type.map, PIPEWIRE_TYPE_NODE_BASE "Client");
|
||||||
|
|
||||||
pw_signal_init(&this->destroy_signal);
|
pw_signal_init(&this->destroy_signal);
|
||||||
pw_signal_init(&this->state_changed);
|
pw_signal_init(&this->state_changed);
|
||||||
|
|
@ -904,7 +907,9 @@ pw_stream_connect(struct pw_stream *stream,
|
||||||
pw_properties_set(stream->properties, "pipewire.autoconnect", "1");
|
pw_properties_set(stream->properties, "pipewire.autoconnect", "1");
|
||||||
|
|
||||||
impl->node_proxy = pw_proxy_new(stream->context,
|
impl->node_proxy = pw_proxy_new(stream->context,
|
||||||
SPA_ID_INVALID, stream->context->type.client_node, 0);
|
SPA_ID_INVALID,
|
||||||
|
impl->type_client_node,
|
||||||
|
0);
|
||||||
|
|
||||||
if (impl->node_proxy == NULL)
|
if (impl->node_proxy == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -918,7 +923,8 @@ pw_stream_connect(struct pw_stream *stream,
|
||||||
pw_core_do_create_node(stream->context->core_proxy,
|
pw_core_do_create_node(stream->context->core_proxy,
|
||||||
"client-node",
|
"client-node",
|
||||||
"client-node",
|
"client-node",
|
||||||
&stream->properties->dict, impl->node_proxy->id);
|
&stream->properties->dict,
|
||||||
|
impl->node_proxy->id);
|
||||||
|
|
||||||
do_node_init(stream);
|
do_node_init(stream);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
#include "pipewire/client/type.h"
|
#include "pipewire/client/type.h"
|
||||||
|
|
||||||
#include "pipewire/server/node-factory.h"
|
#include "pipewire/server/node-factory.h"
|
||||||
#include "pipewire/server/client-node.h"
|
|
||||||
|
|
||||||
|
|
||||||
/** Initializes the type system
|
/** Initializes the type system
|
||||||
|
|
@ -45,7 +44,6 @@ void pw_type_init(struct pw_type *type)
|
||||||
type->node_factory = spa_type_map_get_id(type->map, PIPEWIRE_TYPE__NodeFactory);
|
type->node_factory = spa_type_map_get_id(type->map, PIPEWIRE_TYPE__NodeFactory);
|
||||||
type->link = spa_type_map_get_id(type->map, PIPEWIRE_TYPE__Link);
|
type->link = spa_type_map_get_id(type->map, PIPEWIRE_TYPE__Link);
|
||||||
type->client = spa_type_map_get_id(type->map, PIPEWIRE_TYPE__Client);
|
type->client = spa_type_map_get_id(type->map, PIPEWIRE_TYPE__Client);
|
||||||
type->client_node = spa_type_map_get_id(type->map, PIPEWIRE_TYPE__ClientNode);
|
|
||||||
type->module = spa_type_map_get_id(type->map, PIPEWIRE_TYPE__Module);
|
type->module = spa_type_map_get_id(type->map, PIPEWIRE_TYPE__Module);
|
||||||
|
|
||||||
type->spa_log = spa_type_map_get_id(type->map, SPA_TYPE__Log);
|
type->spa_log = spa_type_map_get_id(type->map, SPA_TYPE__Log);
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,6 @@ struct pw_type {
|
||||||
uint32_t node_factory;
|
uint32_t node_factory;
|
||||||
uint32_t link;
|
uint32_t link;
|
||||||
uint32_t client;
|
uint32_t client;
|
||||||
uint32_t client_node;
|
|
||||||
uint32_t module;
|
uint32_t module;
|
||||||
|
|
||||||
uint32_t spa_log;
|
uint32_t spa_log;
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,8 @@ pipewire_module_mixer = shared_library('pipewire-module-mixer', [ 'module-mixer.
|
||||||
dependencies : [mathlib, dl_lib, pipewire_dep, pipewirecore_dep],
|
dependencies : [mathlib, dl_lib, pipewire_dep, pipewirecore_dep],
|
||||||
)
|
)
|
||||||
|
|
||||||
pipewire_module_client_node = shared_library('pipewire-module-client-node', [ 'module-client-node.c' ],
|
pipewire_module_client_node = shared_library('pipewire-module-client-node',
|
||||||
|
[ 'module-client-node.c', 'module-client-node/client-node.c' ],
|
||||||
c_args : pipewire_module_c_args,
|
c_args : pipewire_module_c_args,
|
||||||
include_directories : [configinc, spa_inc],
|
include_directories : [configinc, spa_inc],
|
||||||
link_with : spalib,
|
link_with : spalib,
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@
|
||||||
#include "pipewire/client/interfaces.h"
|
#include "pipewire/client/interfaces.h"
|
||||||
#include "pipewire/server/core.h"
|
#include "pipewire/server/core.h"
|
||||||
#include "pipewire/server/module.h"
|
#include "pipewire/server/module.h"
|
||||||
#include "pipewire/server/client-node.h"
|
|
||||||
|
|
||||||
struct impl {
|
struct impl {
|
||||||
struct pw_core *core;
|
struct pw_core *core;
|
||||||
|
|
@ -35,23 +34,12 @@ struct impl {
|
||||||
struct pw_listener global_added;
|
struct pw_listener global_added;
|
||||||
struct pw_listener global_removed;
|
struct pw_listener global_removed;
|
||||||
|
|
||||||
struct spa_list client_list;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct client_info {
|
|
||||||
struct impl *impl;
|
|
||||||
struct pw_client *client;
|
|
||||||
struct spa_list link;
|
|
||||||
struct pw_listener resource_impl;
|
|
||||||
struct pw_listener resource_removed;
|
|
||||||
struct spa_list node_list;
|
struct spa_list node_list;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct node_info {
|
struct node_info {
|
||||||
struct impl *impl;
|
struct impl *impl;
|
||||||
struct client_info *info;
|
|
||||||
struct pw_node *node;
|
struct pw_node *node;
|
||||||
struct pw_resource *resource;
|
|
||||||
struct spa_list link;
|
struct spa_list link;
|
||||||
struct pw_listener state_changed;
|
struct pw_listener state_changed;
|
||||||
struct pw_listener port_added;
|
struct pw_listener port_added;
|
||||||
|
|
@ -60,28 +48,17 @@ struct node_info {
|
||||||
struct pw_listener link_state_changed;
|
struct pw_listener link_state_changed;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct node_info *find_node_info(struct client_info *cinfo, struct pw_node *node)
|
static struct node_info *find_node_info(struct impl *impl, struct pw_node *node)
|
||||||
{
|
{
|
||||||
struct node_info *info;
|
struct node_info *info;
|
||||||
|
|
||||||
spa_list_for_each(info, &cinfo->node_list, link) {
|
spa_list_for_each(info, &impl->node_list, link) {
|
||||||
if (info->node == node)
|
if (info->node == node)
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct client_info *find_client_info(struct impl *impl, struct pw_client *client)
|
|
||||||
{
|
|
||||||
struct client_info *info;
|
|
||||||
|
|
||||||
spa_list_for_each(info, &impl->client_list, link) {
|
|
||||||
if (info->client == client)
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void node_info_free(struct node_info *info)
|
static void node_info_free(struct node_info *info)
|
||||||
{
|
{
|
||||||
spa_list_remove(&info->link);
|
spa_list_remove(&info->link);
|
||||||
|
|
@ -93,20 +70,6 @@ static void node_info_free(struct node_info *info)
|
||||||
free(info);
|
free(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void client_info_free(struct client_info *cinfo)
|
|
||||||
{
|
|
||||||
struct node_info *info, *tmp;
|
|
||||||
|
|
||||||
spa_list_remove(&cinfo->link);
|
|
||||||
pw_signal_remove(&cinfo->resource_impl);
|
|
||||||
pw_signal_remove(&cinfo->resource_removed);
|
|
||||||
|
|
||||||
spa_list_for_each_safe(info, tmp, &cinfo->node_list, link)
|
|
||||||
node_info_free(info);
|
|
||||||
|
|
||||||
free(cinfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void try_link_port(struct pw_node *node, struct pw_port *port, struct node_info *info);
|
static void try_link_port(struct pw_node *node, struct pw_port *port, struct node_info *info);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -139,14 +102,15 @@ on_link_state_changed(struct pw_listener *listener,
|
||||||
pw_core_notify_error(resource->client->core_resource,
|
pw_core_notify_error(resource->client->core_resource,
|
||||||
resource->id, SPA_RESULT_ERROR, link->error);
|
resource->id, SPA_RESULT_ERROR, link->error);
|
||||||
}
|
}
|
||||||
if (info->info->client) {
|
if (info->node->owner) {
|
||||||
pw_core_notify_error(info->info->client->core_resource,
|
pw_core_notify_error(info->node->owner->client->core_resource,
|
||||||
info->resource->id,
|
info->node->owner->id,
|
||||||
SPA_RESULT_ERROR, link->error);
|
SPA_RESULT_ERROR, link->error);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
case PW_LINK_STATE_UNLINKED:
|
case PW_LINK_STATE_UNLINKED:
|
||||||
pw_log_debug("module %p: link %p: unlinked", impl, link);
|
pw_log_debug("module %p: link %p: unlinked", impl, link);
|
||||||
break;
|
break;
|
||||||
|
|
@ -211,9 +175,9 @@ static void try_link_port(struct pw_node *node, struct pw_port *port, struct nod
|
||||||
|
|
||||||
error:
|
error:
|
||||||
pw_log_error("module %p: can't link node '%s'", impl, error);
|
pw_log_error("module %p: can't link node '%s'", impl, error);
|
||||||
if (info->info->client && info->info->client->core_resource) {
|
if (info->node->owner && info->node->owner->client->core_resource) {
|
||||||
pw_core_notify_error(info->info->client->core_resource,
|
pw_core_notify_error(info->node->owner->client->core_resource,
|
||||||
info->resource->id, SPA_RESULT_ERROR, error);
|
info->node->owner->id, SPA_RESULT_ERROR, error);
|
||||||
}
|
}
|
||||||
free(error);
|
free(error);
|
||||||
return;
|
return;
|
||||||
|
|
@ -252,84 +216,30 @@ on_state_changed(struct pw_listener *listener,
|
||||||
on_node_created(node, info);
|
on_node_created(node, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
on_node_added(struct impl *impl,
|
|
||||||
struct pw_node *node, struct pw_resource *resource, struct client_info *cinfo)
|
|
||||||
{
|
|
||||||
struct node_info *info;
|
|
||||||
|
|
||||||
info = calloc(1, sizeof(struct node_info));
|
|
||||||
info->impl = impl;
|
|
||||||
info->node = node;
|
|
||||||
info->resource = resource;
|
|
||||||
info->info = cinfo;
|
|
||||||
spa_list_insert(cinfo->node_list.prev, &info->link);
|
|
||||||
|
|
||||||
spa_list_init(&info->port_unlinked.link);
|
|
||||||
spa_list_init(&info->link_state_changed.link);
|
|
||||||
pw_signal_add(&node->port_added, &info->port_added, on_port_added);
|
|
||||||
pw_signal_add(&node->port_removed, &info->port_removed, on_port_removed);
|
|
||||||
pw_signal_add(&node->state_changed, &info->state_changed, on_state_changed);
|
|
||||||
|
|
||||||
pw_log_debug("module %p: node %p added", impl, node);
|
|
||||||
|
|
||||||
if (node->info.state > PW_NODE_STATE_CREATING)
|
|
||||||
on_node_created(node, info);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
on_resource_impl(struct pw_listener *listener,
|
|
||||||
struct pw_client *client, struct pw_resource *resource)
|
|
||||||
{
|
|
||||||
struct client_info *cinfo = SPA_CONTAINER_OF(listener, struct client_info, resource_impl);
|
|
||||||
struct impl *impl = cinfo->impl;
|
|
||||||
|
|
||||||
if (resource->type == impl->core->type.client_node) {
|
|
||||||
struct pw_client_node *cnode = resource->object;
|
|
||||||
on_node_added(impl, cnode->node, resource, cinfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
on_resource_removed(struct pw_listener *listener,
|
|
||||||
struct pw_client *client, struct pw_resource *resource)
|
|
||||||
{
|
|
||||||
struct client_info *cinfo =
|
|
||||||
SPA_CONTAINER_OF(listener, struct client_info, resource_removed);
|
|
||||||
struct impl *impl = cinfo->impl;
|
|
||||||
|
|
||||||
if (resource->type == impl->core->type.client_node) {
|
|
||||||
struct pw_client_node *cnode = resource->object;
|
|
||||||
struct node_info *ninfo;
|
|
||||||
|
|
||||||
if ((ninfo = find_node_info(cinfo, cnode->node)))
|
|
||||||
node_info_free(ninfo);
|
|
||||||
|
|
||||||
pw_log_debug("module %p: node %p removed", impl, cnode->node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_global_added(struct pw_listener *listener, struct pw_core *core, struct pw_global *global)
|
on_global_added(struct pw_listener *listener, struct pw_core *core, struct pw_global *global)
|
||||||
{
|
{
|
||||||
struct impl *impl = SPA_CONTAINER_OF(listener, struct impl, global_added);
|
struct impl *impl = SPA_CONTAINER_OF(listener, struct impl, global_added);
|
||||||
|
|
||||||
if (global->type == impl->core->type.client) {
|
if (global->type == impl->core->type.node) {
|
||||||
struct pw_client *client = global->object;
|
struct pw_node *node = global->object;
|
||||||
struct client_info *cinfo;
|
struct node_info *ninfo;
|
||||||
|
|
||||||
cinfo = calloc(1, sizeof(struct client_info));
|
ninfo = calloc(1, sizeof(struct node_info));
|
||||||
cinfo->impl = impl;
|
ninfo->impl = impl;
|
||||||
cinfo->client = global->object;
|
ninfo->node = node;
|
||||||
spa_list_init(&cinfo->node_list);
|
spa_list_insert(impl->node_list.prev, &ninfo->link);
|
||||||
|
spa_list_init(&ninfo->port_unlinked.link);
|
||||||
|
spa_list_init(&ninfo->link_state_changed.link);
|
||||||
|
|
||||||
spa_list_insert(impl->client_list.prev, &cinfo->link);
|
pw_signal_add(&node->port_added, &ninfo->port_added, on_port_added);
|
||||||
|
pw_signal_add(&node->port_removed, &ninfo->port_removed, on_port_removed);
|
||||||
|
pw_signal_add(&node->state_changed, &ninfo->state_changed, on_state_changed);
|
||||||
|
|
||||||
pw_signal_add(&client->resource_impl, &cinfo->resource_impl, on_resource_impl);
|
pw_log_debug("module %p: node %p added", impl, node);
|
||||||
pw_signal_add(&client->resource_removed, &cinfo->resource_removed,
|
|
||||||
on_resource_removed);
|
|
||||||
|
|
||||||
pw_log_debug("module %p: client %p added", impl, cinfo->client);
|
if (node->info.state > PW_NODE_STATE_CREATING)
|
||||||
|
on_node_created(node, ninfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -338,14 +248,14 @@ on_global_removed(struct pw_listener *listener, struct pw_core *core, struct pw_
|
||||||
{
|
{
|
||||||
struct impl *impl = SPA_CONTAINER_OF(listener, struct impl, global_removed);
|
struct impl *impl = SPA_CONTAINER_OF(listener, struct impl, global_removed);
|
||||||
|
|
||||||
if (global->type == impl->core->type.client) {
|
if (global->type == impl->core->type.node) {
|
||||||
struct pw_client *client = global->object;
|
struct pw_node *node = global->object;
|
||||||
struct client_info *cinfo;
|
struct node_info *ninfo;
|
||||||
|
|
||||||
if ((cinfo = find_client_info(impl, client)))
|
if ((ninfo = find_node_info(impl, node)))
|
||||||
client_info_free(cinfo);
|
node_info_free(ninfo);
|
||||||
|
|
||||||
pw_log_debug("module %p: client %p removed", impl, client);
|
pw_log_debug("module %p: node %p removed", impl, node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -368,7 +278,7 @@ static struct impl *module_new(struct pw_core *core, struct pw_properties *prope
|
||||||
impl->core = core;
|
impl->core = core;
|
||||||
impl->properties = properties;
|
impl->properties = properties;
|
||||||
|
|
||||||
spa_list_init(&impl->client_list);
|
spa_list_init(&impl->node_list);
|
||||||
|
|
||||||
pw_signal_add(&core->global_added, &impl->global_added, on_global_added);
|
pw_signal_add(&core->global_added, &impl->global_added, on_global_added);
|
||||||
pw_signal_add(&core->global_removed, &impl->global_removed, on_global_removed);
|
pw_signal_add(&core->global_removed, &impl->global_removed, on_global_removed);
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,7 @@
|
||||||
#include "pipewire/client/interfaces.h"
|
#include "pipewire/client/interfaces.h"
|
||||||
#include "pipewire/server/core.h"
|
#include "pipewire/server/core.h"
|
||||||
#include "pipewire/server/module.h"
|
#include "pipewire/server/module.h"
|
||||||
#include "pipewire/server/client-node.h"
|
#include "module-client-node/client-node.h"
|
||||||
|
|
||||||
#define AUDIOMIXER_LIB "build/spa/plugins/audiomixer/libspa-audiomixer.so"
|
|
||||||
|
|
||||||
struct impl {
|
struct impl {
|
||||||
struct pw_node_factory this;
|
struct pw_node_factory this;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
#include "pipewire/client/transport.h"
|
#include "pipewire/client/transport.h"
|
||||||
|
|
||||||
#include "pipewire/server/core.h"
|
#include "pipewire/server/core.h"
|
||||||
#include "pipewire/server/client-node.h"
|
#include "client-node.h"
|
||||||
|
|
||||||
/** \cond */
|
/** \cond */
|
||||||
|
|
||||||
|
|
@ -117,6 +117,8 @@ struct proxy {
|
||||||
struct impl {
|
struct impl {
|
||||||
struct pw_client_node this;
|
struct pw_client_node this;
|
||||||
|
|
||||||
|
uint32_t type_client_node;
|
||||||
|
|
||||||
struct pw_core *core;
|
struct pw_core *core;
|
||||||
|
|
||||||
struct proxy proxy;
|
struct proxy proxy;
|
||||||
|
|
@ -1064,7 +1066,7 @@ on_global_added(struct pw_listener *listener, struct pw_core *core, struct pw_gl
|
||||||
struct impl *impl = SPA_CONTAINER_OF(listener, struct impl, global_added);
|
struct impl *impl = SPA_CONTAINER_OF(listener, struct impl, global_added);
|
||||||
|
|
||||||
if (global->object == impl->this.node)
|
if (global->object == impl->this.node)
|
||||||
global->owner = impl->this.client;
|
global->owner = impl->this.resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int proxy_clear(struct proxy *this)
|
static int proxy_clear(struct proxy *this)
|
||||||
|
|
@ -1152,24 +1154,26 @@ struct pw_client_node *pw_client_node_new(struct pw_client *client,
|
||||||
impl->fds[0] = impl->fds[1] = -1;
|
impl->fds[0] = impl->fds[1] = -1;
|
||||||
pw_log_debug("client-node %p: new", impl);
|
pw_log_debug("client-node %p: new", impl);
|
||||||
|
|
||||||
|
impl->type_client_node = spa_type_map_get_id(client->core->type.map, PIPEWIRE_TYPE__ClientNode);
|
||||||
|
|
||||||
pw_signal_init(&this->destroy_signal);
|
pw_signal_init(&this->destroy_signal);
|
||||||
|
|
||||||
proxy_init(&impl->proxy, NULL, client->core->support, client->core->n_support);
|
proxy_init(&impl->proxy, NULL, client->core->support, client->core->n_support);
|
||||||
|
|
||||||
this->node = pw_node_new(client->core,
|
|
||||||
client, name, true, &impl->proxy.node, NULL, properties);
|
|
||||||
if (this->node == NULL)
|
|
||||||
goto error_no_node;
|
|
||||||
|
|
||||||
impl->proxy.impl = impl;
|
impl->proxy.impl = impl;
|
||||||
|
|
||||||
this->resource = pw_resource_new(client,
|
this->resource = pw_resource_new(client,
|
||||||
id,
|
id,
|
||||||
client->core->type.client_node, 0);
|
impl->type_client_node,
|
||||||
|
0);
|
||||||
|
|
||||||
if (this->resource == NULL)
|
if (this->resource == NULL)
|
||||||
goto error_no_resource;
|
goto error_no_resource;
|
||||||
|
|
||||||
|
this->node = pw_node_new(client->core,
|
||||||
|
this->resource, name, true, &impl->proxy.node, NULL, properties);
|
||||||
|
if (this->node == NULL)
|
||||||
|
goto error_no_node;
|
||||||
|
|
||||||
pw_resource_set_implementation(this->resource,
|
pw_resource_set_implementation(this->resource,
|
||||||
this,
|
this,
|
||||||
PW_VERSION_CLIENT_NODE,
|
PW_VERSION_CLIENT_NODE,
|
||||||
|
|
@ -1184,9 +1188,9 @@ struct pw_client_node *pw_client_node_new(struct pw_client *client,
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
|
||||||
error_no_resource:
|
|
||||||
pw_node_destroy(this->node);
|
|
||||||
error_no_node:
|
error_no_node:
|
||||||
|
pw_resource_destroy(this->resource);
|
||||||
|
error_no_resource:
|
||||||
proxy_clear(&impl->proxy);
|
proxy_clear(&impl->proxy);
|
||||||
free(impl);
|
free(impl);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -208,7 +208,7 @@ check_global_owner(struct pw_core *core, struct pw_client *client, struct pw_glo
|
||||||
if (global->owner == NULL)
|
if (global->owner == NULL)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (global->owner->ucred.uid == client->ucred.uid)
|
if (global->owner->client->ucred.uid == client->ucred.uid)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@
|
||||||
#include "pipewire/server/protocol-native.h"
|
#include "pipewire/server/protocol-native.h"
|
||||||
#include "pipewire/server/node.h"
|
#include "pipewire/server/node.h"
|
||||||
#include "pipewire/server/module.h"
|
#include "pipewire/server/module.h"
|
||||||
#include "pipewire/server/client-node.h"
|
|
||||||
#include "pipewire/server/client.h"
|
#include "pipewire/server/client.h"
|
||||||
#include "pipewire/server/resource.h"
|
#include "pipewire/server/resource.h"
|
||||||
#include "pipewire/server/link.h"
|
#include "pipewire/server/link.h"
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ struct pw_client *pw_client_new(struct pw_core *core,
|
||||||
|
|
||||||
spa_list_insert(core->client_list.prev, &this->link);
|
spa_list_insert(core->client_list.prev, &this->link);
|
||||||
|
|
||||||
pw_core_add_global(core, this, core->type.client, 0, this, client_bind_func, &this->global);
|
pw_core_add_global(core, NULL, core->type.client, 0, this, client_bind_func, &this->global);
|
||||||
|
|
||||||
this->info.id = this->global->id;
|
this->info.id = this->global->id;
|
||||||
this->info.props = this->properties ? &this->properties->dict : NULL;
|
this->info.props = this->properties ? &this->properties->dict : NULL;
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@
|
||||||
#include <pipewire/client/interfaces.h>
|
#include <pipewire/client/interfaces.h>
|
||||||
#include <pipewire/server/core.h>
|
#include <pipewire/server/core.h>
|
||||||
#include <pipewire/server/data-loop.h>
|
#include <pipewire/server/data-loop.h>
|
||||||
#include <pipewire/server/client-node.h>
|
|
||||||
#include <spa/lib/debug.h>
|
#include <spa/lib/debug.h>
|
||||||
#include <spa/format-utils.h>
|
#include <spa/format-utils.h>
|
||||||
|
|
||||||
|
|
@ -369,7 +368,7 @@ void pw_core_destroy(struct pw_core *core)
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
pw_core_add_global(struct pw_core *core,
|
pw_core_add_global(struct pw_core *core,
|
||||||
struct pw_client *owner,
|
struct pw_resource *owner,
|
||||||
uint32_t type,
|
uint32_t type,
|
||||||
uint32_t version,
|
uint32_t version,
|
||||||
void *object,
|
void *object,
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ struct pw_global;
|
||||||
|
|
||||||
#include <pipewire/server/main-loop.h>
|
#include <pipewire/server/main-loop.h>
|
||||||
#include <pipewire/server/data-loop.h>
|
#include <pipewire/server/data-loop.h>
|
||||||
|
#include <pipewire/server/resource.h>
|
||||||
#include <pipewire/server/node.h>
|
#include <pipewire/server/node.h>
|
||||||
#include <pipewire/server/link.h>
|
#include <pipewire/server/link.h>
|
||||||
#include <pipewire/server/node-factory.h>
|
#include <pipewire/server/node-factory.h>
|
||||||
|
|
@ -120,7 +121,7 @@ typedef bool (*pw_global_filter_func_t) (struct pw_global *global,
|
||||||
*/
|
*/
|
||||||
struct pw_global {
|
struct pw_global {
|
||||||
struct pw_core *core; /**< the core */
|
struct pw_core *core; /**< the core */
|
||||||
struct pw_client *owner; /**< the owner of this object, NULL when the
|
struct pw_resource *owner; /**< the owner of this object, NULL when the
|
||||||
* PipeWire server is the owner */
|
* PipeWire server is the owner */
|
||||||
|
|
||||||
struct spa_list link; /**< link in core list of globals */
|
struct spa_list link; /**< link in core list of globals */
|
||||||
|
|
@ -192,7 +193,7 @@ pw_core_update_properties(struct pw_core *core, const struct spa_dict *dict);
|
||||||
|
|
||||||
bool
|
bool
|
||||||
pw_core_add_global(struct pw_core *core,
|
pw_core_add_global(struct pw_core *core,
|
||||||
struct pw_client *owner,
|
struct pw_resource *owner,
|
||||||
uint32_t type,
|
uint32_t type,
|
||||||
uint32_t version,
|
uint32_t version,
|
||||||
void *object, pw_bind_func_t bind,
|
void *object, pw_bind_func_t bind,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
pipewirecore_headers = [
|
pipewirecore_headers = [
|
||||||
'client.h',
|
'client.h',
|
||||||
'client-node.h',
|
|
||||||
'command.h',
|
'command.h',
|
||||||
'core.h',
|
'core.h',
|
||||||
'data-loop.h',
|
'data-loop.h',
|
||||||
|
|
@ -17,7 +16,6 @@ pipewirecore_headers = [
|
||||||
|
|
||||||
pipewirecore_sources = [
|
pipewirecore_sources = [
|
||||||
'client.c',
|
'client.c',
|
||||||
'client-node.c',
|
|
||||||
'command.c',
|
'command.c',
|
||||||
'core.c',
|
'core.c',
|
||||||
'data-loop.c',
|
'data-loop.c',
|
||||||
|
|
|
||||||
|
|
@ -519,7 +519,7 @@ static const struct spa_node_callbacks node_callbacks = {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct pw_node *pw_node_new(struct pw_core *core,
|
struct pw_node *pw_node_new(struct pw_core *core,
|
||||||
struct pw_client *owner,
|
struct pw_resource *owner,
|
||||||
const char *name,
|
const char *name,
|
||||||
bool async,
|
bool async,
|
||||||
struct spa_node *node,
|
struct spa_node *node,
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ struct pw_node {
|
||||||
struct spa_list link; /**< link in core node_list */
|
struct spa_list link; /**< link in core node_list */
|
||||||
struct pw_global *global; /**< global for this node */
|
struct pw_global *global; /**< global for this node */
|
||||||
|
|
||||||
struct pw_client *owner; /**< owner client if any */
|
struct pw_resource *owner; /**< owner resource if any */
|
||||||
struct pw_properties *properties; /**< properties of the node */
|
struct pw_properties *properties; /**< properties of the node */
|
||||||
|
|
||||||
struct pw_node_info info; /**< introspectable node info */
|
struct pw_node_info info; /**< introspectable node info */
|
||||||
|
|
@ -111,7 +111,7 @@ struct pw_node {
|
||||||
/** Create a new node \memberof pw_node */
|
/** Create a new node \memberof pw_node */
|
||||||
struct pw_node *
|
struct pw_node *
|
||||||
pw_node_new(struct pw_core *core, /**< the core */
|
pw_node_new(struct pw_core *core, /**< the core */
|
||||||
struct pw_client *owner, /**< optional owner */
|
struct pw_resource *owner, /**< optional owner */
|
||||||
const char *name, /**< node name */
|
const char *name, /**< node name */
|
||||||
bool async, /**< if the node will initialize async */
|
bool async, /**< if the node will initialize async */
|
||||||
struct spa_node *node, /**< the node */
|
struct spa_node *node, /**< the node */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue