pod: improve the vararg pod builder and parser

Automatically parse and build key/value when in objects without having
to prefix the key with ":"
Automatically build control/value when in sequence without the "."
prefix.
Remove the builder with key/pod, taking a reference to the stack built
temporary pods is not allowed in c++. We can use the varargs version
with the same convenient syntax.
Remove the parser "*" option, it is unused.
Improve spa_pod_builder_add_* and spa_pod_parser_get_* and make them
look similar.
This commit is contained in:
Wim Taymans 2019-01-16 11:05:12 +01:00
parent 79d68ace68
commit 80cfda89c1
59 changed files with 1833 additions and 2005 deletions

View file

@ -360,11 +360,10 @@ static int negotiate_formats(struct data *data)
uint8_t buffer[256];
spa_pod_builder_init(&b, buffer, sizeof(buffer));
format = spa_pod_builder_object(&b,
format = spa_pod_builder_add_object(&b,
SPA_TYPE_OBJECT_Format, 0,
SPA_FORMAT_mediaType, &SPA_POD_Id(SPA_MEDIA_TYPE_binary),
SPA_FORMAT_mediaSubtype, &SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw),
0);
SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_binary),
SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw));
if ((res = spa_node_port_set_param(data->sink,
SPA_DIRECTION_INPUT, 0,