mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
buffer: don't use ringbuffer in chunk
We can't use a ringbuffer on the chunk because it implies the consumer would write to it to update the read position, which we can't do because the chunk is read-only and might even be shared. Go back to offset/size pairs, which can sortof do the same thing if we want later when we keep a non-shared read pointer in the consumer. Keep alsa timestamp around and filled state for future. mmap the input port meta/data/chunk as read-only. Only do clock update requests when asked.
This commit is contained in:
parent
2ad722b579
commit
4288a634f4
25 changed files with 165 additions and 126 deletions
|
|
@ -930,7 +930,8 @@ static int mmap_read(struct impl *this)
|
|||
}
|
||||
|
||||
d = b->outbuf->datas;
|
||||
spa_ringbuffer_set_avail(&d[0].chunk->area, buf.bytesused);
|
||||
d[0].chunk->offset = 0;
|
||||
d[0].chunk->size = buf.bytesused;
|
||||
d[0].chunk->stride = port->fmt.fmt.pix.bytesperline;
|
||||
|
||||
b->outstanding = true;
|
||||
|
|
@ -1090,7 +1091,8 @@ mmap_init(struct impl *this,
|
|||
d = buffers[i]->datas;
|
||||
d[0].mapoffset = 0;
|
||||
d[0].maxsize = b->v4l2_buffer.length;
|
||||
spa_ringbuffer_set_avail(&d[0].chunk->area, 0);
|
||||
d[0].chunk->offset = 0;
|
||||
d[0].chunk->size = 0;
|
||||
d[0].chunk->stride = state->fmt.fmt.pix.bytesperline;
|
||||
|
||||
if (state->export_buf) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue