loop: add signal count to callback

Don't try to signal too many times
This commit is contained in:
Wim Taymans 2017-07-19 10:44:03 +02:00
parent aff9564518
commit 91d54364fc
8 changed files with 20 additions and 12 deletions

View file

@ -42,16 +42,16 @@ struct spa_graph {
struct spa_list nodes;
};
#define SPA_VERSION_GRAPH_NODE_METHODS 0
struct spa_graph_node_methods {
#define SPA_VERSION_GRAPH_NODE_METHODS 0
uint32_t version;
int (*process_input) (struct spa_graph_node *node, void *user_data);
int (*process_output) (struct spa_graph_node *node, void *user_data);
};
#define SPA_VERSION_GRAPH_PORT_METHODS 0
struct spa_graph_port_methods {
#define SPA_VERSION_GRAPH_PORT_METHODS 0
uint32_t version;
int (*reuse_buffer) (struct spa_graph_port *port, uint32_t buffer_id, void *user_data);

View file

@ -152,7 +152,8 @@ typedef void (*spa_source_io_func_t) (struct spa_loop_utils *utils,
typedef void (*spa_source_idle_func_t) (struct spa_loop_utils *utils,
struct spa_source *source, void *data);
typedef void (*spa_source_event_func_t) (struct spa_loop_utils *utils,
struct spa_source *source, void *data);
struct spa_source *source,
uint64_t count, void *data);
typedef void (*spa_source_timer_func_t) (struct spa_loop_utils *utils,
struct spa_source *source, void *data);
typedef void (*spa_source_signal_func_t) (struct spa_loop_utils *utils,

View file

@ -263,7 +263,7 @@ loop_invoke(struct spa_loop *loop,
return res;
}
static void wakeup_func(struct spa_loop_utils *utils, struct spa_source *source, void *data)
static void wakeup_func(struct spa_loop_utils *utils, struct spa_source *source, uint64_t count, void *data)
{
struct impl *impl = data;
uint32_t index;
@ -458,7 +458,7 @@ static void source_event_func(struct spa_source *source)
if (read(source->fd, &count, sizeof(uint64_t)) != sizeof(uint64_t))
spa_log_warn(impl->impl->log, NAME " %p: failed to read event fd: %s", source, strerror(errno));
impl->func.event(&impl->impl->utils, source, source->data);
impl->func.event(&impl->impl->utils, source, count, source->data);
}
static struct spa_source *loop_add_event(struct spa_loop_utils *utils,