Work on event loop

Make a new epoll based event loop and use it for the data tranport.
Simplify the spa event api a little and rename to SpaLoop
This commit is contained in:
Wim Taymans 2016-11-18 17:46:01 +01:00
parent 0d2fa5ebc8
commit ae93f15965
33 changed files with 1286 additions and 954 deletions

View file

@ -153,7 +153,7 @@ spa_alsa_source_node_set_props (SpaNode *node,
}
static SpaResult
do_send_event (SpaPoll *poll,
do_send_event (SpaLoop *loop,
bool async,
uint32_t seq,
size_t size,
@ -168,7 +168,7 @@ do_send_event (SpaPoll *poll,
}
static SpaResult
do_start (SpaPoll *poll,
do_start (SpaLoop *loop,
bool async,
uint32_t seq,
size_t size,
@ -188,7 +188,7 @@ do_start (SpaPoll *poll,
ac.event.size = sizeof (SpaNodeEventAsyncComplete);
ac.seq = seq;
ac.res = res;
spa_poll_invoke (this->main_loop,
spa_loop_invoke (this->main_loop,
do_send_event,
SPA_ID_INVALID,
sizeof (ac),
@ -199,7 +199,7 @@ do_start (SpaPoll *poll,
}
static SpaResult
do_pause (SpaPoll *poll,
do_pause (SpaLoop *loop,
bool async,
uint32_t seq,
size_t size,
@ -219,7 +219,7 @@ do_pause (SpaPoll *poll,
ac.event.size = sizeof (SpaNodeEventAsyncComplete);
ac.seq = seq;
ac.res = res;
spa_poll_invoke (this->main_loop,
spa_loop_invoke (this->main_loop,
do_send_event,
SPA_ID_INVALID,
sizeof (ac),
@ -252,7 +252,7 @@ spa_alsa_source_node_send_command (SpaNode *node,
if (this->n_buffers == 0)
return SPA_RESULT_NO_BUFFERS;
return spa_poll_invoke (this->data_loop,
return spa_loop_invoke (this->data_loop,
do_start,
++this->seq,
0,
@ -268,7 +268,7 @@ spa_alsa_source_node_send_command (SpaNode *node,
if (this->n_buffers == 0)
return SPA_RESULT_NO_BUFFERS;
return spa_poll_invoke (this->data_loop,
return spa_loop_invoke (this->data_loop,
do_pause,
++this->seq,
0,
@ -888,9 +888,9 @@ alsa_source_init (const SpaHandleFactory *factory,
this->map = support[i].data;
else if (strcmp (support[i].uri, SPA_LOG_URI) == 0)
this->log = support[i].data;
else if (strcmp (support[i].uri, SPA_POLL__DataLoop) == 0)
else if (strcmp (support[i].uri, SPA_LOOP__DataLoop) == 0)
this->data_loop = support[i].data;
else if (strcmp (support[i].uri, SPA_POLL__MainLoop) == 0)
else if (strcmp (support[i].uri, SPA_LOOP__MainLoop) == 0)
this->main_loop = support[i].data;
}
if (this->map == NULL) {