mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
Unify props, params and formats
Make enum_params and set_param to configure properties, format and other parameters. This allows us to remove some duplicate code and make the properties and parameters much more extensible. Use the object id to mark the id of the parameter. Remove the spa_format and spa_props. We can now make the client-node easier by merging the various format methods into the params. Make the stream API more powerful now that we can pass params around.
This commit is contained in:
parent
b6ee67905d
commit
f3bca48398
87 changed files with 3773 additions and 3580 deletions
|
|
@ -99,6 +99,7 @@ struct client_data {
|
|||
static bool pod_remap_data(uint32_t type, void *body, uint32_t size, struct pw_map *types)
|
||||
{
|
||||
void *t;
|
||||
|
||||
switch (type) {
|
||||
case SPA_POD_TYPE_ID:
|
||||
if ((t = pw_map_lookup(types, *(int32_t *) body)) == NULL)
|
||||
|
|
@ -131,6 +132,11 @@ static bool pod_remap_data(uint32_t type, void *body, uint32_t size, struct pw_m
|
|||
struct spa_pod_object_body *b = body;
|
||||
struct spa_pod *p;
|
||||
|
||||
if ((t = pw_map_lookup(types, b->id)) != NULL)
|
||||
b->id = PW_MAP_PTR_TO_ID(t);
|
||||
else
|
||||
b->id = SPA_ID_INVALID;
|
||||
|
||||
if ((t = pw_map_lookup(types, b->type)) == NULL)
|
||||
return false;
|
||||
b->type = PW_MAP_PTR_TO_ID(t);
|
||||
|
|
@ -211,7 +217,7 @@ process_messages(struct client_data *data)
|
|||
if (!pod_remap_data(SPA_POD_TYPE_STRUCT, message, size, &client->types))
|
||||
goto invalid_message;
|
||||
|
||||
if (!demarshal[opcode].func (resource, message, size))
|
||||
if (!demarshal[opcode].func(resource, message, size))
|
||||
goto invalid_message;
|
||||
}
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue