Add user_data to callbacks

Add user data to callbacks, it's more flexible and natural
This commit is contained in:
Wim Taymans 2017-06-18 19:48:31 +02:00
parent 59ec32c039
commit 763bd1100e
27 changed files with 156 additions and 165 deletions

View file

@ -72,6 +72,7 @@ struct impl {
struct spa_log *log;
const struct spa_node_callbacks *callbacks;
void *user_data;
struct port in_ports[1];
struct port out_ports[1];
@ -110,7 +111,8 @@ static int spa_ffmpeg_dec_node_send_command(struct spa_node *node, struct spa_co
static int
spa_ffmpeg_dec_node_set_callbacks(struct spa_node *node,
const struct spa_node_callbacks *callbacks)
const struct spa_node_callbacks *callbacks,
void *user_data)
{
struct impl *this;
@ -120,6 +122,7 @@ spa_ffmpeg_dec_node_set_callbacks(struct spa_node *node,
this = SPA_CONTAINER_OF(node, struct impl, node);
this->callbacks = callbacks;
this->user_data = user_data;
return SPA_RESULT_OK;
}

View file

@ -76,6 +76,7 @@ struct impl {
struct spa_log *log;
const struct spa_node_callbacks *callbacks;
void *user_data;
struct port in_ports[1];
struct port out_ports[1];
@ -114,7 +115,8 @@ static int spa_ffmpeg_enc_node_send_command(struct spa_node *node, struct spa_co
static int
spa_ffmpeg_enc_node_set_callbacks(struct spa_node *node,
const struct spa_node_callbacks *callbacks)
const struct spa_node_callbacks *callbacks,
void *user_data)
{
struct impl *this;
@ -124,6 +126,7 @@ spa_ffmpeg_enc_node_set_callbacks(struct spa_node *node,
this = SPA_CONTAINER_OF(node, struct impl, node);
this->callbacks = callbacks;
this->user_data = user_data;
return SPA_RESULT_OK;
}