mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
buffer: document memory type when allocating
When allocating buffers the type will contain a bitmask of allowed types.
This commit is contained in:
parent
c8633767e7
commit
fef0e17b76
2 changed files with 4 additions and 1 deletions
|
|
@ -63,7 +63,9 @@ struct spa_chunk {
|
|||
|
||||
/** Data for a buffer this stays constant for a buffer */
|
||||
struct spa_data {
|
||||
uint32_t type; /**< memory type, one of enum spa_data_type */
|
||||
uint32_t type; /**< memory type, one of enum spa_data_type, when
|
||||
* allocating memory, the type contains a bitmask
|
||||
* of allowed types */
|
||||
#define SPA_DATA_FLAG_NONE 0
|
||||
#define SPA_DATA_FLAG_READABLE (1u<<0) /**< data is readable */
|
||||
#define SPA_DATA_FLAG_WRITABLE (1u<<1) /**< data is writable */
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ static int alloc_buffers(struct pw_mempool *pool,
|
|||
d->maxsize = data_sizes[i];
|
||||
SPA_FLAG_SET(d->flags, SPA_DATA_FLAG_READWRITE);
|
||||
} else {
|
||||
/* type is a bitmask of allowed types */
|
||||
d->type = SPA_ID_INVALID;
|
||||
d->maxsize = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue