Follow the data/size argument order convention to make the api
more consistent.
This commit is contained in:
Wim Taymans 2017-11-20 15:26:44 +01:00
parent 7f931464e8
commit 5bebfe022b
50 changed files with 253 additions and 252 deletions

View file

@ -278,10 +278,10 @@ spa_proxy_node_get_n_ports(struct spa_node *node,
static int
spa_proxy_node_get_port_ids(struct spa_node *node,
uint32_t n_input_ports,
uint32_t *input_ids,
uint32_t n_output_ports,
uint32_t *output_ids)
uint32_t n_input_ids,
uint32_t *output_ids,
uint32_t n_output_ids)
{
struct proxy *this;
int c, i;
@ -292,13 +292,13 @@ spa_proxy_node_get_port_ids(struct spa_node *node,
this = SPA_CONTAINER_OF(node, struct proxy, node);
if (input_ids) {
for (c = 0, i = 0; i < MAX_INPUTS && c < n_input_ports; i++) {
for (c = 0, i = 0; i < MAX_INPUTS && c < n_input_ids; i++) {
if (this->in_ports[i].valid)
input_ids[c++] = i;
}
}
if (output_ids) {
for (c = 0, i = 0; i < MAX_OUTPUTS && c < n_output_ports; i++) {
for (c = 0, i = 0; i < MAX_OUTPUTS && c < n_output_ids; i++) {
if (this->out_ports[i].valid)
output_ids[c++] = i;
}

View file

@ -817,12 +817,12 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_client_node_
const struct pw_protocol_marshal pw_protocol_native_client_node_marshal = {
PW_TYPE_INTERFACE__ClientNode,
PW_VERSION_CLIENT_NODE,
PW_CLIENT_NODE_PROXY_METHOD_NUM,
&pw_protocol_native_client_node_method_marshal,
&pw_protocol_native_client_node_method_demarshal,
PW_CLIENT_NODE_PROXY_EVENT_NUM,
PW_CLIENT_NODE_PROXY_METHOD_NUM,
&pw_protocol_native_client_node_event_marshal,
pw_protocol_native_client_node_event_demarshal,
PW_CLIENT_NODE_PROXY_EVENT_NUM,
};
struct pw_protocol *pw_protocol_native_ext_client_node_init(struct pw_core *core)

View file

@ -324,7 +324,7 @@ handle_register_port(struct client *client)
return 0;
}
static int do_add_node(struct spa_loop *loop, bool async, uint32_t seq, size_t size, const void *data,
static int do_add_node(struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size,
void *user_data)
{
struct jack_client *jc = user_data;
@ -333,7 +333,7 @@ static int do_add_node(struct spa_loop *loop, bool async, uint32_t seq, size_t s
return 0;
}
static int do_remove_node(struct spa_loop *loop, bool async, uint32_t seq, size_t size, const void *data,
static int do_remove_node(struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size,
void *user_data)
{
struct jack_client *jc = user_data;
@ -380,7 +380,7 @@ handle_activate_client(struct client *client)
jc->realtime = is_real_time;
if (is_real_time)
pw_loop_invoke(jc->node->node->data_loop,
do_add_node, 0, 0, NULL, false, jc);
do_add_node, 0, NULL, 0, false, jc);
}
for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (input_ports[i] != EMPTY); i++)
@ -407,7 +407,7 @@ static int client_deactivate(struct impl *impl, int ref_num)
jc->activated = false;
if (jc->realtime)
pw_loop_invoke(jc->node->node->data_loop,
do_remove_node, 0, 0, NULL, false, jc);
do_remove_node, 0, NULL, 0, false, jc);
}
conn = jack_graph_manager_next_start(mgr);
@ -1078,8 +1078,8 @@ static struct client *client_new(struct impl *impl, int fd)
static int do_graph_order_changed(struct spa_loop *loop,
bool async,
uint32_t seq,
size_t size,
const void *data,
size_t size,
void *user_data)
{
struct impl *impl = user_data;
@ -1118,7 +1118,7 @@ static void jack_node_pull(void *data)
jack_graph_manager_try_switch(mgr, &res);
if (res) {
pw_loop_invoke(pw_core_get_main_loop(impl->core),
do_graph_order_changed, 0, 0, NULL, false, impl);
do_graph_order_changed, 0, NULL, 0, false, impl);
}
/* mix all input */

View file

@ -172,19 +172,19 @@ static int node_get_n_ports(struct spa_node *node,
}
static int node_get_port_ids(struct spa_node *node,
uint32_t n_input_ports,
uint32_t *input_ids,
uint32_t n_output_ports,
uint32_t *output_ids)
uint32_t n_input_ids,
uint32_t *output_ids,
uint32_t n_output_ids)
{
struct node_data *nd = SPA_CONTAINER_OF(node, struct node_data, node_impl);
int i, c;
for (c = i = 0; i < PORT_NUM_FOR_CLIENT && c < n_input_ports; i++) {
for (c = i = 0; i < PORT_NUM_FOR_CLIENT && c < n_input_ids; i++) {
if (nd->port_data[SPA_DIRECTION_INPUT][i])
input_ids[c++] = nd->port_data[SPA_DIRECTION_INPUT][i]->port.port->port_id;
}
for (c = i = 0; i < PORT_NUM_FOR_CLIENT && c < n_output_ports; i++) {
for (c = i = 0; i < PORT_NUM_FOR_CLIENT && c < n_output_ids; i++) {
if (nd->port_data[SPA_DIRECTION_OUTPUT][i])
output_ids[c++] = nd->port_data[SPA_DIRECTION_OUTPUT][i]->port.port->port_id;
}

View file

@ -378,7 +378,7 @@ pw_protocol_native_connection_begin_resource(struct pw_protocol_native_connectio
types[i] = spa_type_map_get_type(core->type.map, b);
client->n_types += diff;
pw_core_resource_update_types(client->core_resource, base, diff, types);
pw_core_resource_update_types(client->core_resource, base, types, diff);
}
impl->dest_id = resource->id;
@ -407,7 +407,7 @@ pw_protocol_native_connection_begin_proxy(struct pw_protocol_native_connection *
types[i] = spa_type_map_get_type(core->type.map, b);
remote->n_types += diff;
pw_core_proxy_update_types(remote->core_proxy, base, diff, types);
pw_core_proxy_update_types(remote->core_proxy, base, types, diff);
}
impl->dest_id = proxy->id;

View file

@ -151,7 +151,7 @@ core_marshal_create_link(void *object,
}
static void
core_marshal_update_types_client(void *object, uint32_t first_id, uint32_t n_types, const char **types)
core_marshal_update_types_client(void *object, uint32_t first_id, const char **types, uint32_t n_types)
{
struct pw_proxy *proxy = object;
struct spa_pod_builder *b;
@ -272,7 +272,7 @@ static bool core_demarshal_update_types_client(void *object, void *data, size_t
if (spa_pod_parser_get(&prs, "s", &types[i], NULL) < 0)
return false;
}
pw_proxy_notify(proxy, struct pw_core_proxy_events, update_types, first_id, n_types, types);
pw_proxy_notify(proxy, struct pw_core_proxy_events, update_types, first_id, types, n_types);
return true;
}
@ -353,7 +353,7 @@ static void core_marshal_remove_id(void *object, uint32_t id)
}
static void
core_marshal_update_types_server(void *object, uint32_t first_id, uint32_t n_types, const char **types)
core_marshal_update_types_server(void *object, uint32_t first_id, const char **types, uint32_t n_types)
{
struct pw_resource *resource = object;
struct spa_pod_builder *b;
@ -516,7 +516,7 @@ static bool core_demarshal_update_types_server(void *object, void *data, size_t
if (spa_pod_parser_get(&prs, "s", &types[i], NULL) < 0)
return false;
}
pw_resource_do(resource, struct pw_core_proxy_methods, update_types, first_id, n_types, types);
pw_resource_do(resource, struct pw_core_proxy_methods, update_types, first_id, types, n_types);
return true;
}
@ -993,12 +993,12 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_core_event_d
static const struct pw_protocol_marshal pw_protocol_native_core_marshal = {
PW_TYPE_INTERFACE__Core,
PW_VERSION_CORE,
PW_CORE_PROXY_METHOD_NUM,
&pw_protocol_native_core_method_marshal,
pw_protocol_native_core_method_demarshal,
PW_CORE_PROXY_EVENT_NUM,
PW_CORE_PROXY_METHOD_NUM,
&pw_protocol_native_core_event_marshal,
pw_protocol_native_core_event_demarshal
pw_protocol_native_core_event_demarshal,
PW_CORE_PROXY_EVENT_NUM
};
static const struct pw_registry_proxy_methods pw_protocol_native_registry_method_marshal = {
@ -1024,12 +1024,12 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_registry_eve
const struct pw_protocol_marshal pw_protocol_native_registry_marshal = {
PW_TYPE_INTERFACE__Registry,
PW_VERSION_REGISTRY,
PW_REGISTRY_PROXY_METHOD_NUM,
&pw_protocol_native_registry_method_marshal,
pw_protocol_native_registry_method_demarshal,
PW_REGISTRY_PROXY_EVENT_NUM,
PW_REGISTRY_PROXY_METHOD_NUM,
&pw_protocol_native_registry_event_marshal,
pw_protocol_native_registry_event_demarshal,
PW_REGISTRY_PROXY_EVENT_NUM,
};
static const struct pw_module_proxy_events pw_protocol_native_module_event_marshal = {
@ -1044,10 +1044,10 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_module_event
const struct pw_protocol_marshal pw_protocol_native_module_marshal = {
PW_TYPE_INTERFACE__Module,
PW_VERSION_MODULE,
0, NULL, NULL,
PW_MODULE_PROXY_EVENT_NUM,
NULL, NULL, 0,
&pw_protocol_native_module_event_marshal,
pw_protocol_native_module_event_demarshal,
PW_MODULE_PROXY_EVENT_NUM,
};
static const struct pw_factory_proxy_events pw_protocol_native_factory_event_marshal = {
@ -1062,10 +1062,10 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_factory_even
const struct pw_protocol_marshal pw_protocol_native_factory_marshal = {
PW_TYPE_INTERFACE__Factory,
PW_VERSION_FACTORY,
0, NULL, NULL,
PW_FACTORY_PROXY_EVENT_NUM,
NULL, NULL, 0,
&pw_protocol_native_factory_event_marshal,
pw_protocol_native_factory_event_demarshal,
PW_FACTORY_PROXY_EVENT_NUM,
};
static const struct pw_node_proxy_events pw_protocol_native_node_event_marshal = {
@ -1080,10 +1080,10 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_node_event_d
static const struct pw_protocol_marshal pw_protocol_native_node_marshal = {
PW_TYPE_INTERFACE__Node,
PW_VERSION_NODE,
0, NULL, NULL,
PW_NODE_PROXY_EVENT_NUM,
NULL, NULL, 0,
&pw_protocol_native_node_event_marshal,
pw_protocol_native_node_event_demarshal,
PW_NODE_PROXY_EVENT_NUM,
};
static const struct pw_client_proxy_events pw_protocol_native_client_event_marshal = {
@ -1098,10 +1098,10 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_client_event
static const struct pw_protocol_marshal pw_protocol_native_client_marshal = {
PW_TYPE_INTERFACE__Client,
PW_VERSION_CLIENT,
0, NULL, NULL,
PW_CLIENT_PROXY_EVENT_NUM,
NULL, NULL, 0,
&pw_protocol_native_client_event_marshal,
pw_protocol_native_client_event_demarshal,
PW_CLIENT_PROXY_EVENT_NUM,
};
static const struct pw_link_proxy_events pw_protocol_native_link_event_marshal = {
@ -1116,10 +1116,10 @@ static const struct pw_protocol_native_demarshal pw_protocol_native_link_event_d
static const struct pw_protocol_marshal pw_protocol_native_link_marshal = {
PW_TYPE_INTERFACE__Link,
PW_VERSION_LINK,
0, NULL, NULL,
PW_LINK_PROXY_EVENT_NUM,
NULL, NULL, 0,
&pw_protocol_native_link_event_marshal,
pw_protocol_native_link_event_demarshal,
PW_LINK_PROXY_EVENT_NUM,
};
void pw_protocol_native_init(struct pw_protocol *protocol)

View file

@ -194,7 +194,7 @@ static void update_monitor(struct pw_core *core, const char *name)
const char *monitors;
struct spa_dict_item item;
const struct pw_properties *props;
struct spa_dict dict = SPA_DICT_INIT(1, &item);
struct spa_dict dict = SPA_DICT_INIT(&item, 1);
props = pw_core_get_properties(core);