node: dispatch RequestProcess event and command

The event is send to the driver node.
The command is sent to node directly.
This commit is contained in:
Wim Taymans 2021-10-19 16:01:08 +02:00
parent 3471391e0e
commit b5080a0395
2 changed files with 11 additions and 2 deletions

View file

@ -511,7 +511,9 @@ static int client_node_command(void *object, const struct spa_command *command)
pw_proxy_error(proxy, res, "suspend failed");
}
break;
case SPA_NODE_COMMAND_RequestProcess:
res = pw_impl_node_send_command(data->node, command);
break;
default:
pw_log_warn("unhandled node command %d", SPA_NODE_COMMAND_ID(command));
res = -ENOTSUP;

View file

@ -1437,8 +1437,15 @@ static void node_event(void *data, const struct spa_event *event)
node_update_state(node, PW_NODE_STATE_ERROR,
-EFAULT, strdup("Received error event"));
break;
case SPA_NODE_EVENT_RequestProcess:
pw_log_debug("request process");
if (!node->driving) {
pw_impl_node_send_command(node->driver_node,
&SPA_NODE_COMMAND_INIT(SPA_NODE_COMMAND_RequestProcess));
}
break;
default:
pw_log_debug("unhandled event");
pw_log_debug("unhandled event %d", SPA_NODE_EVENT_ID(event));
break;
}
pw_impl_node_emit_event(node, event);