mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
command: make commands dynamic
Ensure format object type.
This commit is contained in:
parent
4d9f2c5161
commit
c44a7c9735
36 changed files with 549 additions and 604 deletions
|
|
@ -58,6 +58,7 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
uint32_t node;
|
||||
SpaNodeCommands node_commands;
|
||||
} URI;
|
||||
|
||||
struct _SpaAudioMixer {
|
||||
|
|
@ -107,8 +108,8 @@ update_state (SpaAudioMixer *this, SpaNodeState state)
|
|||
}
|
||||
|
||||
static SpaResult
|
||||
spa_audiomixer_node_send_command (SpaNode *node,
|
||||
SpaNodeCommand *command)
|
||||
spa_audiomixer_node_send_command (SpaNode *node,
|
||||
SpaCommand *command)
|
||||
{
|
||||
SpaAudioMixer *this;
|
||||
|
||||
|
|
@ -117,24 +118,15 @@ spa_audiomixer_node_send_command (SpaNode *node,
|
|||
|
||||
this = SPA_CONTAINER_OF (node, SpaAudioMixer, node);
|
||||
|
||||
switch (SPA_NODE_COMMAND_TYPE (command)) {
|
||||
case SPA_NODE_COMMAND_INVALID:
|
||||
return SPA_RESULT_INVALID_COMMAND;
|
||||
|
||||
case SPA_NODE_COMMAND_START:
|
||||
update_state (this, SPA_NODE_STATE_STREAMING);
|
||||
break;
|
||||
|
||||
case SPA_NODE_COMMAND_PAUSE:
|
||||
update_state (this, SPA_NODE_STATE_PAUSED);
|
||||
break;
|
||||
|
||||
case SPA_NODE_COMMAND_FLUSH:
|
||||
case SPA_NODE_COMMAND_DRAIN:
|
||||
case SPA_NODE_COMMAND_MARKER:
|
||||
case SPA_NODE_COMMAND_CLOCK_UPDATE:
|
||||
return SPA_RESULT_NOT_IMPLEMENTED;
|
||||
if (SPA_COMMAND_TYPE (command) == this->uri.node_commands.Start) {
|
||||
update_state (this, SPA_NODE_STATE_STREAMING);
|
||||
}
|
||||
else if (SPA_COMMAND_TYPE (command) == this->uri.node_commands.Pause) {
|
||||
update_state (this, SPA_NODE_STATE_PAUSED);
|
||||
}
|
||||
else
|
||||
return SPA_RESULT_NOT_IMPLEMENTED;
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
}
|
||||
|
||||
|
|
@ -463,7 +455,7 @@ static SpaResult
|
|||
spa_audiomixer_node_port_send_command (SpaNode *node,
|
||||
SpaDirection direction,
|
||||
uint32_t port_id,
|
||||
SpaNodeCommand *command)
|
||||
SpaCommand *command)
|
||||
{
|
||||
return SPA_RESULT_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
|
@ -703,6 +695,7 @@ spa_audiomixer_init (const SpaHandleFactory *factory,
|
|||
return SPA_RESULT_ERROR;
|
||||
}
|
||||
this->uri.node = spa_id_map_get_id (this->map, SPA_NODE_URI);
|
||||
spa_node_commands_map (this->map, &this->uri.node_commands);
|
||||
|
||||
this->node = audiomixer_node;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue