mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-09-20 00:11:31 +00:00
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:
parent
07b52299db
commit
b39a2258c4
|
@ -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
|
||||
|
|
|
@ -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 },
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue