meta: add metadata features

Add a new features property to the metadata param. This should be
of type CHOICE_FEATURES_Int and should contain the extra features
supported by this metadata.

Make a special features metadata type that is a combination of the
metadata type in the upper 16 bits and the features for that type in the
lower 16 bits. Make a function to search if a type has certain feature
bits.

On the server, when negotiating buffers and metadata, check the result
of the features after filtering and if they are not 0, place them as
0 sized extra feature metadata on the buffer.

Add some metadata features for the sync_timeline, one that specifies
that the RELEASE flag is supported. With this in place, a producer can
see if a consumer supports the UNSCHEDULED_RELEASE flag.

See #4885
This commit is contained in:
Wim Taymans 2025-09-19 14:05:04 +02:00
parent a859c7a651
commit 00d983a40d
4 changed files with 31 additions and 4 deletions

View file

@ -118,6 +118,17 @@ SPA_API_BUFFER void *spa_buffer_find_meta_data(const struct spa_buffer *b, uint3
return NULL;
}
SPA_API_BUFFER bool spa_buffer_has_meta_features(const struct spa_buffer *b, uint32_t type, uint32_t features)
{
uint32_t i;
for (i = 0; i < b->n_metas; i++) {
uint32_t t = b->metas[i].type;
if ((t >> 16) == type && (t & features) == features)
return true;
}
return false;
}
/**
* \}
*/