meta: add busy metadata

Metadata on buffers to mark when a buffer is in use. Writers
should only use buffers with a count of 0.
This commit is contained in:
Wim Taymans 2020-03-02 16:55:16 +01:00
parent 07b52299db
commit b39a2258c4
2 changed files with 8 additions and 0 deletions

View file

@ -45,6 +45,7 @@ enum spa_meta_type {
SPA_META_Cursor, /**< struct spa_meta_cursor */
SPA_META_Control, /**< metadata contains a spa_meta_control
* associated with the data */
SPA_META_Busy, /**< don't write to buffer when count > 0 */
SPA_META_LAST, /**< not part of ABI/API */
};
@ -144,6 +145,12 @@ struct spa_meta_control {
struct spa_pod_sequence sequence;
};
/** a busy counter for the buffer */
struct spa_meta_busy {
uint32_t flags;
uint32_t count; /**< number of users busy with the buffer */
};
#ifdef __cplusplus
} /* extern "C" */
#endif

View file

@ -73,6 +73,7 @@ static const struct spa_type_info spa_type_meta_type[] = {
{ SPA_META_Bitmap, SPA_TYPE_Pointer, SPA_TYPE_INFO_META_BASE "Bitmap", NULL },
{ SPA_META_Cursor, SPA_TYPE_Pointer, SPA_TYPE_INFO_META_BASE "Cursor", NULL },
{ SPA_META_Control, SPA_TYPE_Pointer, SPA_TYPE_INFO_META_BASE "Control", NULL },
{ SPA_META_Busy, SPA_TYPE_Pointer, SPA_TYPE_INFO_META_BASE "Busy", NULL },
{ 0, 0, NULL, NULL },
};