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

@ -582,10 +582,10 @@ spa_volume_node_process_output (SpaNode *node)
sd = &sbuf->datas[si];
dd = &dbuf->datas[di];
src = (uint16_t*) ((uint8_t*)sd->data + sd->offset + soff);
dst = (uint16_t*) ((uint8_t*)dd->data + dd->offset + doff);
src = (uint16_t*) ((uint8_t*)sd->data + sd->chunk->offset + soff);
dst = (uint16_t*) ((uint8_t*)dd->data + dd->chunk->offset + doff);
n_bytes = SPA_MIN (sd->size - soff, dd->size - doff);
n_bytes = SPA_MIN (sd->chunk->size - soff, dd->chunk->size - doff);
n_samples = n_bytes / sizeof (uint16_t);
for (i = 0; i < n_samples; i++)
@ -594,11 +594,11 @@ spa_volume_node_process_output (SpaNode *node)
soff += n_bytes;
doff += n_bytes;
if (soff >= sd->size) {
if (soff >= sd->chunk->size) {
si++;
soff = 0;
}
if (doff >= dd->size) {
if (doff >= dd->chunk->size) {
di++;
doff = 0;
}