summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2016-10-24 15:30:15 +0200
committerWim Taymans <wtaymans@redhat.com>2016-10-24 15:30:15 +0200
commitd3dd90bb05f433f72117fa52c465fbedea59491c (patch)
treec17f659fd14272fcf67eee8474b188df4781e95e
parent0373f73bacd91aaf2dd7d9c1f9812fd17086afae (diff)
simplify events and commands
-rw-r--r--pinos/client/connection.c21
-rw-r--r--pinos/client/stream.c44
-rw-r--r--pinos/modules/spa/spa-alsa-monitor.c6
-rw-r--r--pinos/modules/spa/spa-v4l2-monitor.c6
-rw-r--r--pinos/server/client-node.c20
-rw-r--r--pinos/server/data-loop.c55
-rw-r--r--pinos/server/data-loop.h4
-rw-r--r--pinos/server/main-loop.c57
-rw-r--r--pinos/server/main-loop.h3
-rw-r--r--pinos/server/node.c23
-rw-r--r--spa/include/spa/monitor.h40
-rw-r--r--spa/include/spa/node-command.h20
-rw-r--r--spa/include/spa/node-event.h6
-rw-r--r--spa/include/spa/poll.h2
-rw-r--r--spa/plugins/alsa/alsa-monitor.c15
-rw-r--r--spa/plugins/alsa/alsa-utils.c16
-rw-r--r--spa/plugins/audiomixer/audiomixer.c8
-rw-r--r--spa/plugins/audiotestsrc/audiotestsrc.c8
-rw-r--r--spa/plugins/v4l2/v4l2-monitor.c16
-rw-r--r--spa/plugins/v4l2/v4l2-source.c60
-rw-r--r--spa/plugins/v4l2/v4l2-utils.c8
-rw-r--r--spa/plugins/videotestsrc/videotestsrc.c8
-rw-r--r--spa/plugins/volume/volume.c8
-rw-r--r--spa/tests/test-mixer.c4
-rw-r--r--spa/tools/spa-monitor.c6
25 files changed, 216 insertions, 248 deletions
diff --git a/pinos/client/connection.c b/pinos/client/connection.c
index e6254889..eb92d315 100644
--- a/pinos/client/connection.c
+++ b/pinos/client/connection.c
@@ -140,8 +140,6 @@ connection_parse_node_event (PinosConnection *conn, PinosControlCmdNodeEvent *cm
memcpy (cmd, p, sizeof (PinosControlCmdNodeEvent));
if (cmd->event)
cmd->event = SPA_MEMBER (p, SPA_PTR_TO_INT (cmd->event), SpaNodeEvent);
- if (cmd->event->data)
- cmd->event->data = SPA_MEMBER (p, SPA_PTR_TO_INT (cmd->event->data), void);
}
static void
@@ -151,8 +149,6 @@ connection_parse_node_command (PinosConnection *conn, PinosControlCmdNodeCommand
memcpy (cmd, p, sizeof (PinosControlCmdNodeCommand));
if (cmd->command)
cmd->command = SPA_MEMBER (p, SPA_PTR_TO_INT (cmd->command), SpaNodeCommand);
- if (cmd->command->data)
- cmd->command->data = SPA_MEMBER (p, SPA_PTR_TO_INT (cmd->command->data), void);
}
static void *
@@ -331,11 +327,9 @@ connection_add_node_event (PinosConnection *conn, PinosControlCmdNodeEvent *ev)
size_t len;
void *p;
PinosControlCmdNodeEvent *d;
- SpaNodeEvent *ne;
/* calculate length */
len = sizeof (PinosControlCmdNodeEvent);
- len += sizeof (SpaNodeEvent);
len += ev->event->size;
p = connection_add_cmd (conn, PINOS_CONTROL_CMD_NODE_EVENT, len);
@@ -345,25 +339,18 @@ connection_add_node_event (PinosConnection *conn, PinosControlCmdNodeEvent *ev)
p = SPA_MEMBER (d, sizeof (PinosControlCmdNodeEvent), void);
d->event = SPA_INT_TO_PTR (SPA_PTRDIFF (p, d));
- ne = p;
- memcpy (p, ev->event, sizeof (SpaNodeEvent));
- p = SPA_MEMBER (p, sizeof (SpaNodeEvent), void);
- ne->data = SPA_INT_TO_PTR (SPA_PTRDIFF (p, d));
- memcpy (p, ev->event->data, ev->event->size);
+ memcpy (p, ev->event, ev->event->size);
}
-
static void
connection_add_node_command (PinosConnection *conn, PinosControlCmdNodeCommand *cm)
{
size_t len;
void *p;
PinosControlCmdNodeCommand *d;
- SpaNodeCommand *nc;
/* calculate length */
len = sizeof (PinosControlCmdNodeCommand);
- len += sizeof (SpaNodeCommand);
len += cm->command->size;
p = connection_add_cmd (conn, PINOS_CONTROL_CMD_NODE_COMMAND, len);
@@ -373,11 +360,7 @@ connection_add_node_command (PinosConnection *conn, PinosControlCmdNodeCommand *
p = SPA_MEMBER (d, sizeof (PinosControlCmdNodeCommand), void);
d->command = SPA_INT_TO_PTR (SPA_PTRDIFF (p, d));
- nc = p;
- memcpy (p, cm->command, sizeof (SpaNodeCommand));
- p = SPA_MEMBER (p, sizeof (SpaNodeCommand), void);
- nc->data = SPA_INT_TO_PTR (SPA_PTRDIFF (p, d));
- memcpy (p, cm->command->data, cm->command->size);
+ memcpy (p, cm->command, cm->command->size);
}
static gboolean
diff --git a/pinos/client/stream.c b/pinos/client/stream.c
index 608619c0..3b6f5675 100644
--- a/pinos/client/stream.c
+++ b/pinos/client/stream.c
@@ -665,13 +665,11 @@ send_need_input (PinosStream *stream, uint32_t port_id)
{
PinosStreamPrivate *priv = stream->priv;
PinosControlCmdNodeEvent cne;
- SpaNodeEvent ne;
SpaNodeEventNeedInput ni;
- cne.event = &ne;
- ne.type = SPA_NODE_EVENT_TYPE_NEED_INPUT;
- ne.data = &ni;
- ne.size = sizeof (ni);
+ cne.event = &ni.event;
+ ni.event.type = SPA_NODE_EVENT_TYPE_NEED_INPUT;
+ ni.event.size = sizeof (ni);
ni.port_id = port_id;
pinos_connection_add_cmd (priv->rtconn, PINOS_CONTROL_CMD_NODE_EVENT, &cne);
@@ -684,13 +682,11 @@ add_request_clock_update (PinosStream *stream)
{
PinosStreamPrivate *priv = stream->priv;
PinosControlCmdNodeEvent cne;
- SpaNodeEvent ne;
SpaNodeEventRequestClockUpdate rcu;
- cne.event = &ne;
- ne.type = SPA_NODE_EVENT_TYPE_REQUEST_CLOCK_UPDATE;
- ne.data = &rcu;
- ne.size = sizeof (rcu);
+ cne.event = &rcu.event;
+ rcu.event.type = SPA_NODE_EVENT_TYPE_REQUEST_CLOCK_UPDATE;
+ rcu.event.size = sizeof (rcu);
rcu.update_mask = SPA_NODE_EVENT_REQUEST_CLOCK_UPDATE_TIME;
rcu.timestamp = 0;
rcu.offset = 0;
@@ -704,13 +700,11 @@ add_async_complete (PinosStream *stream,
{
PinosStreamPrivate *priv = stream->priv;
PinosControlCmdNodeEvent cne;
- SpaNodeEvent ne;
SpaNodeEventAsyncComplete ac;
- cne.event = &ne;
- ne.type = SPA_NODE_EVENT_TYPE_ASYNC_COMPLETE;
- ne.data = &ac;
- ne.size = sizeof (ac);
+ cne.event = &ac.event;
+ ac.event.type = SPA_NODE_EVENT_TYPE_ASYNC_COMPLETE;
+ ac.event.size = sizeof (ac);
ac.seq = seq;
ac.res = res;
pinos_connection_add_cmd (priv->conn, PINOS_CONTROL_CMD_NODE_EVENT, &cne);
@@ -721,13 +715,11 @@ send_reuse_buffer (PinosStream *stream, uint32_t port_id, uint32_t buffer_id)
{
PinosStreamPrivate *priv = stream->priv;
PinosControlCmdNodeEvent cne;
- SpaNodeEvent ne;
SpaNodeEventReuseBuffer rb;
- cne.event = &ne;
- ne.type = SPA_NODE_EVENT_TYPE_REUSE_BUFFER;
- ne.data = &rb;
- ne.size = sizeof (rb);
+ cne.event = &rb.event;
+ rb.event.type = SPA_NODE_EVENT_TYPE_REUSE_BUFFER;
+ rb.event.size = sizeof (rb);
rb.port_id = port_id;
rb.buffer_id = buffer_id;
pinos_connection_add_cmd (priv->rtconn, PINOS_CONTROL_CMD_NODE_EVENT, &cne);
@@ -742,7 +734,6 @@ send_process_buffer (PinosStream *stream, uint32_t port_id, uint32_t buffer_id)
PinosStreamPrivate *priv = stream->priv;
PinosControlCmdProcessBuffer pb;
PinosControlCmdNodeEvent cne;
- SpaNodeEvent ne;
SpaNodeEventHaveOutput ho;
pb.direction = priv->direction;
@@ -750,10 +741,9 @@ send_process_buffer (PinosStream *stream, uint32_t port_id, uint32_t buffer_id)
pb.buffer_id = buffer_id;
pinos_connection_add_cmd (priv->rtconn, PINOS_CONTROL_CMD_PROCESS_BUFFER, &pb);
- cne.event = &ne;
- ne.type = SPA_NODE_EVENT_TYPE_HAVE_OUTPUT;
- ne.data = &ho;
- ne.size = sizeof (ho);
+ cne.event = &ho.event;
+ ho.event.type = SPA_NODE_EVENT_TYPE_HAVE_OUTPUT;
+ ho.event.size = sizeof (ho);
ho.port_id = port_id;
pinos_connection_add_cmd (priv->rtconn, PINOS_CONTROL_CMD_NODE_EVENT, &cne);
@@ -854,7 +844,7 @@ handle_rtnode_event (PinosStream *stream,
case SPA_NODE_EVENT_TYPE_REUSE_BUFFER:
{
- SpaNodeEventReuseBuffer *p = event->data;
+ SpaNodeEventReuseBuffer *p = (SpaNodeEventReuseBuffer *) event;
BufferId *bid;
if (p->port_id != priv->port_id)
@@ -924,7 +914,7 @@ handle_node_command (PinosStream *stream,
case SPA_NODE_COMMAND_CLOCK_UPDATE:
{
- SpaNodeCommandClockUpdate *cu = command->data;
+ SpaNodeCommandClockUpdate *cu = (SpaNodeCommandClockUpdate *) command;
if (cu->flags & SPA_NODE_COMMAND_CLOCK_UPDATE_FLAG_LIVE) {
pinos_properties_set (priv->properties,
"pinos.latency.is-live", "1");
diff --git a/pinos/modules/spa/spa-alsa-monitor.c b/pinos/modules/spa/spa-alsa-monitor.c
index 393b2e78..5a87d32f 100644
--- a/pinos/modules/spa/spa-alsa-monitor.c
+++ b/pinos/modules/spa/spa-alsa-monitor.c
@@ -176,18 +176,18 @@ on_monitor_event (SpaMonitor *monitor,
switch (event->type) {
case SPA_MONITOR_EVENT_TYPE_ADDED:
{
- SpaMonitorItem *item = event->data;
+ SpaMonitorItem *item = (SpaMonitorItem *) event;
add_item (this, item);
break;
}
case SPA_MONITOR_EVENT_TYPE_REMOVED:
{
- SpaMonitorItem *item = event->data;
+ SpaMonitorItem *item = (SpaMonitorItem *) event;
remove_item (this, item);
}
case SPA_MONITOR_EVENT_TYPE_CHANGED:
{
- SpaMonitorItem *item = event->data;
+ SpaMonitorItem *item = (SpaMonitorItem *) event;
g_debug ("alsa-monitor %p: changed: \"%s\"", this, item->name);
break;
}
diff --git a/pinos/modules/spa/spa-v4l2-monitor.c b/pinos/modules/spa/spa-v4l2-monitor.c
index 0f0d0139..06500c6c 100644
--- a/pinos/modules/spa/spa-v4l2-monitor.c
+++ b/pinos/modules/spa/spa-v4l2-monitor.c
@@ -177,18 +177,18 @@ on_monitor_event (SpaMonitor *monitor,
switch (event->type) {
case SPA_MONITOR_EVENT_TYPE_ADDED:
{
- SpaMonitorItem *item = event->data;
+ SpaMonitorItem *item = (SpaMonitorItem *) event;
add_item (this, item);
break;
}
case SPA_MONITOR_EVENT_TYPE_REMOVED:
{
- SpaMonitorItem *item = event->data;
+ SpaMonitorItem *item = (SpaMonitorItem *) event;
remove_item (this, item);
}
case SPA_MONITOR_EVENT_TYPE_CHANGED:
{
- SpaMonitorItem *item = event->data;
+ SpaMonitorItem *item = (SpaMonitorItem *) event;
g_debug ("v4l2-monitor %p: changed: \"%s\"", this, item->name);
break;
}
diff --git a/pinos/server/client-node.c b/pinos/server/client-node.c
index d1bcb378..4ae6b2ed 100644
--- a/pinos/server/client-node.c
+++ b/pinos/server/client-node.c
@@ -148,15 +148,13 @@ enum
static void
send_async_complete (SpaProxy *this, uint32_t seq, SpaResult res)
{
- SpaNodeEvent event;
SpaNodeEventAsyncComplete ac;
- event.type = SPA_NODE_EVENT_TYPE_ASYNC_COMPLETE;
- event.data = &ac;
- event.size = sizeof (ac);
+ ac.event.type = SPA_NODE_EVENT_TYPE_ASYNC_COMPLETE;
+ ac.event.size = sizeof (ac);
ac.seq = seq;
ac.res = res;
- this->event_cb (&this->node, &event, this->user_data);
+ this->event_cb (&this->node, &ac.event, this->user_data);
}
static SpaResult
@@ -220,8 +218,7 @@ spa_proxy_node_send_command (SpaNode *node,
if (!pinos_connection_flush (this->conn)) {
spa_log_error (this->log, "proxy %p: error writing connection\n", this);
res = SPA_RESULT_ERROR;
- }
- else
+ } else
res = SPA_RESULT_RETURN_ASYNC (cnc.seq);
break;
}
@@ -238,7 +235,6 @@ spa_proxy_node_send_command (SpaNode *node,
spa_log_error (this->log, "proxy %p: error writing connection\n", this);
res = SPA_RESULT_ERROR;
}
-
break;
}
}
@@ -960,7 +956,6 @@ spa_proxy_node_port_reuse_buffer (SpaNode *node,
{
SpaProxy *this;
PinosControlCmdNodeEvent cne;
- SpaNodeEvent ne;
SpaNodeEventReuseBuffer rb;
if (node == NULL)
@@ -972,10 +967,9 @@ spa_proxy_node_port_reuse_buffer (SpaNode *node,
return SPA_RESULT_INVALID_PORT;
/* send start */
- cne.event = &ne;
- ne.type = SPA_NODE_EVENT_TYPE_REUSE_BUFFER;
- ne.data = &rb;
- ne.size = sizeof (rb);
+ cne.event = &rb.event;
+ rb.event.type = SPA_NODE_EVENT_TYPE_REUSE_BUFFER;
+ rb.event.size = sizeof (rb);
rb.port_id = port_id;
rb.buffer_id = buffer_id;
pinos_connection_add_cmd (this->rtconn, PINOS_CONTROL_CMD_NODE_EVENT, &cne);
diff --git a/pinos/server/data-loop.c b/pinos/server/data-loop.c
index 3bff749d..8a1db6e2 100644
--- a/pinos/server/data-loop.c
+++ b/pinos/server/data-loop.c
@@ -157,7 +157,7 @@ loop (void *user_data)
while (spa_ringbuffer_get_read_offset (&priv->buffer, &offset) > 0) {
InvokeItem *item = SPA_MEMBER (priv->buffer_data, offset, InvokeItem);
g_debug ("data-loop %p: invoke %d", this, item->seq);
- item->func (p, item->seq, item->size, item->data, item->user_data);
+ item->func (p, true, item->seq, item->size, item->data, item->user_data);
spa_ringbuffer_read_advance (&priv->buffer, item->item_size);
}
continue;
@@ -313,36 +313,43 @@ do_invoke (SpaPoll *poll,
{
PinosDataLoop *this = SPA_CONTAINER_OF (poll, PinosDataLoop, poll);
PinosDataLoopPrivate *priv = this->priv;
+ gboolean in_thread = pthread_equal (priv->thread, pthread_self());
SpaRingbufferArea areas[2];
InvokeItem *item;
+ SpaResult res;
- spa_ringbuffer_get_write_areas (&priv->buffer, areas);
- if (areas[0].len < sizeof (InvokeItem)) {
- g_warning ("queue full");
- return SPA_RESULT_ERROR;
- }
- item = SPA_MEMBER (priv->buffer_data, areas[0].offset, InvokeItem);
- item->seq = seq;
- item->func = func;
- item->user_data = user_data;
- item->size = size;
-
- if (areas[0].len > sizeof (InvokeItem) + size) {
- item->data = SPA_MEMBER (item, sizeof (InvokeItem), void);
- item->item_size = sizeof (InvokeItem) + size;
- if (areas[0].len < sizeof (InvokeItem) + item->item_size)
- item->item_size = areas[0].len;
+ if (in_thread) {
+ res = func (poll, false, seq, size, data, user_data);
} else {
- item->data = SPA_MEMBER (priv->buffer_data, areas[1].offset, void);
- item->item_size = areas[0].len + 1 + size;
- }
- memcpy (item->data, data, size);
+ spa_ringbuffer_get_write_areas (&priv->buffer, areas);
+ if (areas[0].len < sizeof (InvokeItem)) {
+ g_warning ("queue full");
+ return SPA_RESULT_ERROR;
+ }
+ item = SPA_MEMBER (priv->buffer_data, areas[0].offset, InvokeItem);
+ item->seq = seq;
+ item->func = func;
+ item->user_data = user_data;
+ item->size = size;
+
+ if (areas[0].len > sizeof (InvokeItem) + size) {
+ item->data = SPA_MEMBER (item, sizeof (InvokeItem), void);
+ item->item_size = sizeof (InvokeItem) + size;
+ if (areas[0].len < sizeof (InvokeItem) + item->item_size)
+ item->item_size = areas[0].len;
+ } else {
+ item->data = SPA_MEMBER (priv->buffer_data, areas[1].offset, void);
+ item->item_size = areas[0].len + 1 + size;
+ }
+ memcpy (item->data, data, size);
- spa_ringbuffer_write_advance (&priv->buffer, item->item_size);
+ spa_ringbuffer_write_advance (&priv->buffer, item->item_size);
- wakeup_thread (this);
+ wakeup_thread (this);
- return SPA_RESULT_RETURN_ASYNC (seq);
+ res = SPA_RESULT_RETURN_ASYNC (seq);
+ }
+ return res;
}
static void
diff --git a/pinos/server/data-loop.h b/pinos/server/data-loop.h
index 84e2f36b..f70c0cd3 100644
--- a/pinos/server/data-loop.h
+++ b/pinos/server/data-loop.h
@@ -62,10 +62,6 @@ struct _PinosDataLoopClass {
GObjectClass parent_class;
};
-typedef void (*PinosCommandFunc) (SpaNodeCommand *command,
- uint32_t seq,
- void *user_data);
-
/* normal GObject stuff */
GType pinos_data_loop_get_type (void);
diff --git a/pinos/server/main-loop.c b/pinos/server/main-loop.c
index 987bbfc3..c0abed2b 100644
--- a/pinos/server/main-loop.c
+++ b/pinos/server/main-loop.c
@@ -167,7 +167,7 @@ main_loop_dispatch (SpaPollNotifyData *data)
while (spa_ringbuffer_get_read_offset (&priv->buffer, &offset) > 0) {
item = SPA_MEMBER (priv->buffer_data, offset, InvokeItem);
- item->func (p, item->seq, item->size, item->data, item->user_data);
+ item->func (p, true, item->seq, item->size, item->data, item->user_data);
spa_ringbuffer_read_advance (&priv->buffer, item->item_size);
}
@@ -184,38 +184,45 @@ do_invoke (SpaPoll *poll,
{
PinosMainLoop *this = SPA_CONTAINER_OF (poll, PinosMainLoop, poll);
PinosMainLoopPrivate *priv = this->priv;
+ gboolean in_thread = FALSE;
SpaRingbufferArea areas[2];
InvokeItem *item;
uint64_t u = 1;
+ SpaResult res;
- spa_ringbuffer_get_write_areas (&priv->buffer, areas);
- if (areas[0].len < sizeof (InvokeItem)) {
- g_warning ("queue full");
- return SPA_RESULT_ERROR;
- }
- item = SPA_MEMBER (priv->buffer_data, areas[0].offset, InvokeItem);
- item->seq = seq;
- item->func = func;
- item->user_data = user_data;
- item->size = size;
-
- if (areas[0].len > sizeof (InvokeItem) + size) {
- item->data = SPA_MEMBER (item, sizeof (InvokeItem), void);
- item->item_size = sizeof (InvokeItem) + size;
- if (areas[0].len < sizeof (InvokeItem) + item->item_size)
- item->item_size = areas[0].len;
+ if (in_thread) {
+ res = func (poll, false, seq, size, data, user_data);
} else {
- item->data = SPA_MEMBER (priv->buffer_data, areas[1].offset, void);
- item->item_size = areas[0].len + 1 + size;
- }
- memcpy (item->data, data, size);
+ spa_ringbuffer_get_write_areas (&priv->buffer, areas);
+ if (areas[0].len < sizeof (InvokeItem)) {
+ g_warning ("queue full");
+ return SPA_RESULT_ERROR;
+ }
+ item = SPA_MEMBER (priv->buffer_data, areas[0].offset, InvokeItem);
+ item->seq = seq;
+ item->func = func;
+ item->user_data = user_data;
+ item->size = size;
+
+ if (areas[0].len > sizeof (InvokeItem) + size) {
+ item->data = SPA_MEMBER (item, sizeof (InvokeItem), void);
+ item->item_size = sizeof (InvokeItem) + size;
+ if (areas[0].len < sizeof (InvokeItem) + item->item_size)
+ item->item_size = areas[0].len;
+ } else {
+ item->data = SPA_MEMBER (priv->buffer_data, areas[1].offset, void);
+ item->item_size = areas[0].len + 1 + size;
+ }
+ memcpy (item->data, data, size);
- spa_ringbuffer_write_advance (&priv->buffer, item->item_size);
+ spa_ringbuffer_write_advance (&priv->buffer, item->item_size);
- if (write (priv->fds[0].fd, &u, sizeof(uint64_t)) != sizeof(uint64_t))
- g_warning ("data-loop %p: failed to write fd", strerror (errno));
+ if (write (priv->fds[0].fd, &u, sizeof(uint64_t)) != sizeof(uint64_t))
+ g_warning ("data-loop %p: failed to write fd", strerror (errno));
- return SPA_RESULT_RETURN_ASYNC (seq);
+ res = SPA_RESULT_RETURN_ASYNC (seq);
+ }
+ return res;
}
static void
diff --git a/pinos/server/main-loop.h b/pinos/server/main-loop.h
index 6a2f71aa..65d6b624 100644
--- a/pinos/server/main-loop.h
+++ b/pinos/server/main-loop.h
@@ -62,9 +62,6 @@ struct _PinosMainLoopClass {
GObjectClass parent_class;
};
-typedef void (*PinosEventFunc) (SpaNodeEvent *event,
- void *user_data);
-
typedef void (*PinosDeferFunc) (gpointer obj,
gpointer data,
SpaResult res,
diff --git a/pinos/server/node.c b/pinos/server/node.c
index a2c0dbaa..a51e0f38 100644
--- a/pinos/server/node.c
+++ b/pinos/server/node.c
@@ -240,8 +240,7 @@ pause_node (PinosNode *this)
g_debug ("node %p: pause node", this);
cmd.type = SPA_NODE_COMMAND_PAUSE;
- cmd.data = NULL;
- cmd.size = 0;
+ cmd.size = sizeof (cmd);
if ((res = spa_node_send_command (this->node, &cmd)) < 0)
g_debug ("got error %d", res);
@@ -257,8 +256,7 @@ start_node (PinosNode *this)
g_debug ("node %p: start node", this);
cmd.type = SPA_NODE_COMMAND_START;
- cmd.data = NULL;
- cmd.size = 0;
+ cmd.size = sizeof (cmd);
if ((res = spa_node_send_command (this->node, &cmd)) < 0)
g_debug ("got error %d", res);
@@ -300,14 +298,11 @@ suspend_node (PinosNode *this)
static void
send_clock_update (PinosNode *this)
{
- SpaNodeCommand cmd;
SpaNodeCommandClockUpdate cu;
SpaResult res;
- cmd.type = SPA_NODE_COMMAND_CLOCK_UPDATE;
- cmd.data = &cu;
- cmd.size = sizeof (cu);
-
+ cu.command.type = SPA_NODE_COMMAND_CLOCK_UPDATE;
+ cu.command.size = sizeof (cu);
cu.flags = 0;
cu.change_mask = SPA_NODE_COMMAND_CLOCK_UPDATE_TIME |
SPA_NODE_COMMAND_CLOCK_UPDATE_SCALE |
@@ -324,7 +319,7 @@ send_clock_update (PinosNode *this)
cu.scale = (1 << 16) | 1;
cu.state = SPA_CLOCK_STATE_RUNNING;
- if ((res = spa_node_send_command (this->node, &cmd)) < 0)
+ if ((res = spa_node_send_command (this->node, &cu.command)) < 0)
g_debug ("got error %d", res);
}
@@ -374,7 +369,7 @@ on_node_event (SpaNode *node, SpaNodeEvent *event, void *user_data)
case SPA_NODE_EVENT_TYPE_ASYNC_COMPLETE:
{
- SpaNodeEventAsyncComplete *ac = event->data;
+ SpaNodeEventAsyncComplete *ac = (SpaNodeEventAsyncComplete *) event;
g_debug ("node %p: async complete event %d %d", this, ac->seq, ac->res);
pinos_main_loop_defer_complete (priv->main_loop, this, ac->seq, ac->res);
@@ -384,7 +379,7 @@ on_node_event (SpaNode *node, SpaNodeEvent *event, void *user_data)
case SPA_NODE_EVENT_TYPE_NEED_INPUT:
{
- SpaNodeEventNeedInput *ni = event->data;
+ SpaNodeEventNeedInput *ni = (SpaNodeEventNeedInput *) event;
PinosPort *p;
guint i;
@@ -401,7 +396,7 @@ on_node_event (SpaNode *node, SpaNodeEvent *event, void *user_data)
}
case SPA_NODE_EVENT_TYPE_HAVE_OUTPUT:
{
- SpaNodeEventHaveOutput *ho = event->data;
+ SpaNodeEventHaveOutput *ho = (SpaNodeEventHaveOutput *) event;
SpaPortOutputInfo oinfo[1] = { 0, };
SpaResult res;
gboolean pushed = FALSE;
@@ -440,7 +435,7 @@ on_node_event (SpaNode *node, SpaNodeEvent *event, void *user_data)
case SPA_NODE_EVENT_TYPE_REUSE_BUFFER:
{
SpaResult res;
- SpaNodeEventReuseBuffer *rb = event->data;
+ SpaNodeEventReuseBuffer *rb = (SpaNodeEventReuseBuffer *) event;
PinosPort *p;
guint i;
diff --git a/spa/include/spa/monitor.h b/spa/include/spa/monitor.h
index bac7aecd..6c04c774 100644
--- a/spa/include/spa/monitor.h
+++ b/spa/include/spa/monitor.h
@@ -33,6 +33,25 @@ typedef struct _SpaMonitor SpaMonitor;
#include <spa/dict.h>
#include <spa/plugin.h>
+/**
+ * SpaMonitorEventType:
+ * @SPA_MONITOR_EVENT_TYPE_INVALID: invalid event
+ * @SPA_MONITOR_EVENT_TYPE_ADDED: an item was added, data points to #SpaMonitorItem
+ * @SPA_MONITOR_EVENT_TYPE_REMOVED: an item was removed, data points to #SpaMonitorItem
+ * @SPA_MONITOR_EVENT_TYPE_CHANGED: an item was changed, data points to #SpaMonitorItem
+ */
+typedef enum {
+ SPA_MONITOR_EVENT_TYPE_INVALID = 0,
+ SPA_MONITOR_EVENT_TYPE_ADDED,
+ SPA_MONITOR_EVENT_TYPE_REMOVED,
+ SPA_MONITOR_EVENT_TYPE_CHANGED,
+} SpaMonitorEventType;
+
+typedef struct {
+ SpaMonitorEventType type;
+ size_t size;
+} SpaMonitorEvent;
+
typedef enum {
SPA_MONITOR_ITEM_FLAG_NONE = 0,
} SpaMonitorItemFlags;
@@ -50,6 +69,7 @@ typedef enum {
} SpaMonitorItemState;
typedef struct {
+ SpaMonitorEvent event;
const char *id;
SpaMonitorItemFlags flags;
SpaMonitorItemState state;
@@ -60,26 +80,6 @@ typedef struct {
} SpaMonitorItem;
/**
- * SpaMonitorEventType:
- * @SPA_MONITOR_EVENT_TYPE_INVALID: invalid event
- * @SPA_MONITOR_EVENT_TYPE_ADDED: an item was added, data points to #SpaMonitorItem
- * @SPA_MONITOR_EVENT_TYPE_REMOVED: an item was removed, data points to #SpaMonitorItem
- * @SPA_MONITOR_EVENT_TYPE_CHANGED: an item was changed, data points to #SpaMonitorItem
- */
-typedef enum {
- SPA_MONITOR_EVENT_TYPE_INVALID = 0,
- SPA_MONITOR_EVENT_TYPE_ADDED,
- SPA_MONITOR_EVENT_TYPE_REMOVED,
- SPA_MONITOR_EVENT_TYPE_CHANGED,
-} SpaMonitorEventType;
-
-typedef struct {
- SpaMonitorEventType type;
- void *data;
- size_t size;
-} SpaMonitorEvent;
-
-/**
* SpaMonitorCallback:
* @node: a #SpaMonitor emiting the event
* @event: the event that was emited
diff --git a/spa/include/spa/node-command.h b/spa/include/spa/node-command.h
index c9e728e6..77d243de 100644
--- a/spa/include/spa/node-command.h
+++ b/spa/include/spa/node-command.h
@@ -51,7 +51,6 @@ typedef enum {
struct _SpaNodeCommand {
SpaNodeCommandType type;
- void *data;
size_t size;
};
@@ -68,20 +67,21 @@ struct _SpaNodeCommand {
* @state: the new clock state, when @change_mask = 1<<2
*/
typedef struct {
+ SpaNodeCommand command;
#define SPA_NODE_COMMAND_CLOCK_UPDATE_TIME (1 << 0)
#define SPA_NODE_COMMAND_CLOCK_UPDATE_SCALE (1 << 1)
#define SPA_NODE_COMMAND_CLOCK_UPDATE_STATE (1 << 2)
#define SPA_NODE_COMMAND_CLOCK_UPDATE_LATENCY (1 << 3)
- uint32_t change_mask;
- int32_t rate;
- int64_t ticks;
- int64_t monotonic_time;
- int64_t offset;
- int32_t scale;
- SpaClockState state;
+ uint32_t change_mask;
+ int32_t rate;
+ int64_t ticks;
+ int64_t monotonic_time;
+ int64_t offset;
+ int32_t scale;
+ SpaClockState state;
#define SPA_NODE_COMMAND_CLOCK_UPDATE_FLAG_LIVE (1 << 0)
- uint32_t flags;
- int64_t latency;
+ uint32_t flags;
+ int64_t latency;
} SpaNodeCommandClockUpdate;
#ifdef __cplusplus
diff --git a/spa/include/spa/node-event.h b/spa/include/spa/node-event.h
index 9a4bf7d1..090a00d4 100644
--- a/spa/include/spa/node-event.h
+++ b/spa/include/spa/node-event.h
@@ -68,29 +68,33 @@ typedef enum {
struct _SpaNodeEvent {
SpaNodeEventType type;
- void *data;
size_t size;
};
typedef struct {
+ SpaNodeEvent event;
uint32_t seq;
SpaResult res;
} SpaNodeEventAsyncComplete;
typedef struct {
+ SpaNodeEvent event;
uint32_t port_id;
} SpaNodeEventHaveOutput;
typedef struct {
+ SpaNodeEvent event;
uint32_t port_id;
} SpaNodeEventNeedInput;
typedef struct {
+ SpaNodeEvent event;
uint32_t port_id;
uint32_t buffer_id;
} SpaNodeEventReuseBuffer;
typedef struct {
+ SpaNodeEvent event;
#define SPA_NODE_EVENT_REQUEST_CLOCK_UPDATE_TIME (1 << 0)
#define SPA_NODE_EVENT_REQUEST_CLOCK_UPDATE_SCALE (1 << 1)
#define SPA_NODE_EVENT_REQUEST_CLOCK_UPDATE_STATE (1 << 2)
diff --git a/spa/include/spa/poll.h b/spa/include/spa/poll.h
index df65152b..b1831606 100644
--- a/spa/include/spa/poll.h
+++ b/spa/include/spa/poll.h
@@ -88,6 +88,7 @@ typedef struct {
typedef SpaResult (*SpaPollInvokeFunc) (SpaPoll *poll,
+ bool async,
uint32_t seq,
size_t size,
void *data,
@@ -131,7 +132,6 @@ struct _SpaPoll {
SpaResult (*remove_item) (SpaPoll *poll,
SpaPollItem *item);
-
SpaResult (*invoke) (SpaPoll *poll,
SpaPollInvokeFunc func,
uint32_t seq,
diff --git a/spa/plugins/alsa/alsa-monitor.c b/spa/plugins/alsa/alsa-monitor.c
index 447822c3..ab961b07 100644
--- a/spa/plugins/alsa/alsa-monitor.c
+++ b/spa/plugins/alsa/alsa-monitor.c
@@ -216,7 +216,7 @@ alsa_on_fd_events (SpaPollNotifyData *data)
SpaALSAMonitor *this = data->user_data;
struct udev_device *dev;
const char *str;
- SpaMonitorEvent event;
+ SpaMonitorItem *item;
dev = udev_monitor_receive_device (this->umonitor);
if (fill_item (&this->uitem, dev) < 0)
@@ -225,16 +225,17 @@ alsa_on_fd_events (SpaPollNotifyData *data)
if ((str = udev_device_get_action (dev)) == NULL)
str = "change";
+ item = &this->uitem.item;
+
if (strcmp (str, "add") == 0) {
- event.type = SPA_MONITOR_EVENT_TYPE_ADDED;
+ item->event.type = SPA_MONITOR_EVENT_TYPE_ADDED;
} else if (strcmp (str, "change") == 0) {
- event.type = SPA_MONITOR_EVENT_TYPE_CHANGED;
+ item->event.type = SPA_MONITOR_EVENT_TYPE_CHANGED;
} else if (strcmp (str, "remove") == 0) {
- event.type = SPA_MONITOR_EVENT_TYPE_REMOVED;
+ item->event.type = SPA_MONITOR_EVENT_TYPE_REMOVED;
}
- event.data = &this->uitem.item;
- event.size = sizeof (this->uitem);
- this->event_cb (&this->monitor, &event, this->user_data);
+ item->event.size = sizeof (this->uitem);
+ this->event_cb (&this->monitor, &item->event, this->user_data);
return 0;
}
diff --git a/spa/plugins/alsa/alsa-utils.c b/spa/plugins/alsa/alsa-utils.c
index 08234a05..258e6d01 100644
--- a/spa/plugins/alsa/alsa-utils.c
+++ b/spa/plugins/alsa/alsa-utils.c
@@ -241,14 +241,12 @@ xrun_recovery (SpaALSAState *state, snd_pcm_t *hndl, int err)
static void
pull_input (SpaALSAState *state, void *data, snd_pcm_uframes_t frames)
{
- SpaNodeEvent event;
SpaNodeEventNeedInput ni;
- event.type = SPA_NODE_EVENT_TYPE_NEED_INPUT;
- event.size = sizeof (ni);
- event.data = &ni;
+ ni.event.type = SPA_NODE_EVENT_TYPE_NEED_INPUT;
+ ni.event.size = sizeof (ni);
ni.port_id = 0;
- state->event_cb (&state->node, &event, state->user_data);
+ state->event_cb (&state->node, &ni.event, state->user_data);
}
static int
@@ -370,7 +368,6 @@ mmap_read (SpaALSAState *state)
if (b) {
- SpaNodeEvent event;
SpaNodeEventHaveOutput ho;
SpaData *d;
@@ -380,11 +377,10 @@ mmap_read (SpaALSAState *state)
b->next = NULL;
SPA_QUEUE_PUSH_TAIL (&state->ready, SpaALSABuffer, next, b);
- event.type = SPA_NODE_EVENT_TYPE_HAVE_OUTPUT;
- event.size = sizeof (ho);
- event.data = &ho;
+ ho.event.type = SPA_NODE_EVENT_TYPE_HAVE_OUTPUT;
+ ho.event.size = sizeof (ho);
ho.port_id = 0;
- state->event_cb (&state->node, &event, state->user_data);
+ state->event_cb (&state->node, &ho.event, state->user_data);
}
return 0;
}
diff --git a/spa/plugins/audiomixer/audiomixer.c b/spa/plugins/audiomixer/audiomixer.c
index 814171b6..2d285a61 100644
--- a/spa/plugins/audiomixer/audiomixer.c
+++ b/spa/plugins/audiomixer/audiomixer.c
@@ -566,14 +566,12 @@ spa_audiomixer_node_port_push_input (SpaNode *node,
static void
pull_port (SpaAudioMixer *this, uint32_t port_id, SpaPortOutputInfo *info, size_t pull_size)
{
- SpaNodeEvent event;
SpaNodeEventNeedInput ni;
- event.type = SPA_NODE_EVENT_TYPE_NEED_INPUT;
- event.size = sizeof (ni);
- event.data = &ni;
+ ni.event.type = SPA_NODE_EVENT_TYPE_NEED_INPUT;
+ ni.event.size = sizeof (ni);
ni.port_id = port_id;
- this->event_cb (&this->node, &event, this->user_data);
+ this->event_cb (&this->node, &ni.event, this->user_data);
}
static void
diff --git a/spa/plugins/audiotestsrc/audiotestsrc.c b/spa/plugins/audiotestsrc/audiotestsrc.c
index 1d9089bc..17705523 100644
--- a/spa/plugins/audiotestsrc/audiotestsrc.c
+++ b/spa/plugins/audiotestsrc/audiotestsrc.c
@@ -229,15 +229,13 @@ spa_audiotestsrc_node_set_props (SpaNode *node,
static SpaResult
send_have_output (SpaAudioTestSrc *this)
{
- SpaNodeEvent event;
SpaNodeEventHaveOutput ho;
if (this->event_cb) {
- event.type = SPA_NODE_EVENT_TYPE_HAVE_OUTPUT;
- event.size = sizeof (ho);
- event.data = &ho;
+ ho.event.type = SPA_NODE_EVENT_TYPE_HAVE_OUTPUT;
+ ho.event.size = sizeof (ho);
ho.port_id = 0;
- this->event_cb (&this->node, &event, this->user_data);
+ this->event_cb (&this->node, &ho.event, this->user_data);
}
return SPA_RESULT_OK;
diff --git a/spa/plugins/v4l2/v4l2-monitor.c b/spa/plugins/v4l2/v4l2-monitor.c
index 06a7eeb0..eda1043e 100644
--- a/spa/plugins/v4l2/v4l2-monitor.c
+++ b/spa/plugins/v4l2/v4l2-monitor.c
@@ -186,7 +186,8 @@ v4l2_on_fd_events (SpaPollNotifyData *data)
SpaV4l2Monitor *this = data->user_data;
struct udev_device *dev;
const char *action;
- SpaMonitorEvent event;
+ SpaMonitorItem *item;
+
dev = udev_monitor_receive_device (this->umonitor);
fill_item (&this->uitem, dev);
@@ -196,16 +197,17 @@ v4l2_on_fd_events (SpaPollNotifyData *data)
if ((action = udev_device_get_action (dev)) == NULL)
action = "change";
+ item = &this->uitem.item;
+
if (strcmp (action, "add") == 0) {
- event.type = SPA_MONITOR_EVENT_TYPE_ADDED;
+ item->event.type = SPA_MONITOR_EVENT_TYPE_ADDED;
} else if (strcmp (action, "change") == 0) {
- event.type = SPA_MONITOR_EVENT_TYPE_CHANGED;
+ item->event.type = SPA_MONITOR_EVENT_TYPE_CHANGED;
} else if (strcmp (action, "remove") == 0) {
- event.type = SPA_MONITOR_EVENT_TYPE_REMOVED;
+ item->event.type = SPA_MONITOR_EVENT_TYPE_REMOVED;
}
- event.data = &this->uitem.item;
- event.size = sizeof (this->uitem);
- this->event_cb (&this->monitor, &event, this->user_data);
+ item->event.size = sizeof (this->uitem);
+ this->event_cb (&this->monitor, &item->event, this->user_data);
return 0;
}
diff --git a/spa/plugins/v4l2/v4l2-source.c b/spa/plugins/v4l2/v4l2-source.c
index 026c0e60..ccd1b103 100644
--- a/spa/plugins/v4l2/v4l2-source.c
+++ b/spa/plugins/v4l2/v4l2-source.c
@@ -225,25 +225,23 @@ spa_v4l2_source_node_set_props (SpaNode *node,
}
static SpaResult
-do_command_complete (SpaPoll *poll,
- uint32_t seq,
- size_t size,
- void *data,
- void *user_data)
+do_send_event (SpaPoll *poll,
+ bool async,
+ uint32_t seq,
+ size_t size,
+ void *data,
+ void *user_data)
{
SpaV4l2Source *this = user_data;
- SpaNodeEvent event;
- event.type = SPA_NODE_EVENT_TYPE_ASYNC_COMPLETE;
- event.size = size;
- event.data = data;
- this->event_cb (&this->node, &event, this->user_data);
+ this->event_cb (&this->node, data, this->user_data);
return SPA_RESULT_OK;
}
static SpaResult
do_start (SpaPoll *poll,
+ bool async,
uint32_t seq,
size_t size,
void *data,
@@ -255,19 +253,24 @@ do_start (SpaPoll *poll,
res = spa_v4l2_start (this);
- ac.seq = seq;
- ac.res = res;
- spa_poll_invoke (this->state[0].main_loop,
- do_command_complete,
- seq,
- sizeof (ac),
- &ac,
- this);
+ if (async) {
+ ac.event.type = SPA_NODE_EVENT_TYPE_ASYNC_COMPLETE;
+ ac.event.size = sizeof (SpaNodeEventAsyncComplete);
+ ac.seq = seq;
+ ac.res = res;
+ spa_poll_invoke (this->state[0].main_loop,
+ do_send_event,
+ seq,
+ sizeof (ac),
+ &ac,
+ this);
+ }
return res;
}
static SpaResult
do_pause (SpaPoll *poll,
+ bool async,
uint32_t seq,
size_t size,
void *data,
@@ -279,18 +282,21 @@ do_pause (SpaPoll *poll,
res = spa_v4l2_pause (this);
- ac.seq = seq;
- ac.res = res;
- spa_poll_invoke (this->state[0].main_loop,
- do_command_complete,
- seq,
- sizeof (ac),
- &ac,
- this);
+ if (async) {
+ ac.event.type = SPA_NODE_EVENT_TYPE_ASYNC_COMPLETE;
+ ac.event.size = sizeof (SpaNodeEventAsyncComplete);
+ ac.seq = seq;
+ ac.res = res;
+ spa_poll_invoke (this->state[0].main_loop,
+ do_send_event,
+ seq,
+ sizeof (ac),
+ &ac,
+ this);
+ }
return res;
}
-
static SpaResult
spa_v4l2_source_node_send_command (SpaNode *node,
SpaNodeCommand *command)
diff --git a/spa/plugins/v4l2/v4l2-utils.c b/spa/plugins/v4l2/v4l2-utils.c
index fe7333d6..7ff9f043 100644
--- a/spa/plugins/v4l2/v4l2-utils.c
+++ b/spa/plugins/v4l2/v4l2-utils.c
@@ -895,7 +895,6 @@ static int
v4l2_on_fd_events (SpaPollNotifyData *data)
{
SpaV4l2Source *this = data->user_data;
- SpaNodeEvent event;
SpaNodeEventHaveOutput ho;
if (data->fds[0].revents & POLLERR)
@@ -907,11 +906,10 @@ v4l2_on_fd_events (SpaPollNotifyData *data)
if (mmap_read (this) < 0)
return 0;
- event.type = SPA_NODE_EVENT_TYPE_HAVE_OUTPUT;
- event.size = sizeof (ho);
- event.data = &ho;
+ ho.event.type = SPA_NODE_EVENT_TYPE_HAVE_OUTPUT;
+ ho.event.size = sizeof (ho);
ho.port_id = 0;
- this->event_cb (&this->node, &event, this->user_data);
+ this->event_cb (&this->node, &ho.event, this->user_data);
return 0;
}
diff --git a/spa/plugins/videotestsrc/videotestsrc.c b/spa/plugins/videotestsrc/videotestsrc.c
index dafe1a89..601a0177 100644
--- a/spa/plugins/videotestsrc/videotestsrc.c
+++ b/spa/plugins/videotestsrc/videotestsrc.c
@@ -182,15 +182,13 @@ spa_videotestsrc_node_set_props (SpaNode *node,
static SpaResult
send_have_output (SpaVideoTestSrc *this)
{
- SpaNodeEvent event;
SpaNodeEventHaveOutput ho;
if (this->event_cb) {
- event.type = SPA_NODE_EVENT_TYPE_HAVE_OUTPUT;
- event.size = sizeof (ho);
- event.data = &ho;
+ ho.event.type = SPA_NODE_EVENT_TYPE_HAVE_OUTPUT;
+ ho.event.size = sizeof (ho);
ho.port_id = 0;
- this->event_cb (&this->node, &event, this->user_data);
+ this->event_cb (&this->node, &ho.event, this->user_data);
}
return SPA_RESULT_OK;
diff --git a/spa/plugins/volume/volume.c b/spa/plugins/volume/volume.c
index a84f5fa3..0a193b95 100644
--- a/spa/plugins/volume/volume.c
+++ b/spa/plugins/volume/volume.c
@@ -521,15 +521,13 @@ find_free_buffer (SpaVolume *this, SpaVolumePort *port)
static void
release_buffer (SpaVolume *this, SpaBuffer *buffer)
{
- SpaNodeEvent event;
SpaNodeEventReuseBuffer rb;
- event.type = SPA_NODE_EVENT_TYPE_REUSE_BUFFER;
- event.data = &rb;
- event.size = sizeof (rb);
+ rb.event.type = SPA_NODE_EVENT_TYPE_REUSE_BUFFER;
+ rb.event.size = sizeof (rb);
rb.port_id = 0;
rb.buffer_id = buffer->id;
- this->event_cb (&this->node, &event, this->user_data);
+ this->event_cb (&this->node, &rb.event, this->user_data);
}
static SpaResult
diff --git a/spa/tests/test-mixer.c b/spa/tests/test-mixer.c
index 2ac3e41d..6b161cd8 100644
--- a/spa/tests/test-mixer.c
+++ b/spa/tests/test-mixer.c
@@ -112,7 +112,7 @@ on_mix_event (SpaNode *node, SpaNodeEvent *event, void *user_data)
SpaPortInputInfo iinfo;
SpaPortOutputInfo oinfo;
SpaResult res;
- SpaNodeEventNeedInput *ni = event->data;
+ SpaNodeEventNeedInput *ni = (SpaNodeEventNeedInput *) event;
oinfo.port_id = 0;
oinfo.flags = SPA_PORT_OUTPUT_FLAG_NONE;
@@ -150,7 +150,7 @@ on_sink_event (SpaNode *node, SpaNodeEvent *event, void *user_data)
SpaPortInputInfo iinfo;
SpaPortOutputInfo oinfo;
SpaResult res;
- SpaNodeEventNeedInput *ni = event->data;
+ SpaNodeEventNeedInput *ni = (SpaNodeEventNeedInput *)event;
oinfo.port_id = 0;
oinfo.flags = SPA_PORT_OUTPUT_FLAG_PULL;
diff --git a/spa/tools/spa-monitor.c b/spa/tools/spa-monitor.c
index 1c23cb97..4c04fbcb 100644
--- a/spa/tools/spa-monitor.c
+++ b/spa/tools/spa-monitor.c
@@ -71,21 +71,21 @@ on_monitor_event (SpaMonitor *monitor,
switch (event->type) {
case SPA_MONITOR_EVENT_TYPE_ADDED:
{
- SpaMonitorItem *item = event->data;
+ SpaMonitorItem *item = (SpaMonitorItem *) event;
fprintf (stderr, "added:\n");
inspect_item (item);
break;
}
case SPA_MONITOR_EVENT_TYPE_REMOVED:
{
- SpaMonitorItem *item = event->data;
+ SpaMonitorItem *item = (SpaMonitorItem *) event;
fprintf (stderr, "removed:\n");
inspect_item (item);
break;
}
case SPA_MONITOR_EVENT_TYPE_CHANGED:
{
- SpaMonitorItem *item = event->data;
+ SpaMonitorItem *item = (SpaMonitorItem *) event;
fprintf (stderr, "changed:\n");
inspect_item (item);
break;