mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
indent
This commit is contained in:
parent
d1a06ae247
commit
5b037661d9
154 changed files with 21017 additions and 23044 deletions
|
|
@ -23,66 +23,61 @@
|
|||
#include "pipewire/server/resource.h"
|
||||
|
||||
struct impl {
|
||||
struct pw_resource this;
|
||||
struct pw_resource this;
|
||||
};
|
||||
|
||||
struct pw_resource *
|
||||
pw_resource_new (struct pw_client *client,
|
||||
uint32_t id,
|
||||
uint32_t type,
|
||||
void *object,
|
||||
pw_destroy_t destroy)
|
||||
struct pw_resource *pw_resource_new(struct pw_client *client,
|
||||
uint32_t id, uint32_t type, void *object, pw_destroy_t destroy)
|
||||
{
|
||||
struct impl *impl;
|
||||
struct pw_resource *this;
|
||||
struct impl *impl;
|
||||
struct pw_resource *this;
|
||||
|
||||
impl = calloc (1, sizeof (struct impl));
|
||||
if (impl == NULL)
|
||||
return NULL;
|
||||
impl = calloc(1, sizeof(struct impl));
|
||||
if (impl == NULL)
|
||||
return NULL;
|
||||
|
||||
this = &impl->this;
|
||||
this->core = client->core;
|
||||
this->client = client;
|
||||
this->type = type;
|
||||
this->object = object;
|
||||
this->destroy = destroy;
|
||||
this = &impl->this;
|
||||
this->core = client->core;
|
||||
this->client = client;
|
||||
this->type = type;
|
||||
this->object = object;
|
||||
this->destroy = destroy;
|
||||
|
||||
pw_signal_init (&this->destroy_signal);
|
||||
pw_signal_init(&this->destroy_signal);
|
||||
|
||||
if (id == SPA_ID_INVALID) {
|
||||
this->id = pw_map_insert_new (&client->objects, this);
|
||||
} else if (!pw_map_insert_at (&client->objects, id, this))
|
||||
goto in_use;
|
||||
if (id == SPA_ID_INVALID) {
|
||||
this->id = pw_map_insert_new(&client->objects, this);
|
||||
} else if (!pw_map_insert_at(&client->objects, id, this))
|
||||
goto in_use;
|
||||
|
||||
this->id = id;
|
||||
this->id = id;
|
||||
|
||||
pw_log_debug ("resource %p: new for client %p id %u", this, client, this->id);
|
||||
pw_signal_emit (&client->resource_added, client, this);
|
||||
pw_log_debug("resource %p: new for client %p id %u", this, client, this->id);
|
||||
pw_signal_emit(&client->resource_added, client, this);
|
||||
|
||||
return this;
|
||||
return this;
|
||||
|
||||
in_use:
|
||||
pw_log_debug ("resource %p: id %u in use for client %p", this, id, client);
|
||||
free (impl);
|
||||
return NULL;
|
||||
in_use:
|
||||
pw_log_debug("resource %p: id %u in use for client %p", this, id, client);
|
||||
free(impl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
pw_resource_destroy (struct pw_resource *resource)
|
||||
void pw_resource_destroy(struct pw_resource *resource)
|
||||
{
|
||||
struct pw_client *client = resource->client;
|
||||
struct pw_client *client = resource->client;
|
||||
|
||||
pw_log_trace ("resource %p: destroy %u", resource, resource->id);
|
||||
pw_signal_emit (&resource->destroy_signal, resource);
|
||||
pw_log_trace("resource %p: destroy %u", resource, resource->id);
|
||||
pw_signal_emit(&resource->destroy_signal, resource);
|
||||
|
||||
pw_map_insert_at (&client->objects, resource->id, NULL);
|
||||
pw_signal_emit (&client->resource_removed, client, resource);
|
||||
pw_map_insert_at(&client->objects, resource->id, NULL);
|
||||
pw_signal_emit(&client->resource_removed, client, resource);
|
||||
|
||||
if (resource->destroy)
|
||||
resource->destroy (resource);
|
||||
if (resource->destroy)
|
||||
resource->destroy(resource);
|
||||
|
||||
if (client->core_resource)
|
||||
pw_core_notify_remove_id (client->core_resource, resource->id);
|
||||
if (client->core_resource)
|
||||
pw_core_notify_remove_id(client->core_resource, resource->id);
|
||||
|
||||
free (resource);
|
||||
free(resource);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue