clean up types

This commit is contained in:
Wim Taymans 2017-03-23 21:15:52 +01:00
parent d9a51b5d14
commit acedfe71c0
64 changed files with 756 additions and 752 deletions

View file

@ -24,8 +24,8 @@
extern "C" {
#endif
#define PINOS_ACCESS_URI "http://pinos.org/ns/access"
#define PINOS_ACCESS_PREFIX PINOS_ACCESS_URI "#"
#define PINOS_TYPE__Access "Pinos:Object:Access"
#define PINOS_TYPE_ACCESS_BASE PINOS_TYPE__Access ":"
#include <pinos/client/sig.h>

View file

@ -93,7 +93,7 @@ struct _SpaProxy
SpaLoop *main_loop;
SpaLoop *data_loop;
SpaNodeEventCallback event_cb;
SpaEventNodeCallback event_cb;
void *user_data;
PinosResource *resource;
@ -130,7 +130,7 @@ static void
send_async_complete (SpaProxy *this, uint32_t seq, SpaResult res)
{
PinosCore *core = this->pnode->core;
SpaNodeEventAsyncComplete ac = SPA_NODE_EVENT_ASYNC_COMPLETE_INIT (core->uri.node_events.AsyncComplete,
SpaEventNodeAsyncComplete ac = SPA_EVENT_NODE_ASYNC_COMPLETE_INIT (core->uri.event_node.AsyncComplete,
seq, res);
this->event_cb (&this->node, (SpaEvent *)&ac, this->user_data);
}
@ -166,7 +166,7 @@ static void
send_need_input (SpaProxy *this)
{
PinosNode *pnode = this->pnode;
SpaEvent event = SPA_EVENT_INIT (pnode->core->uri.node_events.NeedInput);
SpaEvent event = SPA_EVENT_INIT (pnode->core->uri.event_node.NeedInput);
uint64_t cmd = 1;
pinos_transport_add_event (pnode->transport, &event);
@ -177,7 +177,7 @@ static void
send_have_output (SpaProxy *this)
{
PinosNode *pnode = this->pnode;
SpaEvent event = SPA_EVENT_INIT (pnode->core->uri.node_events.HaveOutput);
SpaEvent event = SPA_EVENT_INIT (pnode->core->uri.event_node.HaveOutput);
uint64_t cmd = 1;
pinos_transport_add_event (pnode->transport, &event);
@ -202,7 +202,7 @@ spa_proxy_node_send_command (SpaNode *node,
core = this->pnode->core;
if (SPA_COMMAND_TYPE (command) == core->uri.node_commands.ClockUpdate) {
if (SPA_COMMAND_TYPE (command) == core->uri.command_node.ClockUpdate) {
pinos_client_node_notify_node_command (this->resource,
this->seq++,
command);
@ -212,7 +212,7 @@ spa_proxy_node_send_command (SpaNode *node,
pinos_client_node_notify_node_command (this->resource,
this->seq,
command);
if (SPA_COMMAND_TYPE (command) == core->uri.node_commands.Start)
if (SPA_COMMAND_TYPE (command) == core->uri.command_node.Start)
send_need_input (this);
res = SPA_RESULT_RETURN_ASYNC (this->seq++);
@ -222,7 +222,7 @@ spa_proxy_node_send_command (SpaNode *node,
static SpaResult
spa_proxy_node_set_event_callback (SpaNode *node,
SpaNodeEventCallback event,
SpaEventNodeCallback event,
void *user_data)
{
SpaProxy *this;
@ -770,7 +770,7 @@ spa_proxy_node_port_reuse_buffer (SpaNode *node,
return SPA_RESULT_INVALID_PORT;
{
SpaNodeEventReuseBuffer rb = SPA_NODE_EVENT_REUSE_BUFFER_INIT (pnode->core->uri.node_events.ReuseBuffer,
SpaEventNodeReuseBuffer rb = SPA_EVENT_NODE_REUSE_BUFFER_INIT (pnode->core->uri.event_node.ReuseBuffer,
port_id, buffer_id);
pinos_transport_add_event (pnode->transport, (SpaEvent *)&rb);
//write (this->data_source.fd, &cmd, 8);
@ -999,11 +999,11 @@ proxy_init (SpaProxy *this,
uint32_t i;
for (i = 0; i < n_support; i++) {
if (strcmp (support[i].uri, SPA_LOG_URI) == 0)
if (strcmp (support[i].uri, SPA_TYPE__Log) == 0)
this->log = support[i].data;
else if (strcmp (support[i].uri, SPA_LOOP__MainLoop) == 0)
else if (strcmp (support[i].uri, SPA_TYPE_LOOP__MainLoop) == 0)
this->main_loop = support[i].data;
else if (strcmp (support[i].uri, SPA_LOOP__DataLoop) == 0)
else if (strcmp (support[i].uri, SPA_TYPE_LOOP__DataLoop) == 0)
this->data_loop = support[i].data;
}
if (this->data_loop == NULL) {

View file

@ -26,8 +26,8 @@
extern "C" {
#endif
#define PINOS_CLIENT_NODE_URI "http://pinos.org/ns/client-node"
#define PINOS_CLIENT_NODE_PREFIX PINOS_CLIENT_NODE_URI "#"
#define PINOS_TYPE__ClientNode "Pinos:Object:ClientNode"
#define PINOS_TYPE_CLIENT_NODE_BASE PINOS_TYPE__ClientNode ":"
typedef struct _PinosClientNode PinosClientNode;

View file

@ -295,13 +295,13 @@ pinos_core_new (PinosMainLoop *main_loop,
pinos_access_init (&this->access);
pinos_map_init (&this->objects, 128, 32);
impl->support[0].uri = SPA_ID_MAP_URI;
impl->support[0].uri = SPA_TYPE__IDMap;
impl->support[0].data = this->uri.map;
impl->support[1].uri = SPA_LOG_URI;
impl->support[1].uri = SPA_TYPE__Log;
impl->support[1].data = pinos_log_get ();
impl->support[2].uri = SPA_LOOP__DataLoop;
impl->support[2].uri = SPA_TYPE_LOOP__DataLoop;
impl->support[2].data = this->data_loop->loop->loop;
impl->support[3].uri = SPA_LOOP__MainLoop;
impl->support[3].uri = SPA_TYPE_LOOP__MainLoop;
impl->support[3].data = this->main_loop->loop->loop;
this->support = impl->support;
this->n_support = 4;

View file

@ -24,8 +24,8 @@
extern "C" {
#endif
#define PINOS_NODE_FACTORY_URI "http://pinos.org/ns/node-factory"
#define PINOS_NODE_FACTORY_PREFIX PINOS_NODE_FACTORY_URI "#"
#define PINOS_TYPE__NodeFactory "Pinos:Object:NodeFactory"
#define PINOS_TYPE_NODE_FACTORY_BASE PINOS_TYPE__NodeFactory ":"
typedef struct _PinosNodeFactory PinosNodeFactory;

View file

@ -169,7 +169,7 @@ pause_node (PinosNode *this)
pinos_log_debug ("node %p: pause node", this);
{
SpaCommand cmd = SPA_COMMAND_INIT (this->core->uri.node_commands.Pause);
SpaCommand cmd = SPA_COMMAND_INIT (this->core->uri.command_node.Pause);
if ((res = spa_node_send_command (this->node, &cmd)) < 0)
pinos_log_debug ("got error %d", res);
}
@ -183,7 +183,7 @@ start_node (PinosNode *this)
pinos_log_debug ("node %p: start node", this);
{
SpaCommand cmd = SPA_COMMAND_INIT (this->core->uri.node_commands.Start);
SpaCommand cmd = SPA_COMMAND_INIT (this->core->uri.command_node.Start);
if ((res = spa_node_send_command (this->node, &cmd)) < 0)
pinos_log_debug ("got error %d", res);
}
@ -224,13 +224,13 @@ static void
send_clock_update (PinosNode *this)
{
SpaResult res;
SpaNodeCommandClockUpdate cu =
SPA_NODE_COMMAND_CLOCK_UPDATE_INIT(
this->core->uri.node_commands.ClockUpdate,
SPA_NODE_COMMAND_CLOCK_UPDATE_TIME |
SPA_NODE_COMMAND_CLOCK_UPDATE_SCALE |
SPA_NODE_COMMAND_CLOCK_UPDATE_STATE |
SPA_NODE_COMMAND_CLOCK_UPDATE_LATENCY, /* change_mask */
SpaCommandNodeClockUpdate cu =
SPA_COMMAND_NODE_CLOCK_UPDATE_INIT(
this->core->uri.command_node.ClockUpdate,
SPA_COMMAND_NODE_CLOCK_UPDATE_TIME |
SPA_COMMAND_NODE_CLOCK_UPDATE_SCALE |
SPA_COMMAND_NODE_CLOCK_UPDATE_STATE |
SPA_COMMAND_NODE_CLOCK_UPDATE_LATENCY, /* change_mask */
1, /* rate */
0, /* ticks */
0, /* monotonic_time */
@ -241,7 +241,7 @@ send_clock_update (PinosNode *this)
0); /* latency */
if (this->clock && this->live) {
cu.body.flags.value = SPA_NODE_COMMAND_CLOCK_UPDATE_FLAG_LIVE;
cu.body.flags.value = SPA_COMMAND_NODE_CLOCK_UPDATE_FLAG_LIVE;
res = spa_clock_get_time (this->clock,
&cu.body.rate.value,
&cu.body.ticks.value,
@ -258,15 +258,15 @@ on_node_event (SpaNode *node, SpaEvent *event, void *user_data)
PinosNode *this = user_data;
PinosNodeImpl *impl = SPA_CONTAINER_OF (this, PinosNodeImpl, this);
if (SPA_EVENT_TYPE (event) == this->core->uri.node_events.AsyncComplete) {
SpaNodeEventAsyncComplete *ac = (SpaNodeEventAsyncComplete *) event;
if (SPA_EVENT_TYPE (event) == this->core->uri.event_node.AsyncComplete) {
SpaEventNodeAsyncComplete *ac = (SpaEventNodeAsyncComplete *) event;
pinos_log_debug ("node %p: async complete event %d %d", this, ac->body.seq.value, ac->body.res.value);
if (!pinos_work_queue_complete (impl->work, this, ac->body.seq.value, ac->body.res.value)) {
pinos_signal_emit (&this->async_complete, this, ac->body.seq.value, ac->body.res.value);
}
}
else if (SPA_EVENT_TYPE (event) == this->core->uri.node_events.NeedInput) {
else if (SPA_EVENT_TYPE (event) == this->core->uri.event_node.NeedInput) {
SpaResult res;
int i;
bool processed = false;
@ -310,7 +310,7 @@ on_node_event (SpaNode *node, SpaEvent *event, void *user_data)
pinos_log_warn ("node %p: got process input %d", this, res);
}
}
else if (SPA_EVENT_TYPE (event) == this->core->uri.node_events.HaveOutput) {
else if (SPA_EVENT_TYPE (event) == this->core->uri.event_node.HaveOutput) {
SpaResult res;
int i;
bool processed = false;
@ -353,7 +353,7 @@ on_node_event (SpaNode *node, SpaEvent *event, void *user_data)
pinos_log_warn ("node %p: got process output %d", this, res);
}
}
else if (SPA_EVENT_TYPE (event) == this->core->uri.node_events.RequestClockUpdate) {
else if (SPA_EVENT_TYPE (event) == this->core->uri.event_node.RequestClockUpdate) {
send_clock_update (this);
}
}

View file

@ -24,8 +24,8 @@
extern "C" {
#endif
#define PINOS_NODE_URI "http://pinos.org/ns/node"
#define PINOS_NODE_PREFIX PINOS_NODE_URI "#"
#define PINOS_TYPE__Node "Pinos:Object:Node"
#define PINOS_TYPE_NODE_BASE PINOS_TYPE__Node ":"
typedef struct _PinosNode PinosNode;

View file

@ -206,7 +206,7 @@ no_mem:
static SpaResult
pinos_port_pause (PinosPort *port)
{
SpaCommand cmd = SPA_COMMAND_INIT (port->node->core->uri.node_commands.Pause);
SpaCommand cmd = SPA_COMMAND_INIT (port->node->core->uri.command_node.Pause);
return spa_node_port_send_command (port->node->node,
port->direction,
port->port_id,

View file

@ -24,8 +24,8 @@
extern "C" {
#endif
#define PINOS_PORT_URI "http://pinos.org/ns/port"
#define PINOS_PORT_PREFIX PINOS_PORT_URI "#"
#define PINOS_TYPE__Port "Pinos:Object:Port"
#define PINOS_TYPE_PORT_BASE PINOS_TYPE__Port ":"
typedef struct _PinosPort PinosPort;

View file

@ -24,8 +24,8 @@
extern "C" {
#endif
#define PINOS_RESOURCE_URI "http://pinos.org/ns/resource"
#define PINOS_RESOURCE_PREFIX PINOS_RESOURCE_URI "#"
#define PINOS_TYPE__Resource "Pinos:Object:Resource"
#define PINOS_TYPE_RESOURCE_BASE PINOS_TYPE__Resource ":"
typedef struct _PinosResource PinosResource;