mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
Add fd to the data
Add the fd to the SpaData so that we can noth use the fd and the mmapped memory when we want instead of needing to mmap again in the plugin. various cleanups
This commit is contained in:
parent
b8f693ceea
commit
06765a2dea
15 changed files with 158 additions and 179 deletions
|
|
@ -434,7 +434,7 @@ do_allocation (PinosLink *this, SpaNodeState in_state, SpaNodeState out_state)
|
|||
if (priv->buffers == NULL) {
|
||||
SpaAllocParamBuffers *in_alloc, *out_alloc;
|
||||
guint max_buffers = MAX_BUFFERS;
|
||||
size_t minsize = 4096, stride = 0;
|
||||
size_t minsize = 0, stride = 0;
|
||||
|
||||
max_buffers = MAX_BUFFERS;
|
||||
in_alloc = find_param (iinfo, SPA_ALLOC_PARAM_TYPE_BUFFERS);
|
||||
|
|
@ -529,7 +529,9 @@ do_allocation (PinosLink *this, SpaNodeState in_state, SpaNodeState out_state)
|
|||
d = &b->datas[0];
|
||||
if (minsize > 0) {
|
||||
d->type = SPA_DATA_TYPE_MEMFD;
|
||||
d->data = SPA_INT_TO_PTR (priv->buffer_mem.fd);
|
||||
d->flags = 0;
|
||||
d->data = priv->buffer_mem.ptr;
|
||||
d->fd = priv->buffer_mem.fd;
|
||||
d->maxsize = priv->buffer_mem.size;
|
||||
d->offset = arr_size + hdr_size + (buf_size * i);
|
||||
d->size = minsize;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue