mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
debug: allow custom type root
This commit is contained in:
parent
05d3502c84
commit
7cdb980b1a
32 changed files with 102 additions and 83 deletions
|
|
@ -944,7 +944,7 @@ impl_node_port_send_command(struct spa_node *node,
|
|||
return 0;
|
||||
|
||||
spa_log_trace(this->log, "send command %s",
|
||||
spa_debug_type_find_name(spa_debug_types, SPA_NODE_COMMAND_ID(command)));
|
||||
spa_debug_type_find_name(spa_type_node_command_id, SPA_NODE_COMMAND_ID(command)));
|
||||
|
||||
pw_client_node_resource_port_command(this->resource,
|
||||
direction, port_id,
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ static int debug_params(struct impl *impl, struct spa_node *node,
|
|||
struct spa_pod *param;
|
||||
int res;
|
||||
|
||||
spa_log_error(this->log, "params %s:", spa_debug_type_find_name(spa_debug_types, id));
|
||||
spa_log_error(this->log, "params %s:", spa_debug_type_find_name(spa_type_param, id));
|
||||
|
||||
state = 0;
|
||||
while (true) {
|
||||
|
|
@ -347,12 +347,12 @@ static int debug_params(struct impl *impl, struct spa_node *node,
|
|||
spa_log_error(this->log, " error: %s", spa_strerror(res));
|
||||
break;
|
||||
}
|
||||
spa_debug_pod(2, spa_debug_types, param);
|
||||
spa_debug_pod(2, NULL, param);
|
||||
}
|
||||
|
||||
spa_log_error(this->log, "failed filter:");
|
||||
if (filter)
|
||||
spa_debug_pod(2, spa_debug_types, filter);
|
||||
spa_debug_pod(2, NULL, filter);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -896,8 +896,8 @@ static void client_node_initialized(void *data)
|
|||
return;
|
||||
|
||||
pw_log_debug("client-stream %p: %s/%s", &impl->this,
|
||||
spa_debug_type_find_name(spa_debug_types, media_type),
|
||||
spa_debug_type_find_name(spa_debug_types, media_subtype));
|
||||
spa_debug_type_find_name(spa_type_media_type, media_type),
|
||||
spa_debug_type_find_name(spa_type_media_subtype, media_subtype));
|
||||
|
||||
|
||||
if (!exclusive &&
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ process_messages(struct client_data *data)
|
|||
|
||||
if (debug_messages) {
|
||||
fprintf(stderr, "<<<<<<<<< in: %d %d %d\n", id, opcode, size);
|
||||
spa_debug_pod(0, spa_debug_types, (struct spa_pod *)message);
|
||||
spa_debug_pod(0, NULL, (struct spa_pod *)message);
|
||||
}
|
||||
if (demarshal[opcode].func(resource, message, size) < 0)
|
||||
goto invalid_message;
|
||||
|
|
@ -491,7 +491,7 @@ on_remote_data(void *data, int fd, enum spa_io mask)
|
|||
|
||||
if (debug_messages) {
|
||||
fprintf(stderr, "<<<<<<<<< in: %d %d %d\n", id, opcode, size);
|
||||
spa_debug_pod(0, spa_debug_types, (struct spa_pod *)message);
|
||||
spa_debug_pod(0, NULL, (struct spa_pod *)message);
|
||||
}
|
||||
if (demarshal[opcode].func(proxy, message, size) < 0) {
|
||||
pw_log_error ("protocol-native %p: invalid message received %u for %u", this,
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ pw_protocol_native_connection_end(struct pw_protocol_native_connection *conn,
|
|||
|
||||
if (debug_messages) {
|
||||
fprintf(stderr, ">>>>>>>>> out: %d %d %d\n", impl->dest_id, impl->opcode, size);
|
||||
spa_debug_pod(0, spa_debug_types, (struct spa_pod *)p);
|
||||
spa_debug_pod(0, NULL, (struct spa_pod *)p);
|
||||
}
|
||||
spa_hook_list_call(&conn->listener_list,
|
||||
struct pw_protocol_native_connection_events, need_flush, 0);
|
||||
|
|
|
|||
|
|
@ -172,12 +172,7 @@ setup_props(struct pw_core *core, struct spa_node *spa_node, struct pw_propertie
|
|||
struct spa_pod_prop *prop;
|
||||
uint32_t type = 0;
|
||||
|
||||
#if 0
|
||||
if (!spa_type_is_a(key, SPA_TYPE_PROPS_BASE))
|
||||
continue;
|
||||
|
||||
#endif
|
||||
type = spa_debug_type_find_type(spa_debug_types, key);
|
||||
type = spa_debug_type_find_type(NULL, key);
|
||||
if (type == SPA_TYPE_None)
|
||||
continue;
|
||||
|
||||
|
|
@ -193,7 +188,7 @@ setup_props(struct pw_core *core, struct spa_node *spa_node, struct pw_propertie
|
|||
break;
|
||||
case SPA_TYPE_Enum:
|
||||
SPA_POD_VALUE(struct spa_pod_enum, &prop->body.value) =
|
||||
spa_debug_type_find_type(spa_debug_types, value);
|
||||
spa_debug_type_find_type(NULL, value);
|
||||
break;
|
||||
case SPA_TYPE_Int:
|
||||
SPA_POD_VALUE(struct spa_pod_int, &prop->body.value) =
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ pw_control_new(struct pw_core *core,
|
|||
this->size = size;
|
||||
|
||||
pw_log_debug("control %p: new %s %d", this,
|
||||
spa_debug_type_find_name(spa_types, this->id), direction);
|
||||
spa_debug_type_find_name(spa_type_io, this->id), direction);
|
||||
|
||||
this->core = core;
|
||||
this->port = port;
|
||||
|
|
@ -164,7 +164,7 @@ int pw_control_link(struct pw_control *control, struct pw_control *other)
|
|||
impl = SPA_CONTAINER_OF(control, struct impl, this);
|
||||
|
||||
pw_log_debug("control %p: link to %p %s", control, other,
|
||||
spa_debug_type_find_name(spa_debug_types, control->id));
|
||||
spa_debug_type_find_name(spa_type_io, control->id));
|
||||
|
||||
size = SPA_MAX(control->size, other->size);
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ static void registry_bind(void *object, uint32_t id,
|
|||
goto wrong_interface;
|
||||
|
||||
pw_log_debug("global %p: bind global id %d, iface %s to %d", global, id,
|
||||
spa_debug_type_find_name(spa_debug_types, type), new_id);
|
||||
spa_debug_type_find_name(NULL, type), new_id);
|
||||
|
||||
if (pw_global_bind(global, client, permissions, version, new_id) < 0)
|
||||
goto exit;
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ int pw_factory_register(struct pw_factory *factory,
|
|||
|
||||
pw_properties_set(properties, "factory.name", factory->info.name);
|
||||
pw_properties_setf(properties, "factory.type.name", "%s",
|
||||
spa_debug_type_find_name(spa_debug_types, factory->info.type));
|
||||
spa_debug_type_find_name(NULL, factory->info.type));
|
||||
pw_properties_setf(properties, "factory.type.version", "%d", factory->info.version);
|
||||
|
||||
spa_list_append(&core->factory_list, &factory->link);
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ pw_global_new(struct pw_core *core,
|
|||
spa_hook_list_init(&this->listener_list);
|
||||
|
||||
pw_log_debug("global %p: new %s %d", this,
|
||||
spa_debug_type_find_name(spa_debug_types, this->type),
|
||||
spa_debug_type_find_name(NULL, this->type),
|
||||
this->id);
|
||||
|
||||
return this;
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ param_filter(struct pw_link *this,
|
|||
}
|
||||
|
||||
if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG) && iparam != NULL)
|
||||
spa_debug_pod(2, spa_debug_types, iparam);
|
||||
spa_debug_pod(2, NULL, iparam);
|
||||
|
||||
for (oidx = 0;;) {
|
||||
pw_log_debug("oparam %d", oidx);
|
||||
|
|
@ -511,7 +511,7 @@ param_filter(struct pw_link *this,
|
|||
}
|
||||
|
||||
if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG))
|
||||
spa_debug_pod(2, spa_debug_types, oparam);
|
||||
spa_debug_pod(2, NULL, oparam);
|
||||
|
||||
num++;
|
||||
}
|
||||
|
|
@ -651,7 +651,7 @@ static int do_allocation(struct pw_link *this, uint32_t in_state, uint32_t out_s
|
|||
spa_pod_fixate(params[i]);
|
||||
pw_log_debug("fixated param %d:", i);
|
||||
if (pw_log_level_enabled(SPA_LOG_LEVEL_DEBUG))
|
||||
spa_debug_pod(2, spa_debug_types, params[i]);
|
||||
spa_debug_pod(2, NULL, params[i]);
|
||||
offset += SPA_ROUND_UP_N(SPA_POD_SIZE(params[i]), 8);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -792,7 +792,7 @@ int pw_port_set_param(struct pw_port *port, uint32_t mix_id, uint32_t id, uint32
|
|||
|
||||
pw_log_debug("port %p: %d set param on mix %d:%d.%d %s: %d (%s)", port, port->state,
|
||||
port->direction, port->port_id, p->port_id,
|
||||
spa_debug_type_find_name(spa_debug_types, id), res, spa_strerror(res));
|
||||
spa_debug_type_find_name(spa_type_param, id), res, spa_strerror(res));
|
||||
|
||||
if (port->state == PW_PORT_STATE_CONFIGURE) {
|
||||
spa_node_port_set_param(port->mix,
|
||||
|
|
@ -804,7 +804,7 @@ int pw_port_set_param(struct pw_port *port, uint32_t mix_id, uint32_t id, uint32
|
|||
res = spa_node_port_set_param(node->node, port->direction, port->port_id, id, flags, param);
|
||||
pw_log_debug("port %p: %d set param on node %d:%d %s: %d (%s)", port, port->state,
|
||||
port->direction, port->port_id,
|
||||
spa_debug_type_find_name(spa_debug_types, id), res, spa_strerror(res));
|
||||
spa_debug_type_find_name(spa_type_param, id), res, spa_strerror(res));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ pw_protocol_add_marshal(struct pw_protocol *protocol,
|
|||
spa_list_append(&protocol->marshal_list, &impl->link);
|
||||
|
||||
pw_log_debug("Add marshal %d/%s:%d to protocol %s", marshal->type,
|
||||
spa_debug_type_find_name(spa_debug_types, marshal->type), marshal->version,
|
||||
spa_debug_type_find_name(NULL, marshal->type), marshal->version,
|
||||
protocol->name);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -853,7 +853,7 @@ client_node_set_io(void *object,
|
|||
}
|
||||
|
||||
pw_log_debug("node %p: set io %s %p", proxy,
|
||||
spa_debug_type_find_name(spa_debug_types, id), ptr);
|
||||
spa_debug_type_find_name(spa_type_io, id), ptr);
|
||||
|
||||
if (id == PW_IO_ClientNodePosition) {
|
||||
if (ptr == NULL && data->position) {
|
||||
|
|
@ -1200,7 +1200,7 @@ client_node_port_set_io(void *object,
|
|||
}
|
||||
|
||||
pw_log_debug("port %p: set io %s %p", mix->port,
|
||||
spa_debug_type_find_name(spa_debug_types, id), ptr);
|
||||
spa_debug_type_find_name(spa_type_io, id), ptr);
|
||||
|
||||
if (id == SPA_IO_Buffers) {
|
||||
if (ptr == NULL && mix->mix.io) {
|
||||
|
|
|
|||
|
|
@ -28,8 +28,10 @@
|
|||
#include <spa/node/io.h>
|
||||
#include <spa/utils/ringbuffer.h>
|
||||
#include <spa/pod/filter.h>
|
||||
#include <spa/control/control.h>
|
||||
#include <spa/debug/format.h>
|
||||
#include <spa/debug/types.h>
|
||||
#include <spa/debug/pod.h>
|
||||
|
||||
#include "pipewire/pipewire.h"
|
||||
#include "pipewire/stream.h"
|
||||
|
|
@ -327,7 +329,7 @@ static int impl_port_set_io(struct spa_node *node, enum spa_direction direction,
|
|||
struct stream *impl = SPA_CONTAINER_OF(node, struct stream, impl_node);
|
||||
|
||||
pw_log_debug("stream %p: set io %s %p %zd", impl,
|
||||
spa_debug_type_find_name(spa_debug_types, id), data, size);
|
||||
spa_debug_type_find_name(spa_type_io, id), data, size);
|
||||
|
||||
switch (id) {
|
||||
case SPA_IO_Buffers:
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ static int print_global(void *obj, void *data)
|
|||
return 0;
|
||||
|
||||
fprintf(stdout, "\tid %d, parent %d, type %s/%d\n", global->id, global->parent_id,
|
||||
spa_debug_type_find_name(spa_debug_types, global->type),
|
||||
spa_debug_type_find_name(NULL, global->type),
|
||||
global->version);
|
||||
if (global->properties)
|
||||
print_properties(&global->properties->dict, ' ', false);
|
||||
|
|
@ -501,7 +501,7 @@ static void info_global(struct proxy_data *pd)
|
|||
fprintf(stdout, "\tpermissions: %c%c%c\n", global->permissions & PW_PERM_R ? 'r' : '-',
|
||||
global->permissions & PW_PERM_W ? 'w' : '-',
|
||||
global->permissions & PW_PERM_X ? 'x' : '-');
|
||||
fprintf(stdout, "\ttype: %s/%d\n", spa_debug_type_find_name(spa_debug_types, global->type), pd->global->version);
|
||||
fprintf(stdout, "\ttype: %s/%d\n", spa_debug_type_find_name(NULL, global->type), pd->global->version);
|
||||
}
|
||||
|
||||
static void info_core(struct proxy_data *pd)
|
||||
|
|
@ -567,7 +567,7 @@ static void info_factory(struct proxy_data *pd)
|
|||
|
||||
info_global(pd);
|
||||
fprintf(stdout, "\tname: \"%s\"\n", info->name);
|
||||
fprintf(stdout, "\tobject-type: %s/%d\n", spa_debug_type_find_name(spa_debug_types, info->type), info->version);
|
||||
fprintf(stdout, "\tobject-type: %s/%d\n", spa_debug_type_find_name(NULL, info->type), info->version);
|
||||
print_properties(info->props, MARK_CHANGE(0), true);
|
||||
info->change_mask = 0;
|
||||
}
|
||||
|
|
@ -668,7 +668,7 @@ static void node_event_param(void *object, uint32_t id, uint32_t index, uint32_t
|
|||
if (spa_pod_is_object_type(param, SPA_TYPE_OBJECT_Format))
|
||||
spa_debug_format(2, NULL, param);
|
||||
else
|
||||
spa_debug_pod(2, spa_debug_types, param);
|
||||
spa_debug_pod(2, NULL, param);
|
||||
}
|
||||
|
||||
static const struct pw_node_proxy_events node_events = {
|
||||
|
|
@ -705,7 +705,7 @@ static void port_event_param(void *object, uint32_t id, uint32_t index, uint32_t
|
|||
if (spa_pod_is_object_type(param, SPA_TYPE_OBJECT_Format))
|
||||
spa_debug_format(2, NULL, param);
|
||||
else
|
||||
spa_debug_pod(2, spa_debug_types, param);
|
||||
spa_debug_pod(2, NULL, param);
|
||||
}
|
||||
|
||||
static const struct pw_port_proxy_events port_events = {
|
||||
|
|
@ -855,7 +855,7 @@ static bool bind_global(struct remote_data *rd, struct global *global, char **er
|
|||
info_func = info_link;
|
||||
break;
|
||||
default:
|
||||
asprintf(error, "unsupported type %s", spa_debug_type_find_name(spa_debug_types, global->type));
|
||||
asprintf(error, "unsupported type %s", spa_debug_type_find_name(NULL, global->type));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ static void print_node(struct proxy_data *data)
|
|||
if (spa_pod_is_object_type(data->params[i], SPA_TYPE_OBJECT_Format))
|
||||
spa_debug_format(10, NULL, data->params[i]);
|
||||
else
|
||||
spa_debug_pod(10, spa_debug_types, data->params[i]);
|
||||
spa_debug_pod(10, NULL, data->params[i]);
|
||||
}
|
||||
printf("%c\tinput ports: %u/%u\n", MARK_CHANGE(1),
|
||||
info->n_input_ports, info->max_input_ports);
|
||||
|
|
@ -295,7 +295,7 @@ static void print_port(struct proxy_data *data)
|
|||
if (spa_pod_is_object_type(data->params[i], SPA_TYPE_OBJECT_Format))
|
||||
spa_debug_format(12, NULL, data->params[i]);
|
||||
else
|
||||
spa_debug_pod(12, spa_debug_types, data->params[i]);
|
||||
spa_debug_pod(12, NULL, data->params[i]);
|
||||
}
|
||||
print_properties(info->props, MARK_CHANGE(1));
|
||||
}
|
||||
|
|
@ -354,7 +354,7 @@ static void factory_event_info(void *object, struct pw_factory_info *info)
|
|||
data->permissions & PW_PERM_X ? 'x' : '-');
|
||||
printf("\ttype: %s (version %d)\n", PW_TYPE_INTERFACE__Factory, data->version);
|
||||
printf("\tname: \"%s\"\n", info->name);
|
||||
printf("\tobject-type: %s/%d\n", spa_debug_type_find_name(spa_debug_types, info->type), info->version);
|
||||
printf("\tobject-type: %s/%d\n", spa_debug_type_find_name(NULL, info->type), info->version);
|
||||
if (print_all) {
|
||||
print_properties(info->props, MARK_CHANGE(0));
|
||||
}
|
||||
|
|
@ -512,7 +512,7 @@ static void registry_event_global(void *data, uint32_t id, uint32_t parent_id,
|
|||
printf("\tpermissions: %c%c%c\n", permissions & PW_PERM_R ? 'r' : '-',
|
||||
permissions & PW_PERM_W ? 'w' : '-',
|
||||
permissions & PW_PERM_X ? 'x' : '-');
|
||||
printf("\ttype: %s (version %d)\n", spa_debug_type_find_name(spa_debug_types, type), version);
|
||||
printf("\ttype: %s (version %d)\n", spa_debug_type_find_name(NULL, type), version);
|
||||
print_properties(props, ' ');
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue