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:
Wim Taymans 2017-11-21 12:30:15 +01:00
parent 2ad722b579
commit 4288a634f4
25 changed files with 165 additions and 126 deletions

View file

@ -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) {