Small cleanups

Improve debug
Fix core info event, pass the copied info around in remote.
This commit is contained in:
Wim Taymans 2017-09-15 14:47:54 +02:00
parent 26e9daf6b7
commit 2ca25e5bf4
5 changed files with 15 additions and 17 deletions

View file

@ -188,7 +188,7 @@ bool pw_daemon_config_run_commands(struct pw_daemon_config *config, struct pw_co
spa_list_for_each(command, &config->commands, link) {
if (!pw_command_run(command, core, &err)) {
pw_log_warn("could not run command %s: %s", command->name, err);
pw_log_warn("could not run command %s: %s", command->args[0], err);
free(err);
ret = false;
}

View file

@ -321,7 +321,7 @@ pw_protocol_native_connection_get_next(struct pw_protocol_native_connection *con
if (debug_messages) {
printf("<<<<<<<<< in:\n");
printf("<<<<<<<<< in: %d %d %zd\n", *dest_id, *opcode, len);
spa_debug_pod((struct spa_pod *)data);
}
@ -427,7 +427,7 @@ pw_protocol_native_connection_end(struct pw_protocol_native_connection *conn,
buf->buffer_size += 8 + size;
if (debug_messages) {
printf(">>>>>>>>> out:\n");
printf(">>>>>>>>> out: %d %d %d\n", impl->dest_id, impl->opcode, size);
spa_debug_pod((struct spa_pod *)p);
}
spa_hook_list_call(&conn->listener_list, struct pw_protocol_native_connection_events, need_flush);

View file

@ -52,7 +52,7 @@ static struct pw_node *create_node(void *_data,
lib = pw_properties_get(properties, "spa.library.name");
factory_name = pw_properties_get(properties, "spa.factory.name");
if(lib == NULL || factory_name == NULL)
if (lib == NULL || factory_name == NULL)
goto no_properties;
node = pw_spa_node_load(data->core,
@ -68,9 +68,12 @@ static struct pw_node *create_node(void *_data,
return node;
no_properties:
pw_log_error("missing properties");
pw_log_error("needed properties: spa.library.name=<library-name> spa.factory.name=<factory-name>");
if (resource) {
pw_resource_error(resource, SPA_RESULT_INVALID_ARGUMENTS, "missing properties");
pw_resource_error(resource, SPA_RESULT_INVALID_ARGUMENTS,
"needed properties: "
"spa.library.name=<library-name> "
"spa.factory.name=<factory-name>");
}
return NULL;
no_mem:

View file

@ -497,8 +497,8 @@ static void node_need_input(void *data)
static void node_have_output(void *data)
{
struct pw_node *node = data;
spa_hook_list_call(&node->listener_list, struct pw_node_events, have_output);
spa_graph_have_output(node->rt.graph, &node->rt.node);
spa_hook_list_call(&node->listener_list, struct pw_node_events, have_output);
}
static void node_reuse_buffer(void *data, uint32_t port_id, uint32_t buffer_id)
@ -534,13 +534,8 @@ void pw_node_set_implementation(struct pw_node *node,
spa_node_set_callbacks(node->node, &node_callbacks, node);
spa_graph_node_set_implementation(&node->rt.node, spa_node);
if (spa_node->info) {
uint32_t i;
for (i = 0; i < spa_node->info->n_items; i++)
pw_properties_set(node->properties,
spa_node->info->items[i].key,
spa_node->info->items[i].value);
}
if (spa_node->info)
pw_node_update_properties(node, spa_node->info);
}
struct spa_node *pw_node_get_implementation(struct pw_node *node)

View file

@ -138,16 +138,16 @@ static void core_event_info(void *data, struct pw_core_info *info)
{
struct pw_remote *this = data;
pw_log_debug("got core info");
pw_log_debug("remote %p: got core info", this);
this->info = pw_core_info_update(this->info, info);
spa_hook_list_call(&this->listener_list, struct pw_remote_events, info_changed, info);
spa_hook_list_call(&this->listener_list, struct pw_remote_events, info_changed, this->info);
}
static void core_event_done(void *data, uint32_t seq)
{
struct pw_remote *this = data;
pw_log_debug("core event done %d", seq);
pw_log_debug("remote %p: core event done %d", this, seq);
if (seq == 0)
pw_remote_update_state(this, PW_REMOTE_STATE_CONNECTED, NULL);