debug: allow custom type root

This commit is contained in:
Wim Taymans 2018-08-30 12:01:52 +02:00
parent 05d3502c84
commit 7cdb980b1a
32 changed files with 102 additions and 83 deletions

View file

@ -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,

View file

@ -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 &&

View file

@ -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,

View file

@ -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);

View file

@ -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) =