mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
Make native protocol
Remove DBus and work towards something like wayland. Remove more glib stuff from the client code
This commit is contained in:
parent
efae64a759
commit
27bba6f587
55 changed files with 3089 additions and 4969 deletions
|
|
@ -21,55 +21,13 @@
|
|||
#include "pinos/client/pinos.h"
|
||||
|
||||
#include "pinos/server/client.h"
|
||||
|
||||
#include "pinos/dbus/org-pinos.h"
|
||||
#include "pinos/server/resource.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
PinosClient this;
|
||||
} PinosClientImpl;
|
||||
|
||||
PinosResource *
|
||||
pinos_client_add_resource (PinosClient *client,
|
||||
uint32_t type,
|
||||
void *object,
|
||||
PinosDestroy destroy)
|
||||
{
|
||||
PinosResource *resource;
|
||||
|
||||
resource = calloc (1, sizeof (PinosResource));
|
||||
resource->core = client->core;
|
||||
resource->client = client;
|
||||
resource->id = 0;
|
||||
resource->type = type;
|
||||
resource->object = object;
|
||||
resource->destroy = destroy;
|
||||
|
||||
pinos_signal_init (&resource->destroy_signal);
|
||||
|
||||
pinos_log_debug ("client %p: add resource %p", client, resource);
|
||||
|
||||
spa_list_insert (client->resource_list.prev, &resource->link);
|
||||
|
||||
return resource;
|
||||
}
|
||||
|
||||
SpaResult
|
||||
pinos_resource_destroy (PinosResource *resource)
|
||||
{
|
||||
pinos_log_debug ("resource %p: destroy", resource);
|
||||
pinos_signal_emit (&resource->destroy_signal, resource);
|
||||
|
||||
spa_list_remove (&resource->link);
|
||||
|
||||
if (resource->destroy)
|
||||
resource->destroy (resource->object);
|
||||
|
||||
free (resource);
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* pinos_client_new:
|
||||
* @daemon: a #PinosDaemon
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue