mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
cleanups
Follow the data/size argument order convention to make the api more consistent.
This commit is contained in:
parent
7f931464e8
commit
5bebfe022b
50 changed files with 253 additions and 252 deletions
|
|
@ -204,12 +204,12 @@ static int impl_get_n_ports(struct spa_node *node,
|
|||
}
|
||||
|
||||
static int impl_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)
|
||||
{
|
||||
if (n_input_ports > 0)
|
||||
if (n_input_ids > 0)
|
||||
input_ids[0] = 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,12 +120,12 @@ static int impl_get_n_ports(struct spa_node *node,
|
|||
}
|
||||
|
||||
static int impl_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)
|
||||
{
|
||||
if (n_output_ports > 0)
|
||||
if (n_output_ids > 0)
|
||||
output_ids[0] = 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,12 +199,12 @@ static int impl_get_n_ports(struct spa_node *node,
|
|||
}
|
||||
|
||||
static int impl_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)
|
||||
{
|
||||
if (n_input_ports > 0)
|
||||
if (n_input_ids > 0)
|
||||
input_ids[0] = 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ on_stream_format_changed(void *_data, struct spa_pod *format)
|
|||
void *d;
|
||||
|
||||
if (format == NULL) {
|
||||
pw_stream_finish_format(stream, 0, 0, NULL);
|
||||
pw_stream_finish_format(stream, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -254,7 +254,7 @@ on_stream_format_changed(void *_data, struct spa_pod *format)
|
|||
|
||||
sdl_format = id_to_sdl_format(data, data->format.format);
|
||||
if (sdl_format == SDL_PIXELFORMAT_UNKNOWN) {
|
||||
pw_stream_finish_format(stream, -EINVAL, 0, NULL);
|
||||
pw_stream_finish_format(stream, -EINVAL, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -279,7 +279,7 @@ on_stream_format_changed(void *_data, struct spa_pod *format)
|
|||
":", t->param_meta.type, "I", t->meta.Header,
|
||||
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
|
||||
|
||||
pw_stream_finish_format(stream, 0, 2, params);
|
||||
pw_stream_finish_format(stream, 0, params, 2);
|
||||
}
|
||||
|
||||
static const struct pw_stream_events stream_events = {
|
||||
|
|
@ -362,7 +362,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo
|
|||
PW_DIRECTION_INPUT,
|
||||
data->path,
|
||||
PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE,
|
||||
1, params);
|
||||
params, 1);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ on_stream_format_changed(void *_data, struct spa_pod *format)
|
|||
struct spa_pod *params[2];
|
||||
|
||||
if (format == NULL) {
|
||||
pw_stream_finish_format(stream, 0, 0, NULL);
|
||||
pw_stream_finish_format(stream, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
spa_format_video_raw_parse(format, &data->format, &data->type.format_video);
|
||||
|
|
@ -196,7 +196,7 @@ on_stream_format_changed(void *_data, struct spa_pod *format)
|
|||
":", t->param_meta.type, "I", t->meta.Header,
|
||||
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
|
||||
|
||||
pw_stream_finish_format(stream, 0, 2, params);
|
||||
pw_stream_finish_format(stream, 0, params, 2);
|
||||
}
|
||||
|
||||
static const struct pw_stream_events stream_events = {
|
||||
|
|
@ -245,7 +245,7 @@ static void on_state_changed(void *_data, enum pw_remote_state old, enum pw_remo
|
|||
pw_stream_connect(data->stream,
|
||||
PW_DIRECTION_OUTPUT,
|
||||
NULL, PW_STREAM_FLAG_NONE,
|
||||
1, params);
|
||||
params, 1);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ gst_pipewire_sink_class_init (GstPipeWireSinkClass * klass)
|
|||
process_mem_data_quark = g_quark_from_static_string ("GstPipeWireSinkProcessMemQuark");
|
||||
}
|
||||
|
||||
#define SPA_PROP_RANGE(min,max) 2,min,max
|
||||
#define PROP_RANGE(min,max) 2,min,max
|
||||
|
||||
static void
|
||||
pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
|
||||
|
|
@ -235,15 +235,15 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
|
|||
spa_pod_builder_push_object (&b, t->param.idBuffers, t->param_buffers.Buffers);
|
||||
if (size == 0)
|
||||
spa_pod_builder_add (&b,
|
||||
":", t->param_buffers.size, "iru", 0, SPA_PROP_RANGE(0, INT32_MAX), NULL);
|
||||
":", t->param_buffers.size, "iru", 0, PROP_RANGE(0, INT32_MAX), NULL);
|
||||
else
|
||||
spa_pod_builder_add (&b,
|
||||
":", t->param_buffers.size, "ir", size, SPA_PROP_RANGE(size, INT32_MAX), NULL);
|
||||
":", t->param_buffers.size, "ir", size, PROP_RANGE(size, INT32_MAX), NULL);
|
||||
|
||||
spa_pod_builder_add (&b,
|
||||
":", t->param_buffers.stride, "ir", 0, SPA_PROP_RANGE(0, INT32_MAX),
|
||||
":", t->param_buffers.stride, "ir", 0, PROP_RANGE(0, INT32_MAX),
|
||||
":", t->param_buffers.buffers, "iru", min_buffers,
|
||||
SPA_PROP_RANGE(min_buffers,
|
||||
PROP_RANGE(min_buffers,
|
||||
max_buffers ? max_buffers : INT32_MAX),
|
||||
":", t->param_buffers.align, "i", 16,
|
||||
NULL);
|
||||
|
|
@ -256,7 +256,7 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
|
|||
|
||||
|
||||
pw_thread_loop_lock (sink->main_loop);
|
||||
pw_stream_finish_format (sink->stream, 0, 2, port_params);
|
||||
pw_stream_finish_format (sink->stream, 0, port_params, 2);
|
||||
pw_thread_loop_unlock (sink->main_loop);
|
||||
}
|
||||
|
||||
|
|
@ -610,8 +610,8 @@ gst_pipewire_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
|||
PW_DIRECTION_OUTPUT,
|
||||
pwsink->path,
|
||||
flags,
|
||||
possible->len,
|
||||
(const struct spa_pod **) possible->pdata);
|
||||
(const struct spa_pod **) possible->pdata,
|
||||
possible->len);
|
||||
|
||||
while (TRUE) {
|
||||
state = pw_stream_get_state (pwsink->stream, &error);
|
||||
|
|
|
|||
|
|
@ -664,8 +664,8 @@ gst_pipewire_src_negotiate (GstBaseSrc * basesrc)
|
|||
PW_DIRECTION_INPUT,
|
||||
pwsrc->path,
|
||||
PW_STREAM_FLAG_AUTOCONNECT,
|
||||
possible->len,
|
||||
(const struct spa_pod **)possible->pdata);
|
||||
(const struct spa_pod **)possible->pdata,
|
||||
possible->len);
|
||||
g_ptr_array_free (possible, TRUE);
|
||||
|
||||
while (TRUE) {
|
||||
|
|
@ -738,7 +738,7 @@ on_format_changed (void *data,
|
|||
|
||||
if (format == NULL) {
|
||||
GST_DEBUG_OBJECT (pwsrc, "clear format");
|
||||
pw_stream_finish_format (pwsrc->stream, 0, 0, NULL);
|
||||
pw_stream_finish_format (pwsrc->stream, 0, NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -766,10 +766,10 @@ on_format_changed (void *data,
|
|||
":", t->param_meta.size, "i", sizeof (struct spa_meta_header));
|
||||
|
||||
GST_DEBUG_OBJECT (pwsrc, "doing finish format");
|
||||
pw_stream_finish_format (pwsrc->stream, 0, 2, params);
|
||||
pw_stream_finish_format (pwsrc->stream, 0, params, 2);
|
||||
} else {
|
||||
GST_WARNING_OBJECT (pwsrc, "finish format with error");
|
||||
pw_stream_finish_format (pwsrc->stream, -EINVAL, 0, NULL);
|
||||
pw_stream_finish_format (pwsrc->stream, -EINVAL, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ core_create_link(void *object,
|
|||
|
||||
}
|
||||
|
||||
static void core_update_types(void *object, uint32_t first_id, uint32_t n_types, const char **types)
|
||||
static void core_update_types(void *object, uint32_t first_id, const char **types, uint32_t n_types)
|
||||
{
|
||||
struct pw_resource *resource = object;
|
||||
struct pw_core *this = resource->core;
|
||||
|
|
|
|||
|
|
@ -91,13 +91,13 @@ struct pw_core_proxy_methods {
|
|||
* Send a type map update to the PipeWire server. The server uses this
|
||||
* information to keep a mapping between client types and the server types.
|
||||
* \param first_id the id of the first type
|
||||
* \param n_types the number of types
|
||||
* \param types the types as a string
|
||||
* \param n_types the number of types
|
||||
*/
|
||||
void (*update_types) (void *object,
|
||||
uint32_t first_id,
|
||||
uint32_t n_types,
|
||||
const char **types);
|
||||
const char **types,
|
||||
uint32_t n_types);
|
||||
/**
|
||||
* Do server roundtrip
|
||||
*
|
||||
|
|
@ -161,9 +161,9 @@ struct pw_core_proxy_methods {
|
|||
};
|
||||
|
||||
static inline void
|
||||
pw_core_proxy_update_types(struct pw_core_proxy *core, uint32_t first_id, uint32_t n_types, const char **types)
|
||||
pw_core_proxy_update_types(struct pw_core_proxy *core, uint32_t first_id, const char **types, uint32_t n_types)
|
||||
{
|
||||
pw_proxy_do((struct pw_proxy*)core, struct pw_core_proxy_methods, update_types, first_id, n_types, types);
|
||||
pw_proxy_do((struct pw_proxy*)core, struct pw_core_proxy_methods, update_types, first_id, types, n_types);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
@ -238,13 +238,13 @@ struct pw_core_proxy_events {
|
|||
* Send a type map update to the client. The client uses this
|
||||
* information to keep a mapping between server types and the client types.
|
||||
* \param first_id the id of the first type
|
||||
* \param n_types the number of types
|
||||
* \param types the types as a string
|
||||
* \param n_types the number of \a types
|
||||
*/
|
||||
void (*update_types) (void *object,
|
||||
uint32_t first_id,
|
||||
uint32_t n_types,
|
||||
const char **types);
|
||||
const char **types,
|
||||
uint32_t n_types);
|
||||
/**
|
||||
* Emit a done event
|
||||
*
|
||||
|
|
|
|||
|
|
@ -152,12 +152,12 @@ struct pw_node_info {
|
|||
const char *name; /**< name the node, suitable for display */
|
||||
uint32_t max_input_ports; /**< maximum number of inputs */
|
||||
uint32_t n_input_ports; /**< number of inputs */
|
||||
uint32_t n_input_params; /**< number of input params */
|
||||
struct spa_pod **input_params; /**< array of input params */
|
||||
uint32_t n_input_params; /**< number of input params */
|
||||
uint32_t max_output_ports; /**< maximum number of outputs */
|
||||
uint32_t n_output_ports; /**< number of outputs */
|
||||
uint32_t n_output_params; /**< number of output params */
|
||||
struct spa_pod **output_params; /**< array of output params */
|
||||
uint32_t n_output_params; /**< number of output params */
|
||||
enum pw_node_state state; /**< the current state of the node */
|
||||
const char *error; /**< an error reason if \a state is error */
|
||||
struct spa_dict *props; /**< the properties of the node */
|
||||
|
|
|
|||
|
|
@ -724,7 +724,7 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s
|
|||
|
||||
static int
|
||||
do_activate_link(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_link *this = user_data;
|
||||
spa_graph_port_link(&this->rt.out_port, &this->rt.in_port);
|
||||
|
|
@ -747,7 +747,7 @@ static int do_start(struct pw_link *this, uint32_t in_state, uint32_t out_state)
|
|||
output = this->output;
|
||||
|
||||
pw_loop_invoke(output->node->data_loop,
|
||||
do_activate_link, SPA_ID_INVALID, 0, NULL, false, this);
|
||||
do_activate_link, SPA_ID_INVALID, NULL, 0, false, this);
|
||||
|
||||
if (in_state == PW_PORT_STATE_PAUSED) {
|
||||
if ((res = pw_node_set_state(input->node, PW_NODE_STATE_RUNNING)) < 0) {
|
||||
|
|
@ -860,7 +860,7 @@ static void clear_port_buffers(struct pw_link *link, struct pw_port *port)
|
|||
|
||||
static int
|
||||
do_remove_input(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_link *this = user_data;
|
||||
spa_graph_port_remove(&this->rt.in_port);
|
||||
|
|
@ -876,14 +876,14 @@ static void input_remove(struct pw_link *this, struct pw_port *port)
|
|||
spa_hook_remove(&impl->input_node_listener);
|
||||
|
||||
pw_loop_invoke(port->node->data_loop,
|
||||
do_remove_input, 1, 0, NULL, true, this);
|
||||
do_remove_input, 1, NULL, 0, true, this);
|
||||
|
||||
clear_port_buffers(this, this->input);
|
||||
}
|
||||
|
||||
static int
|
||||
do_remove_output(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_link *this = user_data;
|
||||
spa_graph_port_remove(&this->rt.out_port);
|
||||
|
|
@ -899,7 +899,7 @@ static void output_remove(struct pw_link *this, struct pw_port *port)
|
|||
spa_hook_remove(&impl->output_node_listener);
|
||||
|
||||
pw_loop_invoke(port->node->data_loop,
|
||||
do_remove_output, 1, 0, NULL, true, this);
|
||||
do_remove_output, 1, NULL, 0, true, this);
|
||||
|
||||
clear_port_buffers(this, this->output);
|
||||
}
|
||||
|
|
@ -965,7 +965,7 @@ bool pw_link_activate(struct pw_link *this)
|
|||
|
||||
static int
|
||||
do_deactivate_link(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_link *this = user_data;
|
||||
spa_graph_port_unlink(&this->rt.out_port);
|
||||
|
|
@ -983,7 +983,7 @@ bool pw_link_deactivate(struct pw_link *this)
|
|||
impl->active = false;
|
||||
pw_log_debug("link %p: deactivate", this);
|
||||
pw_loop_invoke(this->output->node->data_loop,
|
||||
do_deactivate_link, SPA_ID_INVALID, 0, NULL, true, this);
|
||||
do_deactivate_link, SPA_ID_INVALID, NULL, 0, true, this);
|
||||
|
||||
input_node = this->input->node;
|
||||
output_node = this->output->node;
|
||||
|
|
@ -1064,7 +1064,7 @@ link_bind_func(struct pw_global *global,
|
|||
|
||||
static int
|
||||
do_add_link(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_link *this = user_data;
|
||||
struct pw_port *port = ((struct pw_port **) data)[0];
|
||||
|
|
@ -1193,9 +1193,9 @@ struct pw_link *pw_link_new(struct pw_core *core,
|
|||
|
||||
/* nodes can be in different data loops so we do this twice */
|
||||
pw_loop_invoke(output_node->data_loop, do_add_link,
|
||||
SPA_ID_INVALID, sizeof(struct pw_port *), &output, false, this);
|
||||
SPA_ID_INVALID, &output, sizeof(struct pw_port *), false, this);
|
||||
pw_loop_invoke(input_node->data_loop, do_add_link,
|
||||
SPA_ID_INVALID, sizeof(struct pw_port *), &input, false, this);
|
||||
SPA_ID_INVALID, &input, sizeof(struct pw_port *), false, this);
|
||||
|
||||
spa_hook_list_call(&output->listener_list, struct pw_port_events, link_added, this);
|
||||
spa_hook_list_call(&input->listener_list, struct pw_port_events, link_added, this);
|
||||
|
|
|
|||
|
|
@ -203,10 +203,10 @@ static int update_port_ids(struct pw_node *node)
|
|||
output_port_ids = alloca(sizeof(uint32_t) * n_output_ports);
|
||||
|
||||
res = spa_node_get_port_ids(node->node,
|
||||
max_input_ports,
|
||||
input_port_ids,
|
||||
max_output_ports,
|
||||
output_port_ids);
|
||||
max_input_ports,
|
||||
output_port_ids,
|
||||
max_output_ports);
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
|
|
@ -331,7 +331,7 @@ node_bind_func(struct pw_global *global,
|
|||
|
||||
static int
|
||||
do_node_add(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_node *this = user_data;
|
||||
|
||||
|
|
@ -352,7 +352,7 @@ void pw_node_register(struct pw_node *this,
|
|||
update_port_ids(this);
|
||||
update_info(this);
|
||||
|
||||
pw_loop_invoke(this->data_loop, do_node_add, 1, 0, NULL, false, this);
|
||||
pw_loop_invoke(this->data_loop, do_node_add, 1, NULL, 0, false, this);
|
||||
|
||||
spa_list_append(&core->node_list, &this->link);
|
||||
this->global = pw_core_add_global(core, owner, parent,
|
||||
|
|
@ -552,7 +552,7 @@ void pw_node_add_listener(struct pw_node *node,
|
|||
|
||||
static int
|
||||
do_node_remove(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_node *this = user_data;
|
||||
|
||||
|
|
@ -580,7 +580,7 @@ void pw_node_destroy(struct pw_node *node)
|
|||
pw_log_debug("node %p: destroy", impl);
|
||||
spa_hook_list_call(&node->listener_list, struct pw_node_events, destroy);
|
||||
|
||||
pw_loop_invoke(node->data_loop, do_node_remove, 1, 0, NULL, true, node);
|
||||
pw_loop_invoke(node->data_loop, do_node_remove, 1, NULL, 0, true, node);
|
||||
|
||||
if (node->global) {
|
||||
spa_list_remove(&node->link);
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ void * pw_port_get_user_data(struct pw_port *port)
|
|||
}
|
||||
|
||||
static int do_add_port(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_port *this = user_data;
|
||||
|
||||
|
|
@ -290,7 +290,7 @@ bool pw_port_add(struct pw_port *port, struct pw_node *node)
|
|||
spa_node_port_set_io(node->node, port->direction, port_id, port->rt.port.io);
|
||||
|
||||
port->rt.graph = node->rt.graph;
|
||||
pw_loop_invoke(node->data_loop, do_add_port, SPA_ID_INVALID, 0, NULL, false, port);
|
||||
pw_loop_invoke(node->data_loop, do_add_port, SPA_ID_INVALID, NULL, 0, false, port);
|
||||
|
||||
if (port->state <= PW_PORT_STATE_INIT)
|
||||
port_update_state(port, PW_PORT_STATE_CONFIGURE);
|
||||
|
|
@ -300,7 +300,7 @@ bool pw_port_add(struct pw_port *port, struct pw_node *node)
|
|||
}
|
||||
|
||||
static int do_remove_port(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_port *this = user_data;
|
||||
struct spa_graph_port *p;
|
||||
|
|
@ -326,7 +326,7 @@ void pw_port_destroy(struct pw_port *port)
|
|||
spa_hook_list_call(&port->listener_list, struct pw_port_events, destroy);
|
||||
|
||||
if (node) {
|
||||
pw_loop_invoke(port->node->data_loop, do_remove_port, SPA_ID_INVALID, 0, NULL, true, port);
|
||||
pw_loop_invoke(port->node->data_loop, do_remove_port, SPA_ID_INVALID, NULL, 0, true, port);
|
||||
|
||||
if (port->direction == PW_DIRECTION_INPUT) {
|
||||
pw_map_remove(&node->input_port_map, port->port_id);
|
||||
|
|
@ -356,7 +356,7 @@ void pw_port_destroy(struct pw_port *port)
|
|||
|
||||
static int
|
||||
do_port_command(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct pw_port *port = user_data;
|
||||
struct pw_node *node = port->node;
|
||||
|
|
@ -366,7 +366,7 @@ do_port_command(struct spa_loop *loop,
|
|||
int pw_port_send_command(struct pw_port *port, bool block, const struct spa_command *command)
|
||||
{
|
||||
return pw_loop_invoke(port->node->data_loop, do_port_command, 0,
|
||||
SPA_POD_SIZE(command), command, block, port);
|
||||
command, SPA_POD_SIZE(command), block, port);
|
||||
}
|
||||
|
||||
int pw_port_pause(struct pw_port *port)
|
||||
|
|
|
|||
|
|
@ -66,12 +66,12 @@ struct pw_protocol_server {
|
|||
struct pw_protocol_marshal {
|
||||
const char *type; /**< interface type */
|
||||
uint32_t version; /**< version */
|
||||
uint32_t n_methods; /**< number of methods in the interface */
|
||||
const void *method_marshal;
|
||||
const void *method_demarshal;
|
||||
uint32_t n_events; /**< number of events in the interface */
|
||||
uint32_t n_methods; /**< number of methods in the interface */
|
||||
const void *event_marshal;
|
||||
const void *event_demarshal;
|
||||
uint32_t n_events; /**< number of events in the interface */
|
||||
};
|
||||
|
||||
struct pw_protocol_implementaton {
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ static void core_event_remove_id(void *data, uint32_t id)
|
|||
}
|
||||
|
||||
static void
|
||||
core_event_update_types(void *data, uint32_t first_id, uint32_t n_types, const char **types)
|
||||
core_event_update_types(void *data, uint32_t first_id, const char **types, uint32_t n_types)
|
||||
{
|
||||
struct pw_remote *this = data;
|
||||
int i;
|
||||
|
|
@ -428,7 +428,7 @@ void pw_remote_disconnect(struct pw_remote *remote)
|
|||
|
||||
static int
|
||||
do_remove_source(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct node_data *d = user_data;
|
||||
|
||||
|
|
@ -445,7 +445,7 @@ static void unhandle_socket(struct pw_proxy *proxy)
|
|||
struct node_data *data = proxy->user_data;
|
||||
|
||||
pw_loop_invoke(data->core->data_loop,
|
||||
do_remove_source, 1, 0, NULL, true, data);
|
||||
do_remove_source, 1, NULL, 0, true, data);
|
||||
}
|
||||
|
||||
static void handle_rtnode_message(struct pw_proxy *proxy, struct pw_client_node_message *message)
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ void pw_stream_add_listener(struct pw_stream *stream,
|
|||
|
||||
static int
|
||||
do_remove_sources(struct spa_loop *loop,
|
||||
bool async, uint32_t seq, size_t size, const void *data, void *user_data)
|
||||
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||
{
|
||||
struct stream *impl = user_data;
|
||||
struct pw_stream *stream = &impl->this;
|
||||
|
|
@ -303,7 +303,7 @@ static void unhandle_socket(struct pw_stream *stream)
|
|||
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
|
||||
|
||||
pw_loop_invoke(stream->remote->core->data_loop,
|
||||
do_remove_sources, 1, 0, NULL, true, impl);
|
||||
do_remove_sources, 1, NULL, 0, true, impl);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -999,8 +999,8 @@ pw_stream_connect(struct pw_stream *stream,
|
|||
enum pw_direction direction,
|
||||
const char *port_path,
|
||||
enum pw_stream_flags flags,
|
||||
uint32_t n_params,
|
||||
const struct spa_pod **params)
|
||||
const struct spa_pod **params,
|
||||
uint32_t n_params)
|
||||
{
|
||||
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
|
||||
|
||||
|
|
@ -1045,8 +1045,8 @@ pw_stream_get_node_id(struct pw_stream *stream)
|
|||
void
|
||||
pw_stream_finish_format(struct pw_stream *stream,
|
||||
int res,
|
||||
uint32_t n_params,
|
||||
struct spa_pod **params)
|
||||
struct spa_pod **params,
|
||||
uint32_t n_params)
|
||||
{
|
||||
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
|
||||
|
||||
|
|
|
|||
|
|
@ -264,10 +264,10 @@ pw_stream_connect(struct pw_stream *stream, /**< a \ref pw_stream */
|
|||
const char *port_path, /**< the port path to connect to or NULL
|
||||
* to let the server choose a port */
|
||||
enum pw_stream_flags flags, /**< stream flags */
|
||||
uint32_t n_params, /**< number of items in \a params */
|
||||
const struct spa_pod **params /**< an array with params. The params
|
||||
const struct spa_pod **params, /**< an array with params. The params
|
||||
* should ideally contain supported
|
||||
* formats. */);
|
||||
* formats. */
|
||||
uint32_t n_params /**< number of items in \a params */);
|
||||
|
||||
/** Get the node ID of the stream. \memberof pw_stream
|
||||
* \return node ID. */
|
||||
|
|
@ -286,10 +286,10 @@ void pw_stream_disconnect(struct pw_stream *stream);
|
|||
void
|
||||
pw_stream_finish_format(struct pw_stream *stream, /**< a \ref pw_stream */
|
||||
int res, /**< a result code */
|
||||
uint32_t n_params, /**< number of elements in \a params */
|
||||
struct spa_pod **params /**< an array of params. The params should
|
||||
struct spa_pod **params, /**< an array of params. The params should
|
||||
* ideally contain parameters for doing
|
||||
* buffer allocation. */);
|
||||
* buffer allocation. */
|
||||
uint32_t n_params /**< number of elements in \a params */);
|
||||
|
||||
/** Activate or deactivate the stream \memberof pw_stream */
|
||||
void pw_stream_set_active(struct pw_stream *stream, bool active);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue