Improve upload

Only send a buffer when we have received a NEED_DATA message.
Add a signal to pulla buffer from the sink. Restructure the sink to use
a queue like the source and only push a buffer when we can.
Improve SpaData. Offset and size should be between 0 and maxsize, make
sure we clamp correctly when needed.
node_process_output completes the processing of the output after
receiving HAVE_OUTPUT for async elements. It instructs the node that
it now can produce more output.
This commit is contained in:
Wim Taymans 2016-12-20 16:51:57 +01:00
parent 8ce3f949e2
commit 5b0b9c43d0
18 changed files with 201 additions and 112 deletions

View file

@ -117,7 +117,7 @@ spa_v4l2_clear_buffers (SpaV4l2Source *this)
}
if (b->allocated) {
if (b->outbuf->datas[0].data)
munmap (b->outbuf->datas[0].data, b->outbuf->datas[0].size);
munmap (b->outbuf->datas[0].data, b->outbuf->datas[0].maxsize);
if (b->outbuf->datas[0].fd != -1)
close (b->outbuf->datas[0].fd);
b->outbuf->datas[0].type = SPA_DATA_TYPE_INVALID;
@ -973,7 +973,7 @@ spa_v4l2_use_buffers (SpaV4l2Source *this, SpaBuffer **buffers, uint32_t n_buffe
continue;
}
b->v4l2_buffer.m.userptr = (unsigned long) d[0].data;
b->v4l2_buffer.length = d[0].size;
b->v4l2_buffer.length = d[0].maxsize;
break;
case SPA_DATA_TYPE_DMABUF:
b->v4l2_buffer.m.fd = d[0].fd;
@ -1047,8 +1047,8 @@ mmap_init (SpaV4l2Source *this,
}
d = buffers[i]->datas;
d[0].offset = 0;
d[0].size = b->v4l2_buffer.length;
d[0].mapoffset = 0;
d[0].maxsize = b->v4l2_buffer.length;
d[0].chunk->offset = 0;
d[0].chunk->size = b->v4l2_buffer.length;
d[0].chunk->stride = state->fmt.fmt.pix.bytesperline;