mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
fix some compiler warnings with clang
This commit is contained in:
parent
317f3b6be7
commit
e4cac644d2
20 changed files with 67 additions and 46 deletions
|
|
@ -51,6 +51,8 @@ enum spa_direction {
|
||||||
SPA_DIRECTION_OUTPUT = 1,
|
SPA_DIRECTION_OUTPUT = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define SPA_DIRECTION_REVERSE(d) ((d) ^ 1)
|
||||||
|
|
||||||
#define SPA_RECTANGLE(width,height) (struct spa_rectangle){ width, height }
|
#define SPA_RECTANGLE(width,height) (struct spa_rectangle){ width, height }
|
||||||
struct spa_rectangle {
|
struct spa_rectangle {
|
||||||
uint32_t width;
|
uint32_t width;
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ static inline void spa_hook_remove(struct spa_hook *hook)
|
||||||
({ \
|
({ \
|
||||||
struct spa_hook_list *list = l; \
|
struct spa_hook_list *list = l; \
|
||||||
struct spa_list *s = start ? (struct spa_list *)start : &list->list; \
|
struct spa_list *s = start ? (struct spa_list *)start : &list->list; \
|
||||||
struct spa_hook cursor = { 0 }, *ci; \
|
struct spa_hook cursor = { { 0} }, *ci; \
|
||||||
int count = 0; \
|
int count = 0; \
|
||||||
spa_list_cursor_start(cursor, s, link); \
|
spa_list_cursor_start(cursor, s, link); \
|
||||||
spa_list_for_each_cursor(ci, cursor, &list->list, link) { \
|
spa_list_for_each_cursor(ci, cursor, &list->list, link) { \
|
||||||
|
|
|
||||||
|
|
@ -1215,7 +1215,7 @@ impl_init(const struct spa_handle_factory *factory,
|
||||||
}
|
}
|
||||||
init_type(&this->type, this->map);
|
init_type(&this->type, this->map);
|
||||||
|
|
||||||
this->dbus_connection = spa_dbus_get_connection(this->dbus, DBUS_BUS_SYSTEM);
|
this->dbus_connection = spa_dbus_get_connection(this->dbus, SPA_DBUS_TYPE_SYSTEM);
|
||||||
if (this->dbus_connection == NULL) {
|
if (this->dbus_connection == NULL) {
|
||||||
spa_log_error(this->log, "no dbus connection");
|
spa_log_error(this->log, "no dbus connection");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
|
||||||
|
|
@ -299,7 +299,7 @@ impl_get_connection(struct spa_dbus *dbus,
|
||||||
conn = calloc(1, sizeof(struct connection));
|
conn = calloc(1, sizeof(struct connection));
|
||||||
conn->this = impl_connection;
|
conn->this = impl_connection;
|
||||||
conn->impl = impl;
|
conn->impl = impl;
|
||||||
conn->conn = dbus_bus_get_private(type, &error);
|
conn->conn = dbus_bus_get_private((DBusBusType)type, &error);
|
||||||
if (conn->conn == NULL)
|
if (conn->conn == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -566,10 +566,12 @@ static void run_async_source(struct data *data)
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
struct data data = { 0 };
|
struct data data;
|
||||||
int res;
|
int res;
|
||||||
const char *str;
|
const char *str;
|
||||||
|
|
||||||
|
spa_zero(data);
|
||||||
|
|
||||||
data.use_buffer = true;
|
data.use_buffer = true;
|
||||||
|
|
||||||
data.map = &default_map.map;
|
data.map = &default_map.map;
|
||||||
|
|
|
||||||
|
|
@ -261,13 +261,15 @@ static void do_remove_source(struct spa_source *source)
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
struct data data = { 0 };
|
struct data data;
|
||||||
int res;
|
int res;
|
||||||
void *handle;
|
void *handle;
|
||||||
spa_handle_factory_enum_func_t enum_func;
|
spa_handle_factory_enum_func_t enum_func;
|
||||||
uint32_t index;
|
uint32_t index;
|
||||||
const char *str;
|
const char *str;
|
||||||
|
|
||||||
|
spa_zero(data);
|
||||||
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
printf("usage: %s <plugin.so>\n", argv[0]);
|
printf("usage: %s <plugin.so>\n", argv[0]);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
|
|
@ -163,12 +163,14 @@ static void handle_monitor(struct data *data, struct spa_monitor *monitor)
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
struct data data = { 0 };
|
struct data data;
|
||||||
int res;
|
int res;
|
||||||
void *handle;
|
void *handle;
|
||||||
spa_handle_factory_enum_func_t enum_func;
|
spa_handle_factory_enum_func_t enum_func;
|
||||||
uint32_t fidx;
|
uint32_t fidx;
|
||||||
|
|
||||||
|
spa_zero(data);
|
||||||
|
|
||||||
data.map = &default_map.map;
|
data.map = &default_map.map;
|
||||||
data.log = &default_log.log;
|
data.log = &default_log.log;
|
||||||
data.main_loop.version = SPA_VERSION_LOOP;
|
data.main_loop.version = SPA_VERSION_LOOP;
|
||||||
|
|
|
||||||
|
|
@ -643,7 +643,9 @@ static const struct pw_remote_events remote_events = {
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
struct data data = { 0, };
|
struct data data;
|
||||||
|
|
||||||
|
spa_zero(data);
|
||||||
|
|
||||||
pw_init(&argc, &argv);
|
pw_init(&argc, &argv);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -579,7 +579,9 @@ static const struct pw_remote_events remote_events = {
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
struct data data = { 0, };
|
struct data data;
|
||||||
|
|
||||||
|
spa_zero(data);
|
||||||
|
|
||||||
pw_init(&argc, &argv);
|
pw_init(&argc, &argv);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -499,7 +499,9 @@ static void make_nodes(struct data *data)
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
struct data data = { 0, };
|
struct data data;
|
||||||
|
|
||||||
|
spa_zero(data);
|
||||||
|
|
||||||
pw_init(&argc, &argv);
|
pw_init(&argc, &argv);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -494,7 +494,9 @@ static int get_fd(struct data *data)
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
struct data data = { 0, };
|
struct data data;
|
||||||
|
|
||||||
|
spa_zero(data);
|
||||||
|
|
||||||
pw_init(&argc, &argv);
|
pw_init(&argc, &argv);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -323,7 +323,9 @@ static const struct pw_remote_events remote_events = {
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
struct data data = { 0, };
|
struct data data;
|
||||||
|
|
||||||
|
spa_zero(data);
|
||||||
|
|
||||||
pw_init(&argc, &argv);
|
pw_init(&argc, &argv);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ static void *create_object(void *_data,
|
||||||
input_node = pw_global_get_object(global);
|
input_node = pw_global_get_object(global);
|
||||||
|
|
||||||
if (output_port_id == -1)
|
if (output_port_id == -1)
|
||||||
outport = pw_node_get_free_port(output_node, SPA_DIRECTION_OUTPUT);
|
outport = pw_node_get_free_port(output_node, PW_DIRECTION_OUTPUT);
|
||||||
else {
|
else {
|
||||||
global = pw_core_find_global(core, output_port_id);
|
global = pw_core_find_global(core, output_port_id);
|
||||||
if (global == NULL || pw_global_get_type(global) != t->port)
|
if (global == NULL || pw_global_get_type(global) != t->port)
|
||||||
|
|
@ -108,7 +108,7 @@ static void *create_object(void *_data,
|
||||||
goto no_output_port;
|
goto no_output_port;
|
||||||
|
|
||||||
if (input_port_id == -1)
|
if (input_port_id == -1)
|
||||||
inport = pw_node_get_free_port(input_node, SPA_DIRECTION_INPUT);
|
inport = pw_node_get_free_port(input_node, PW_DIRECTION_INPUT);
|
||||||
else {
|
else {
|
||||||
global = pw_core_find_global(core, input_port_id);
|
global = pw_core_find_global(core, input_port_id);
|
||||||
if (global == NULL || pw_global_get_type(global) != t->port)
|
if (global == NULL || pw_global_get_type(global) != t->port)
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ int pw_control_link(struct pw_control *control, struct pw_control *other)
|
||||||
if (other->port) {
|
if (other->port) {
|
||||||
struct pw_port *port = other->port;
|
struct pw_port *port = other->port;
|
||||||
if ((res = spa_node_port_set_io(port->node->node,
|
if ((res = spa_node_port_set_io(port->node->node,
|
||||||
port->direction, port->port_id,
|
port->spa_direction, port->port_id,
|
||||||
other->id,
|
other->id,
|
||||||
impl->mem->ptr, control->size)) < 0) {
|
impl->mem->ptr, control->size)) < 0) {
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
@ -180,7 +180,7 @@ int pw_control_link(struct pw_control *control, struct pw_control *other)
|
||||||
if (control->port) {
|
if (control->port) {
|
||||||
struct pw_port *port = control->port;
|
struct pw_port *port = control->port;
|
||||||
if ((res = spa_node_port_set_io(port->node->node,
|
if ((res = spa_node_port_set_io(port->node->node,
|
||||||
port->direction, port->port_id,
|
port->spa_direction, port->port_id,
|
||||||
control->id,
|
control->id,
|
||||||
impl->mem->ptr, control->size)) < 0) {
|
impl->mem->ptr, control->size)) < 0) {
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
@ -222,7 +222,7 @@ int pw_control_unlink(struct pw_control *control, struct pw_control *other)
|
||||||
if (spa_list_is_empty(&control->inputs)) {
|
if (spa_list_is_empty(&control->inputs)) {
|
||||||
struct pw_port *port = control->port;
|
struct pw_port *port = control->port;
|
||||||
if ((res = spa_node_port_set_io(port->node->node,
|
if ((res = spa_node_port_set_io(port->node->node,
|
||||||
port->direction, port->port_id,
|
port->spa_direction, port->port_id,
|
||||||
control->id, NULL, 0)) < 0) {
|
control->id, NULL, 0)) < 0) {
|
||||||
pw_log_warn("control %p: can't unset port control io", control);
|
pw_log_warn("control %p: can't unset port control io", control);
|
||||||
}
|
}
|
||||||
|
|
@ -231,7 +231,7 @@ int pw_control_unlink(struct pw_control *control, struct pw_control *other)
|
||||||
if (other->port) {
|
if (other->port) {
|
||||||
struct pw_port *port = other->port;
|
struct pw_port *port = other->port;
|
||||||
if ((res = spa_node_port_set_io(port->node->node,
|
if ((res = spa_node_port_set_io(port->node->node,
|
||||||
port->direction, port->port_id,
|
port->spa_direction, port->port_id,
|
||||||
other->id, NULL, 0)) < 0) {
|
other->id, NULL, 0)) < 0) {
|
||||||
pw_log_warn("control %p: can't unset port control io", control);
|
pw_log_warn("control %p: can't unset port control io", control);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -662,9 +662,7 @@ struct pw_port *pw_core_find_port(struct pw_core *core,
|
||||||
pw_log_debug("id \"%u\" matches node %p", id, n);
|
pw_log_debug("id \"%u\" matches node %p", id, n);
|
||||||
|
|
||||||
best =
|
best =
|
||||||
pw_node_get_free_port(n,
|
pw_node_get_free_port(n, pw_direction_reverse(other_port->direction));
|
||||||
pw_direction_reverse(other_port->
|
|
||||||
direction));
|
|
||||||
if (best)
|
if (best)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -752,7 +750,7 @@ int pw_core_find_format(struct pw_core *core,
|
||||||
if (in_state == PW_PORT_STATE_CONFIGURE && out_state > PW_PORT_STATE_CONFIGURE) {
|
if (in_state == PW_PORT_STATE_CONFIGURE && out_state > PW_PORT_STATE_CONFIGURE) {
|
||||||
/* only input needs format */
|
/* only input needs format */
|
||||||
if ((res = spa_node_port_enum_params(output->node->node,
|
if ((res = spa_node_port_enum_params(output->node->node,
|
||||||
output->direction, output->port_id,
|
output->spa_direction, output->port_id,
|
||||||
t->param.idFormat, &oidx,
|
t->param.idFormat, &oidx,
|
||||||
NULL, format, builder)) <= 0) {
|
NULL, format, builder)) <= 0) {
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
|
|
@ -763,7 +761,7 @@ int pw_core_find_format(struct pw_core *core,
|
||||||
} else if (out_state == PW_PORT_STATE_CONFIGURE && in_state > PW_PORT_STATE_CONFIGURE) {
|
} else if (out_state == PW_PORT_STATE_CONFIGURE && in_state > PW_PORT_STATE_CONFIGURE) {
|
||||||
/* only output needs format */
|
/* only output needs format */
|
||||||
if ((res = spa_node_port_enum_params(input->node->node,
|
if ((res = spa_node_port_enum_params(input->node->node,
|
||||||
input->direction, input->port_id,
|
input->spa_direction, input->port_id,
|
||||||
t->param.idFormat, &iidx,
|
t->param.idFormat, &iidx,
|
||||||
NULL, format, builder)) <= 0) {
|
NULL, format, builder)) <= 0) {
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
|
|
@ -780,7 +778,7 @@ int pw_core_find_format(struct pw_core *core,
|
||||||
pw_log_debug("core %p: do enum input %d", core, iidx);
|
pw_log_debug("core %p: do enum input %d", core, iidx);
|
||||||
spa_pod_builder_init(&fb, fbuf, sizeof(fbuf));
|
spa_pod_builder_init(&fb, fbuf, sizeof(fbuf));
|
||||||
if ((res = spa_node_port_enum_params(input->node->node,
|
if ((res = spa_node_port_enum_params(input->node->node,
|
||||||
input->direction, input->port_id,
|
input->spa_direction, input->port_id,
|
||||||
t->param.idEnumFormat, &iidx,
|
t->param.idEnumFormat, &iidx,
|
||||||
NULL, &filter, &fb)) <= 0) {
|
NULL, &filter, &fb)) <= 0) {
|
||||||
if (res == 0 && iidx == 0) {
|
if (res == 0 && iidx == 0) {
|
||||||
|
|
@ -795,7 +793,7 @@ int pw_core_find_format(struct pw_core *core,
|
||||||
spa_debug_format(2, core->type.map, filter);
|
spa_debug_format(2, core->type.map, filter);
|
||||||
|
|
||||||
if ((res = spa_node_port_enum_params(output->node->node,
|
if ((res = spa_node_port_enum_params(output->node->node,
|
||||||
output->direction, output->port_id,
|
output->spa_direction, output->port_id,
|
||||||
t->param.idEnumFormat, &oidx,
|
t->param.idEnumFormat, &oidx,
|
||||||
filter, format, builder)) <= 0) {
|
filter, format, builder)) <= 0) {
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
|
||||||
|
|
||||||
if (out_state > PW_PORT_STATE_CONFIGURE && output->node->info.state == PW_NODE_STATE_IDLE) {
|
if (out_state > PW_PORT_STATE_CONFIGURE && output->node->info.state == PW_NODE_STATE_IDLE) {
|
||||||
if ((res = spa_node_port_enum_params(output->node->node,
|
if ((res = spa_node_port_enum_params(output->node->node,
|
||||||
output->direction, output->port_id,
|
output->spa_direction, output->port_id,
|
||||||
t->param.idFormat, &index,
|
t->param.idFormat, &index,
|
||||||
NULL, ¤t, &b)) <= 0) {
|
NULL, ¤t, &b)) <= 0) {
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
|
|
@ -167,7 +167,7 @@ static int do_negotiate(struct pw_link *this, uint32_t in_state, uint32_t out_st
|
||||||
}
|
}
|
||||||
if (in_state > PW_PORT_STATE_CONFIGURE && input->node->info.state == PW_NODE_STATE_IDLE) {
|
if (in_state > PW_PORT_STATE_CONFIGURE && input->node->info.state == PW_NODE_STATE_IDLE) {
|
||||||
if ((res = spa_node_port_enum_params(input->node->node,
|
if ((res = spa_node_port_enum_params(input->node->node,
|
||||||
input->direction, input->port_id,
|
input->spa_direction, input->port_id,
|
||||||
t->param.idFormat, &index,
|
t->param.idFormat, &index,
|
||||||
NULL, ¤t, &b)) <= 0) {
|
NULL, ¤t, &b)) <= 0) {
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
|
|
@ -447,7 +447,7 @@ param_filter(struct pw_link *this,
|
||||||
spa_pod_builder_init(&ib, ibuf, sizeof(ibuf));
|
spa_pod_builder_init(&ib, ibuf, sizeof(ibuf));
|
||||||
pw_log_debug("iparam %d", iidx);
|
pw_log_debug("iparam %d", iidx);
|
||||||
if ((res = spa_node_port_enum_params(in_port->node->node,
|
if ((res = spa_node_port_enum_params(in_port->node->node,
|
||||||
in_port->direction, in_port->port_id,
|
in_port->spa_direction, in_port->port_id,
|
||||||
id, &iidx, NULL, &iparam, &ib)) < 0)
|
id, &iidx, NULL, &iparam, &ib)) < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -462,7 +462,7 @@ param_filter(struct pw_link *this,
|
||||||
|
|
||||||
for (oidx = 0;;) {
|
for (oidx = 0;;) {
|
||||||
pw_log_debug("oparam %d", oidx);
|
pw_log_debug("oparam %d", oidx);
|
||||||
if (spa_node_port_enum_params(out_port->node->node, out_port->direction,
|
if (spa_node_port_enum_params(out_port->node->node, out_port->spa_direction,
|
||||||
out_port->port_id, id, &oidx,
|
out_port->port_id, id, &oidx,
|
||||||
iparam, &oparam, result) <= 0) {
|
iparam, &oparam, result) <= 0) {
|
||||||
break;
|
break;
|
||||||
|
|
@ -500,12 +500,12 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s
|
||||||
|
|
||||||
pw_log_debug("link %p: doing alloc buffers %p %p", this, output->node, input->node);
|
pw_log_debug("link %p: doing alloc buffers %p %p", this, output->node, input->node);
|
||||||
/* find out what's possible */
|
/* find out what's possible */
|
||||||
if ((res = spa_node_port_get_info(output->node->node, output->direction, output->port_id,
|
if ((res = spa_node_port_get_info(output->node->node, output->spa_direction, output->port_id,
|
||||||
&oinfo)) < 0) {
|
&oinfo)) < 0) {
|
||||||
asprintf(&error, "error get output port info: %d", res);
|
asprintf(&error, "error get output port info: %d", res);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if ((res = spa_node_port_get_info(input->node->node, input->direction, input->port_id,
|
if ((res = spa_node_port_get_info(input->node->node, input->spa_direction, input->port_id,
|
||||||
&iinfo)) < 0) {
|
&iinfo)) < 0) {
|
||||||
asprintf(&error, "error get input port info: %d", res);
|
asprintf(&error, "error get input port info: %d", res);
|
||||||
goto error;
|
goto error;
|
||||||
|
|
@ -1170,12 +1170,12 @@ struct pw_link *pw_link_new(struct pw_core *core,
|
||||||
input_node, input->port_id, this->rt.in_port.port_id);
|
input_node, input->port_id, this->rt.in_port.port_id);
|
||||||
|
|
||||||
spa_graph_port_init(&this->rt.out_port,
|
spa_graph_port_init(&this->rt.out_port,
|
||||||
PW_DIRECTION_OUTPUT,
|
SPA_DIRECTION_OUTPUT,
|
||||||
this->rt.out_port.port_id,
|
this->rt.out_port.port_id,
|
||||||
SPA_GRAPH_PORT_FLAG_DISABLED,
|
SPA_GRAPH_PORT_FLAG_DISABLED,
|
||||||
&this->io);
|
&this->io);
|
||||||
spa_graph_port_init(&this->rt.in_port,
|
spa_graph_port_init(&this->rt.in_port,
|
||||||
PW_DIRECTION_INPUT,
|
SPA_DIRECTION_INPUT,
|
||||||
this->rt.in_port.port_id,
|
this->rt.in_port.port_id,
|
||||||
SPA_GRAPH_PORT_FLAG_DISABLED,
|
SPA_GRAPH_PORT_FLAG_DISABLED,
|
||||||
&this->io);
|
&this->io);
|
||||||
|
|
|
||||||
|
|
@ -783,7 +783,10 @@ struct pw_port *pw_node_get_free_port(struct pw_node *node, enum pw_direction di
|
||||||
|
|
||||||
pw_log_debug("node %p: creating port direction %d %u", node, direction, port_id);
|
pw_log_debug("node %p: creating port direction %d %u", node, direction, port_id);
|
||||||
|
|
||||||
if ((res = spa_node_add_port(node->node, direction, port_id)) < 0) {
|
if ((res = spa_node_add_port(node->node,
|
||||||
|
direction == PW_DIRECTION_INPUT ?
|
||||||
|
SPA_DIRECTION_INPUT : SPA_DIRECTION_OUTPUT,
|
||||||
|
port_id)) < 0) {
|
||||||
pw_log_error("node %p: could not add port %d %s", node, port_id, spa_strerror(res));
|
pw_log_error("node %p: could not add port %d %s", node, port_id, spa_strerror(res));
|
||||||
goto no_mem;
|
goto no_mem;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -182,6 +182,7 @@ struct pw_port *pw_port_new(enum pw_direction direction,
|
||||||
goto no_mem;
|
goto no_mem;
|
||||||
|
|
||||||
this->direction = direction;
|
this->direction = direction;
|
||||||
|
this->spa_direction = direction == PW_DIRECTION_INPUT ? SPA_DIRECTION_INPUT : SPA_DIRECTION_OUTPUT;
|
||||||
this->port_id = port_id;
|
this->port_id = port_id;
|
||||||
this->properties = properties;
|
this->properties = properties;
|
||||||
this->state = PW_PORT_STATE_INIT;
|
this->state = PW_PORT_STATE_INIT;
|
||||||
|
|
@ -201,7 +202,7 @@ struct pw_port *pw_port_new(enum pw_direction direction,
|
||||||
spa_hook_list_init(&this->listener_list);
|
spa_hook_list_init(&this->listener_list);
|
||||||
|
|
||||||
spa_graph_port_init(&this->rt.port,
|
spa_graph_port_init(&this->rt.port,
|
||||||
this->direction,
|
this->spa_direction,
|
||||||
this->port_id,
|
this->port_id,
|
||||||
0,
|
0,
|
||||||
&this->io);
|
&this->io);
|
||||||
|
|
@ -214,7 +215,7 @@ struct pw_port *pw_port_new(enum pw_direction direction,
|
||||||
pw_map_init(&this->mix_port_map, 64, 64);
|
pw_map_init(&this->mix_port_map, 64, 64);
|
||||||
|
|
||||||
spa_graph_port_init(&this->rt.mix_port,
|
spa_graph_port_init(&this->rt.mix_port,
|
||||||
pw_direction_reverse(this->direction),
|
SPA_DIRECTION_REVERSE(this->spa_direction),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
&this->io);
|
&this->io);
|
||||||
|
|
@ -422,7 +423,7 @@ int pw_port_add(struct pw_port *port, struct pw_node *node)
|
||||||
port->node = node;
|
port->node = node;
|
||||||
|
|
||||||
spa_node_port_get_info(node->node,
|
spa_node_port_get_info(node->node,
|
||||||
port->direction, port_id,
|
port->spa_direction, port_id,
|
||||||
&port->spa_info);
|
&port->spa_info);
|
||||||
|
|
||||||
if (port->spa_info->props)
|
if (port->spa_info->props)
|
||||||
|
|
@ -459,7 +460,7 @@ int pw_port_add(struct pw_port *port, struct pw_node *node)
|
||||||
|
|
||||||
pw_log_debug("port %p: setting node io", port);
|
pw_log_debug("port %p: setting node io", port);
|
||||||
spa_node_port_set_io(node->node,
|
spa_node_port_set_io(node->node,
|
||||||
port->direction, port_id,
|
port->spa_direction, port_id,
|
||||||
t->io.Buffers,
|
t->io.Buffers,
|
||||||
port->rt.port.io, sizeof(*port->rt.port.io));
|
port->rt.port.io, sizeof(*port->rt.port.io));
|
||||||
|
|
||||||
|
|
@ -575,7 +576,7 @@ do_port_command(struct spa_loop *loop,
|
||||||
{
|
{
|
||||||
struct pw_port *port = user_data;
|
struct pw_port *port = user_data;
|
||||||
struct pw_node *node = port->node;
|
struct pw_node *node = port->node;
|
||||||
return spa_node_port_send_command(node->node, port->direction, port->port_id, data);
|
return spa_node_port_send_command(node->node, port->spa_direction, port->port_id, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int pw_port_send_command(struct pw_port *port, bool block, const struct spa_command *command)
|
int pw_port_send_command(struct pw_port *port, bool block, const struct spa_command *command)
|
||||||
|
|
@ -607,7 +608,7 @@ int pw_port_for_each_param(struct pw_port *port,
|
||||||
spa_pod_builder_init(&b, buf, sizeof(buf));
|
spa_pod_builder_init(&b, buf, sizeof(buf));
|
||||||
idx = index;
|
idx = index;
|
||||||
if ((res = spa_node_port_enum_params(node->node,
|
if ((res = spa_node_port_enum_params(node->node,
|
||||||
port->direction, port->port_id,
|
port->spa_direction, port->port_id,
|
||||||
param_id, &index,
|
param_id, &index,
|
||||||
filter, ¶m, &b)) <= 0)
|
filter, ¶m, &b)) <= 0)
|
||||||
break;
|
break;
|
||||||
|
|
@ -664,7 +665,7 @@ int pw_port_set_param(struct pw_port *port, uint32_t id, uint32_t flags,
|
||||||
struct pw_core *core = node->core;
|
struct pw_core *core = node->core;
|
||||||
struct pw_type *t = &core->type;
|
struct pw_type *t = &core->type;
|
||||||
|
|
||||||
res = spa_node_port_set_param(node->node, port->direction, port->port_id, id, flags, param);
|
res = spa_node_port_set_param(node->node, port->spa_direction, port->port_id, id, flags, param);
|
||||||
pw_log_debug("port %p: set param %s: %d (%s)", port,
|
pw_log_debug("port %p: set param %s: %d (%s)", port,
|
||||||
spa_type_map_get_type(t->map, id), res, spa_strerror(res));
|
spa_type_map_get_type(t->map, id), res, spa_strerror(res));
|
||||||
|
|
||||||
|
|
@ -692,7 +693,7 @@ int pw_port_use_buffers(struct pw_port *port, struct spa_buffer **buffers, uint3
|
||||||
if (n_buffers > 0 && port->state < PW_PORT_STATE_READY)
|
if (n_buffers > 0 && port->state < PW_PORT_STATE_READY)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
res = spa_node_port_use_buffers(node->node, port->direction, port->port_id, buffers, n_buffers);
|
res = spa_node_port_use_buffers(node->node, port->spa_direction, port->port_id, buffers, n_buffers);
|
||||||
pw_log_debug("port %p: use %d buffers: %d (%s)", port, n_buffers, res, spa_strerror(res));
|
pw_log_debug("port %p: use %d buffers: %d (%s)", port, n_buffers, res, spa_strerror(res));
|
||||||
|
|
||||||
port->allocated = false;
|
port->allocated = false;
|
||||||
|
|
@ -722,7 +723,7 @@ int pw_port_alloc_buffers(struct pw_port *port,
|
||||||
if (port->state < PW_PORT_STATE_READY)
|
if (port->state < PW_PORT_STATE_READY)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
res = spa_node_port_alloc_buffers(node->node, port->direction, port->port_id,
|
res = spa_node_port_alloc_buffers(node->node, port->spa_direction, port->port_id,
|
||||||
params, n_params,
|
params, n_params,
|
||||||
buffers, n_buffers);
|
buffers, n_buffers);
|
||||||
pw_log_debug("port %p: alloc %d buffers: %d (%s)", port, *n_buffers, res, spa_strerror(res));
|
pw_log_debug("port %p: alloc %d buffers: %d (%s)", port, *n_buffers, res, spa_strerror(res));
|
||||||
|
|
|
||||||
|
|
@ -383,6 +383,7 @@ struct pw_port {
|
||||||
bool registered;
|
bool registered;
|
||||||
|
|
||||||
enum pw_direction direction; /**< port direction */
|
enum pw_direction direction; /**< port direction */
|
||||||
|
enum spa_direction spa_direction;/**< port direction */
|
||||||
uint32_t port_id; /**< port id */
|
uint32_t port_id; /**< port id */
|
||||||
const struct spa_port_info *spa_info;
|
const struct spa_port_info *spa_info;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -784,7 +784,7 @@ static void add_port_update(struct pw_proxy *proxy, struct pw_port *port, uint32
|
||||||
|
|
||||||
spa_pod_builder_init(&b, buf, sizeof(buf));
|
spa_pod_builder_init(&b, buf, sizeof(buf));
|
||||||
if (spa_node_port_enum_params(port->node->node,
|
if (spa_node_port_enum_params(port->node->node,
|
||||||
port->direction, port->port_id,
|
port->spa_direction, port->port_id,
|
||||||
data->t->param.idList, &idx1,
|
data->t->param.idList, &idx1,
|
||||||
NULL, ¶m, &b) <= 0)
|
NULL, ¶m, &b) <= 0)
|
||||||
break;
|
break;
|
||||||
|
|
@ -795,7 +795,7 @@ static void add_port_update(struct pw_proxy *proxy, struct pw_port *port, uint32
|
||||||
for (idx2 = 0;; n_params++) {
|
for (idx2 = 0;; n_params++) {
|
||||||
spa_pod_builder_init(&b, buf, sizeof(buf));
|
spa_pod_builder_init(&b, buf, sizeof(buf));
|
||||||
if (spa_node_port_enum_params(port->node->node,
|
if (spa_node_port_enum_params(port->node->node,
|
||||||
port->direction, port->port_id,
|
port->spa_direction, port->port_id,
|
||||||
id, &idx2,
|
id, &idx2,
|
||||||
NULL, ¶m, &b) <= 0)
|
NULL, ¶m, &b) <= 0)
|
||||||
break;
|
break;
|
||||||
|
|
@ -806,13 +806,13 @@ static void add_port_update(struct pw_proxy *proxy, struct pw_port *port, uint32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (change_mask & PW_CLIENT_NODE_PORT_UPDATE_INFO) {
|
if (change_mask & PW_CLIENT_NODE_PORT_UPDATE_INFO) {
|
||||||
spa_node_port_get_info(port->node->node, port->direction, port->port_id, &port_info);
|
spa_node_port_get_info(port->node->node, port->spa_direction, port->port_id, &port_info);
|
||||||
pi = * port_info;
|
pi = * port_info;
|
||||||
pi.flags &= ~SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS;
|
pi.flags &= ~SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS;
|
||||||
}
|
}
|
||||||
|
|
||||||
pw_client_node_proxy_port_update(data->node_proxy,
|
pw_client_node_proxy_port_update(data->node_proxy,
|
||||||
port->direction,
|
port->spa_direction,
|
||||||
port->port_id,
|
port->port_id,
|
||||||
change_mask,
|
change_mask,
|
||||||
n_params,
|
n_params,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue