node: Add ParamBegin/End

Use these commands to mark the begin and end of a series of Param
enumerations and configuration, like when doing format negotiation. The
idea is that the device can remain open while we do this.
Use this in adapter when negotiating a format.
This commit is contained in:
Wim Taymans 2020-12-09 17:10:52 +01:00
parent ccfe439786
commit 4e7be858e4
8 changed files with 55 additions and 10 deletions

View file

@ -241,6 +241,16 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
spa_return_val_if_fail(command != NULL, -EINVAL);
switch (SPA_NODE_COMMAND_ID(command)) {
case SPA_NODE_COMMAND_ParamBegin:
if ((res = spa_alsa_open(this)) < 0)
return res;
break;
case SPA_NODE_COMMAND_ParamEnd:
if (this->have_format)
return 0;
if ((res = spa_alsa_close(this)) < 0)
return res;
break;
case SPA_NODE_COMMAND_Start:
if (!this->have_format)
return -EIO;