rename HAVE/NEED_BUFFER -> HAVE/NEED_DATA

It is more generic and works with control-only ports as well
This commit is contained in:
Wim Taymans 2019-09-16 12:55:23 +02:00
parent d648ea4ad3
commit 8b85cc225e
40 changed files with 176 additions and 176 deletions

View file

@ -613,7 +613,7 @@ static int impl_node_process(void *object)
input->buffer_id,
this->n_buffers);
if (input->status == SPA_STATUS_HAVE_BUFFER &&
if (input->status == SPA_STATUS_HAVE_DATA &&
input->buffer_id < this->n_buffers) {
struct buffer *b = &this->buffers[input->buffer_id];
@ -632,7 +632,7 @@ static int impl_node_process(void *object)
input->status = SPA_STATUS_OK;
}
return SPA_STATUS_HAVE_BUFFER;
return SPA_STATUS_HAVE_DATA;
}
static const struct spa_node_methods impl_node = {

View file

@ -635,8 +635,8 @@ static int impl_node_process(void *object)
io = this->io;
spa_return_val_if_fail(io != NULL, -EIO);
if (io->status == SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_HAVE_BUFFER;
if (io->status == SPA_STATUS_HAVE_DATA)
return SPA_STATUS_HAVE_DATA;
if (io->buffer_id < this->n_buffers) {
recycle_buffer(this, io->buffer_id);
@ -655,9 +655,9 @@ static int impl_node_process(void *object)
spa_log_trace_fp(this->log, NAME " %p: dequeue buffer %d", this, b->id);
io->buffer_id = b->id;
io->status = SPA_STATUS_HAVE_BUFFER;
io->status = SPA_STATUS_HAVE_DATA;
return SPA_STATUS_HAVE_BUFFER;
return SPA_STATUS_HAVE_DATA;
}
static const struct spa_node_methods impl_node = {

View file

@ -987,9 +987,9 @@ static int handle_play(struct state *state, uint64_t nsec,
spa_log_trace_fp(state->log, "alsa-util %p: %d", state, io->status);
io->status = SPA_STATUS_NEED_BUFFER;
io->status = SPA_STATUS_NEED_DATA;
res = spa_node_call_ready(&state->callbacks, SPA_STATUS_NEED_BUFFER);
res = spa_node_call_ready(&state->callbacks, SPA_STATUS_NEED_DATA);
}
else {
res = spa_alsa_write(state, 0);
@ -1018,15 +1018,15 @@ static int handle_capture(struct state *state, uint64_t nsec,
if (!spa_list_is_empty(&state->ready)) {
io = state->io;
if (io != NULL && io->status != SPA_STATUS_HAVE_BUFFER) {
if (io != NULL && io->status != SPA_STATUS_HAVE_DATA) {
struct buffer *b = spa_list_first(&state->ready, struct buffer, link);
spa_list_remove(&b->link);
io->buffer_id = b->id;
io->status = SPA_STATUS_HAVE_BUFFER;
io->status = SPA_STATUS_HAVE_DATA;
}
}
spa_node_call_ready(&state->callbacks, SPA_STATUS_HAVE_BUFFER);
spa_node_call_ready(&state->callbacks, SPA_STATUS_HAVE_DATA);
return 0;
}

View file

@ -138,7 +138,7 @@ static int make_link(struct impl *this,
l->in_port = in_port;
l->in_flags = 0;
l->negotiated = false;
l->io.status = SPA_STATUS_NEED_BUFFER;
l->io.status = SPA_STATUS_NEED_DATA;
l->io.buffer_id = SPA_ID_INVALID;
l->n_buffers = 0;
l->min_buffers = min_buffers;
@ -1082,15 +1082,15 @@ static int impl_node_process(void *object)
if (r < 0)
return r;
if (r & SPA_STATUS_HAVE_BUFFER)
if (r & SPA_STATUS_HAVE_DATA)
ready++;
if (i == 0)
res |= r & SPA_STATUS_NEED_BUFFER;
res |= r & SPA_STATUS_NEED_DATA;
if (i == this->n_nodes-1)
res |= r & SPA_STATUS_HAVE_BUFFER;
res |= r & SPA_STATUS_HAVE_DATA;
}
if (res & SPA_STATUS_HAVE_BUFFER)
if (res & SPA_STATUS_HAVE_DATA)
break;
if (ready == 0)
break;

View file

@ -887,11 +887,11 @@ static int impl_node_process(void *object)
if (outport->control)
process_control(this, outport, &outport->control->sequence);
if (outio->status == SPA_STATUS_HAVE_BUFFER)
if (outio->status == SPA_STATUS_HAVE_DATA)
goto done;
if (inio->status != SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_NEED_BUFFER;
if (inio->status != SPA_STATUS_HAVE_DATA)
return SPA_STATUS_NEED_DATA;
/* recycle */
if (outio->buffer_id < outport->n_buffers) {
@ -933,13 +933,13 @@ static int impl_node_process(void *object)
n_src_datas, src_datas, n_samples);
}
outio->status = SPA_STATUS_HAVE_BUFFER;
outio->status = SPA_STATUS_HAVE_DATA;
outio->buffer_id = dbuf->id;
inio->status = SPA_STATUS_NEED_BUFFER;
inio->status = SPA_STATUS_NEED_DATA;
done:
return SPA_STATUS_HAVE_BUFFER | SPA_STATUS_NEED_BUFFER;
return SPA_STATUS_HAVE_DATA | SPA_STATUS_NEED_DATA;
}
static const struct spa_node_methods impl_node = {

View file

@ -814,15 +814,15 @@ static int impl_node_process(void *object)
inio, inio->status, inio->buffer_id,
outio, outio->status, outio->buffer_id);
if (outio->status == SPA_STATUS_HAVE_BUFFER)
if (outio->status == SPA_STATUS_HAVE_DATA)
return inio->status | outio->status;
if (outio->buffer_id < outport->n_buffers) {
recycle_buffer(this, outport, outio->buffer_id);
outio->buffer_id = SPA_ID_INVALID;
}
if (inio->status != SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_NEED_BUFFER;
if (inio->status != SPA_STATUS_HAVE_DATA)
return SPA_STATUS_NEED_DATA;
if (inio->buffer_id >= inport->n_buffers)
return inio->status = -EINVAL;
@ -867,12 +867,12 @@ static int impl_node_process(void *object)
if (!this->is_passthrough)
convert_process(&this->conv, dst_datas, src_datas, n_samples);
inio->status = SPA_STATUS_NEED_BUFFER;
res |= SPA_STATUS_NEED_BUFFER;
inio->status = SPA_STATUS_NEED_DATA;
res |= SPA_STATUS_NEED_DATA;
outio->status = SPA_STATUS_HAVE_BUFFER;
outio->status = SPA_STATUS_HAVE_DATA;
outio->buffer_id = outbuf->id;
res |= SPA_STATUS_HAVE_BUFFER;
res |= SPA_STATUS_HAVE_DATA;
return res;
}

View file

@ -865,7 +865,7 @@ static inline int get_in_buffer(struct impl *this, struct port *port, struct buf
this, port->id);
return -EIO;
}
if (io->status != SPA_STATUS_HAVE_BUFFER ||
if (io->status != SPA_STATUS_HAVE_DATA ||
io->buffer_id >= port->n_buffers) {
spa_log_trace_fp(this->log, NAME " %p: empty port %d %p %d %d %d",
this, port->id, io, io->status, io->buffer_id,
@ -874,7 +874,7 @@ static inline int get_in_buffer(struct impl *this, struct port *port, struct buf
}
*buf = &port->buffers[io->buffer_id];
io->status = SPA_STATUS_NEED_BUFFER;
io->status = SPA_STATUS_NEED_DATA;
return 0;
}
@ -884,8 +884,8 @@ static inline int get_out_buffer(struct impl *this, struct port *port, struct bu
struct spa_io_buffers *io;
if ((io = port->io) == NULL ||
io->status == SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_HAVE_BUFFER;
io->status == SPA_STATUS_HAVE_DATA)
return SPA_STATUS_HAVE_DATA;
if (io->buffer_id < port->n_buffers)
queue_buffer(this, port, io->buffer_id);
@ -893,7 +893,7 @@ static inline int get_out_buffer(struct impl *this, struct port *port, struct bu
if ((*buf = dequeue_buffer(this, port)) == NULL)
return -EPIPE;
io->status = SPA_STATUS_HAVE_BUFFER;
io->status = SPA_STATUS_HAVE_DATA;
io->buffer_id = (*buf)->id;
return 0;
@ -978,7 +978,7 @@ static int impl_node_process(void *object)
spa_log_trace_fp(this->log, NAME " %p: %d %d %d %p", this,
sd->chunk->size, maxsize, n_samples, src_datas[i]);
SPA_FLAG_SET(res, SPA_STATUS_NEED_BUFFER);
SPA_FLAG_SET(res, SPA_STATUS_NEED_DATA);
}
for (i = 0; i < this->monitor_count; i++)
@ -995,7 +995,7 @@ static int impl_node_process(void *object)
if (!this->is_passthrough)
convert_process(&this->conv, dst_datas, src_datas, n_samples);
return res | SPA_STATUS_HAVE_BUFFER;
return res | SPA_STATUS_HAVE_DATA;
}
static const struct spa_node_methods impl_node = {

View file

@ -723,11 +723,11 @@ static int impl_node_process(void *object)
spa_log_trace_fp(this->log, NAME " %p: status %d %d %d",
this, inio->status, outio->status, inio->buffer_id);
if (outio->status == SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_HAVE_BUFFER;
if (outio->status == SPA_STATUS_HAVE_DATA)
return SPA_STATUS_HAVE_DATA;
if (inio->status != SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_NEED_BUFFER;
if (inio->status != SPA_STATUS_HAVE_DATA)
return SPA_STATUS_NEED_DATA;
/* recycle */
if (outio->buffer_id < outport->n_buffers) {
@ -794,19 +794,19 @@ static int impl_node_process(void *object)
inport->offset += in_len * sizeof(float);
if (inport->offset >= size || flush_in) {
inio->status = SPA_STATUS_NEED_BUFFER;
inio->status = SPA_STATUS_NEED_DATA;
inport->offset = 0;
SPA_FLAG_SET(res, SPA_STATUS_NEED_BUFFER);
SPA_FLAG_SET(res, SPA_STATUS_NEED_DATA);
spa_log_trace_fp(this->log, NAME " %p: return input buffer", this);
}
outport->offset += out_len * sizeof(float);
if (outport->offset > 0 && (outport->offset >= maxsize || flush_out)) {
outio->status = SPA_STATUS_HAVE_BUFFER;
outio->status = SPA_STATUS_HAVE_DATA;
outio->buffer_id = dbuf->id;
dequeue_buffer(this, dbuf);
outport->offset = 0;
SPA_FLAG_SET(res, SPA_STATUS_HAVE_BUFFER);
SPA_FLAG_SET(res, SPA_STATUS_HAVE_DATA);
spa_log_trace_fp(this->log, NAME " %p: have output buffer", this);
}

View file

@ -833,8 +833,8 @@ static int impl_node_process(void *object)
spa_log_trace_fp(this->log, NAME " %p: status %p %d %d", this,
inio, inio->status, inio->buffer_id);
if (inio->status != SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_NEED_BUFFER;
if (inio->status != SPA_STATUS_HAVE_DATA)
return SPA_STATUS_NEED_DATA;
if (inio->buffer_id >= inport->n_buffers)
return inio->status = -EINVAL;
@ -865,8 +865,8 @@ static int impl_node_process(void *object)
spa_log_trace_fp(this->log, NAME " %p: %d %p %d %d %d", this, i,
outio, outio->status, outio->buffer_id, outport->stride);
if (outio->status == SPA_STATUS_HAVE_BUFFER) {
res |= SPA_STATUS_HAVE_BUFFER;
if (outio->status == SPA_STATUS_HAVE_DATA) {
res |= SPA_STATUS_HAVE_DATA;
goto empty;
}
@ -897,9 +897,9 @@ static int impl_node_process(void *object)
dd[j].chunk->size = n_samples * outport->stride;
}
outio->status = SPA_STATUS_HAVE_BUFFER;
outio->status = SPA_STATUS_HAVE_DATA;
outio->buffer_id = dbuf->id;
res |= SPA_STATUS_HAVE_BUFFER;
res |= SPA_STATUS_HAVE_DATA;
}
while (n_dst_datas < this->port_count) {
spa_log_trace_fp(this->log, NAME" %p: %d fill output", this, n_dst_datas);
@ -913,8 +913,8 @@ static int impl_node_process(void *object)
if (!this->is_passthrough)
convert_process(&this->conv, dst_datas, src_datas, n_samples);
inio->status = SPA_STATUS_NEED_BUFFER;
res |= SPA_STATUS_NEED_BUFFER;
inio->status = SPA_STATUS_NEED_DATA;
res |= SPA_STATUS_NEED_DATA;
return res;
}

View file

@ -753,7 +753,7 @@ static int impl_node_process(void *object)
spa_log_trace_fp(this->log, NAME " %p: status %d", this, io->status);
if (io->status == SPA_STATUS_HAVE_BUFFER)
if (io->status == SPA_STATUS_HAVE_DATA)
goto done;
/* recycle */
@ -765,11 +765,11 @@ static int impl_node_process(void *object)
if ((buf = dequeue_buffer(this, port)) == NULL)
return io->status = -EPIPE;
io->status = SPA_STATUS_HAVE_BUFFER;
io->status = SPA_STATUS_HAVE_DATA;
io->buffer_id = buf->id;
done:
return SPA_STATUS_HAVE_BUFFER;
return SPA_STATUS_HAVE_DATA;
}
static const struct spa_node_methods impl_node = {

View file

@ -768,9 +768,9 @@ static int mix_output(struct impl *this, size_t n_bytes)
od[0].chunk->stride = 0;
outio->buffer_id = outbuf->id;
outio->status = SPA_STATUS_HAVE_BUFFER;
outio->status = SPA_STATUS_HAVE_DATA;
return SPA_STATUS_HAVE_BUFFER;
return SPA_STATUS_HAVE_DATA;
}
static int impl_node_process(void *object)
@ -789,7 +789,7 @@ static int impl_node_process(void *object)
spa_log_trace(this->log, NAME " %p: status %d", this, outio->status);
if (outio->status == SPA_STATUS_HAVE_BUFFER)
if (outio->status == SPA_STATUS_HAVE_DATA)
goto done;
/* recycle */
@ -823,10 +823,10 @@ static int impl_node_process(void *object)
i, inport->queued_bytes, inio->status);
if (inport->queued_bytes == 0) {
inio->status = SPA_STATUS_NEED_BUFFER;
inio->status = SPA_STATUS_NEED_DATA;
}
}
outio->status = SPA_STATUS_NEED_BUFFER;
outio->status = SPA_STATUS_NEED_DATA;
}
done:
return outio->status;

View file

@ -373,7 +373,7 @@ static int make_buffer(struct impl *this)
set_timer(this, true);
io->buffer_id = b->id;
io->status = SPA_STATUS_HAVE_BUFFER;
io->status = SPA_STATUS_HAVE_DATA;
return io->status;
}
@ -385,7 +385,7 @@ static void on_output(struct spa_source *source)
res = make_buffer(this);
if (res == SPA_STATUS_HAVE_BUFFER)
if (res == SPA_STATUS_HAVE_DATA)
spa_node_call_ready(&this->callbacks, res);
}
@ -891,15 +891,15 @@ static int impl_node_process(void *object)
if (port->io_control)
process_control(this, &port->io_control->sequence);
if (io->status == SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_HAVE_BUFFER;
if (io->status == SPA_STATUS_HAVE_DATA)
return SPA_STATUS_HAVE_DATA;
if (io->buffer_id < port->n_buffers) {
reuse_buffer(this, port, io->buffer_id);
io->buffer_id = SPA_ID_INVALID;
}
if (!this->props.live && (io->status == SPA_STATUS_NEED_BUFFER))
if (!this->props.live && (io->status == SPA_STATUS_NEED_DATA))
return make_buffer(this);
else
return SPA_STATUS_OK;

View file

@ -699,9 +699,9 @@ static void a2dp_on_timeout(struct spa_source *source)
if (spa_list_is_empty(&port->ready) || port->need_data) {
spa_log_trace(this->log, NAME " %p: %d", this, io->status);
io->status = SPA_STATUS_NEED_BUFFER;
io->status = SPA_STATUS_NEED_DATA;
spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_BUFFER);
spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_DATA);
}
flush_data(this, now_time);
}
@ -1304,7 +1304,7 @@ static int impl_node_process(void *object)
if (!spa_list_is_empty(&port->ready))
flush_data(this, now_time);
if (io->status == SPA_STATUS_HAVE_BUFFER && io->buffer_id < port->n_buffers) {
if (io->status == SPA_STATUS_HAVE_DATA && io->buffer_id < port->n_buffers) {
struct buffer *b = &port->buffers[io->buffer_id];
if (!b->outstanding) {
@ -1326,7 +1326,7 @@ static int impl_node_process(void *object)
io->status = SPA_STATUS_OK;
}
return SPA_STATUS_HAVE_BUFFER;
return SPA_STATUS_HAVE_DATA;
}
static const struct spa_node_methods impl_node = {

View file

@ -374,21 +374,21 @@ static void decode_sbc_data(struct impl *this, uint8_t *src, size_t src_size)
}
/* Process a buffer if there is one ready and IO does not have one */
if (!spa_list_is_empty(&port->ready) && io->status != SPA_STATUS_HAVE_BUFFER) {
if (!spa_list_is_empty(&port->ready) && io->status != SPA_STATUS_HAVE_DATA) {
/* Get the ready buffer and remove it from the ready list */
buffer = spa_list_first(&port->ready, struct buffer, link);
spa_list_remove(&buffer->link);
/* Mark the buffer to be processed */
io->buffer_id = buffer->id;
io->status = SPA_STATUS_HAVE_BUFFER;
io->status = SPA_STATUS_HAVE_DATA;
/* Add the buffer to the free list */
spa_list_append(&port->free, &buffer->link);
buffer->outstanding = false;
/* Set the done status as have buffer */
io_done_status = SPA_STATUS_HAVE_BUFFER;
io_done_status = SPA_STATUS_HAVE_DATA;
}
spa_node_call_ready(&this->callbacks, io_done_status);
@ -983,8 +983,8 @@ static int impl_node_process(void *object)
spa_return_val_if_fail(io != NULL, -EIO);
/* Return if we already have a buffer */
if (io->status == SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_HAVE_BUFFER;
if (io->status == SPA_STATUS_HAVE_DATA)
return SPA_STATUS_HAVE_DATA;
/* Return if there is not buffers ready to be processed */
if (spa_list_is_empty(&port->ready))
@ -996,14 +996,14 @@ static int impl_node_process(void *object)
/* Set the new buffer in IO */
io->buffer_id = buffer->id;
io->status = SPA_STATUS_HAVE_BUFFER;
io->status = SPA_STATUS_HAVE_DATA;
/* Add the buffer to the free list */
spa_list_append(&port->free, &buffer->link);
buffer->outstanding = false;
/* Notify we have a buffer ready to be processed */
return SPA_STATUS_HAVE_BUFFER;
return SPA_STATUS_HAVE_DATA;
}
static const struct spa_node_methods impl_node = {

View file

@ -483,8 +483,8 @@ static void sco_on_timeout(struct spa_source *source)
/* Notify we need a new buffer if we have processed all of them */
if (spa_list_is_empty(&port->ready) || port->need_data) {
io->status = SPA_STATUS_NEED_BUFFER;
spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_BUFFER);
io->status = SPA_STATUS_NEED_DATA;
spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_DATA);
}
/* Render the buffers */
@ -994,7 +994,7 @@ static int impl_node_process(void *object)
if (!spa_list_is_empty(&port->ready))
render_buffers(this, now_time);
if (io->status == SPA_STATUS_HAVE_BUFFER && io->buffer_id < port->n_buffers) {
if (io->status == SPA_STATUS_HAVE_DATA && io->buffer_id < port->n_buffers) {
struct buffer *b = &port->buffers[io->buffer_id];
if (!b->outstanding) {
@ -1017,7 +1017,7 @@ static int impl_node_process(void *object)
io->status = SPA_STATUS_OK;
}
return SPA_STATUS_HAVE_BUFFER;
return SPA_STATUS_HAVE_DATA;
}
static const struct spa_node_methods impl_node = {

View file

@ -379,21 +379,21 @@ static void sco_on_ready_read(struct spa_source *source)
}
/* Process a buffer if there is one ready and IO does not have one */
if (!spa_list_is_empty(&port->ready) && io->status != SPA_STATUS_HAVE_BUFFER) {
if (!spa_list_is_empty(&port->ready) && io->status != SPA_STATUS_HAVE_DATA) {
/* Get the ready buffer and remove it from the ready list */
buffer = spa_list_first(&port->ready, struct buffer, link);
spa_list_remove(&buffer->link);
/* Mark the buffer to be processed */
io->buffer_id = buffer->id;
io->status = SPA_STATUS_HAVE_BUFFER;
io->status = SPA_STATUS_HAVE_DATA;
/* Add the buffer to the free list */
spa_list_append(&port->free, &buffer->link);
buffer->outstanding = false;
/* Set the done status as have buffer */
io_done_status = SPA_STATUS_HAVE_BUFFER;
io_done_status = SPA_STATUS_HAVE_DATA;
}
/* Notify the current status */
@ -903,8 +903,8 @@ static int impl_node_process(void *object)
spa_return_val_if_fail(io != NULL, -EIO);
/* Return if we already have a buffer */
if (io->status == SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_HAVE_BUFFER;
if (io->status == SPA_STATUS_HAVE_DATA)
return SPA_STATUS_HAVE_DATA;
/* Return if there is not buffers ready to be processed */
if (spa_list_is_empty(&port->ready))
@ -916,14 +916,14 @@ static int impl_node_process(void *object)
/* Set the new buffer in IO */
io->buffer_id = buffer->id;
io->status = SPA_STATUS_HAVE_BUFFER;
io->status = SPA_STATUS_HAVE_DATA;
/* Add the buffer to the free list */
spa_list_append(&port->free, &buffer->link);
buffer->outstanding = false;
/* Notify we have a buffer ready to be processed */
return SPA_STATUS_HAVE_BUFFER;
return SPA_STATUS_HAVE_DATA;
}
static const struct spa_node_methods impl_node = {

View file

@ -353,7 +353,7 @@ static void client_process(void *data)
s->bar.beat = jp->bar * jp->beats_per_bar + jp->beat;
}
}
spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_BUFFER);
spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_DATA);
}
static const struct spa_jack_client_events client_events = {
@ -730,7 +730,7 @@ static int impl_node_process(void *object)
dst = jack_port_get_buffer(port->jack_port, n_frames);
if (io == NULL ||
io->status != SPA_STATUS_HAVE_BUFFER ||
io->status != SPA_STATUS_HAVE_DATA ||
io->buffer_id >= port->n_buffers) {
memset(dst, 0, n_frames * sizeof(float));
continue;
@ -742,9 +742,9 @@ static int impl_node_process(void *object)
memcpy(dst, src->data, n_frames * port->stride);
io->status = SPA_STATUS_NEED_BUFFER;
io->status = SPA_STATUS_NEED_DATA;
res |= SPA_STATUS_NEED_BUFFER;
res |= SPA_STATUS_NEED_DATA;
}
return res;
}

View file

@ -741,7 +741,7 @@ static int impl_node_process(void *object)
const void *src;
uint32_t n_frames = this->client->buffer_size;
if (io == NULL || io->status == SPA_STATUS_HAVE_BUFFER)
if (io == NULL || io->status == SPA_STATUS_HAVE_DATA)
continue;
if (io->buffer_id < port->n_buffers) {
@ -765,9 +765,9 @@ static int impl_node_process(void *object)
d->chunk->flags = 0;
io->buffer_id = b->id;
io->status = SPA_STATUS_HAVE_BUFFER;
io->status = SPA_STATUS_HAVE_DATA;
res |= SPA_STATUS_HAVE_BUFFER;
res |= SPA_STATUS_HAVE_DATA;
}
return res;
}

View file

@ -232,8 +232,8 @@ static int consume_buffer(struct impl *this)
read_timer(this);
if (spa_list_is_empty(&port->ready)) {
io->status = SPA_STATUS_NEED_BUFFER;
spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_BUFFER);
io->status = SPA_STATUS_NEED_DATA;
spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_DATA);
}
if (spa_list_is_empty(&port->ready)) {
spa_log_error(this->log, NAME " %p: no buffers", this);
@ -264,10 +264,10 @@ static int consume_buffer(struct impl *this)
set_timer(this, true);
io->buffer_id = b->id;
io->status = SPA_STATUS_NEED_BUFFER;
io->status = SPA_STATUS_NEED_DATA;
b->outstanding = true;
return SPA_STATUS_NEED_BUFFER;
return SPA_STATUS_NEED_DATA;
}
static void on_input(struct spa_source *source)
@ -636,7 +636,7 @@ static int impl_node_process(void *object)
io = port->io;
spa_return_val_if_fail(io != NULL, -EIO);
if (io->status == SPA_STATUS_HAVE_BUFFER && io->buffer_id < port->n_buffers) {
if (io->status == SPA_STATUS_HAVE_DATA && io->buffer_id < port->n_buffers) {
struct buffer *b = &port->buffers[io->buffer_id];
if (!b->outstanding) {

View file

@ -276,9 +276,9 @@ static int make_buffer(struct impl *this)
set_timer(this, true);
io->buffer_id = b->id;
io->status = SPA_STATUS_HAVE_BUFFER;
io->status = SPA_STATUS_HAVE_DATA;
return SPA_STATUS_HAVE_BUFFER;
return SPA_STATUS_HAVE_DATA;
}
static void on_output(struct spa_source *source)
@ -288,7 +288,7 @@ static void on_output(struct spa_source *source)
res = make_buffer(this);
if (res == SPA_STATUS_HAVE_BUFFER && this->callbacks.funcs)
if (res == SPA_STATUS_HAVE_DATA && this->callbacks.funcs)
spa_node_call_ready(&this->callbacks, res);
}
@ -679,8 +679,8 @@ static int impl_node_process(void *object)
io = port->io;
spa_return_val_if_fail(io != NULL, -EIO);
if (io->status == SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_HAVE_BUFFER;
if (io->status == SPA_STATUS_HAVE_DATA)
return SPA_STATUS_HAVE_DATA;
if (io->buffer_id < port->n_buffers) {
reuse_buffer(this, port, io->buffer_id);
@ -688,7 +688,7 @@ static int impl_node_process(void *object)
}
if (this->callbacks.funcs == NULL &&
(io->status == SPA_STATUS_NEED_BUFFER))
(io->status == SPA_STATUS_NEED_DATA))
return make_buffer(this);
else
return SPA_STATUS_OK;

View file

@ -842,8 +842,8 @@ static int impl_node_process(void *object)
spa_log_trace(this->log, NAME " %p; status %d", this, io->status);
if (io->status == SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_HAVE_BUFFER;
if (io->status == SPA_STATUS_HAVE_DATA)
return SPA_STATUS_HAVE_DATA;
if (io->buffer_id < port->n_buffers) {
if ((res = spa_v4l2_buffer_recycle(this, io->buffer_id)) < 0)
@ -861,9 +861,9 @@ static int impl_node_process(void *object)
spa_log_trace(this->log, NAME " %p: dequeue buffer %d", this, b->id);
io->buffer_id = b->id;
io->status = SPA_STATUS_HAVE_BUFFER;
io->status = SPA_STATUS_HAVE_DATA;
return SPA_STATUS_HAVE_BUFFER;
return SPA_STATUS_HAVE_DATA;
}
static const struct spa_node_methods impl_node = {

View file

@ -1214,16 +1214,16 @@ static int mmap_read(struct impl *this)
SPA_FLAG_SET(b->flags, BUFFER_FLAG_OUTSTANDING);
io = port->io;
if (io != NULL && io->status != SPA_STATUS_HAVE_BUFFER) {
if (io != NULL && io->status != SPA_STATUS_HAVE_DATA) {
io->buffer_id = b->id;
io->status = SPA_STATUS_HAVE_BUFFER;
io->status = SPA_STATUS_HAVE_DATA;
}
else {
spa_list_append(&port->queue, &b->link);
}
spa_log_trace(this->log, "v4l2 %p: now queued %d", this, b->id);
spa_node_call_ready(&this->callbacks, SPA_STATUS_HAVE_BUFFER);
spa_node_call_ready(&this->callbacks, SPA_STATUS_HAVE_DATA);
return 0;
}

View file

@ -770,7 +770,7 @@ static int impl_node_process(void *object)
status = spa_node_process(this->slave);
if (this->monitor)
status |= SPA_STATUS_HAVE_BUFFER;
status |= SPA_STATUS_HAVE_DATA;
if (this->direction == SPA_DIRECTION_OUTPUT && !this->master) {
if (this->use_converter)

View file

@ -324,7 +324,7 @@ static int make_buffer(struct impl *this)
set_timer(this, true);
io->buffer_id = b->id;
io->status = SPA_STATUS_HAVE_BUFFER;
io->status = SPA_STATUS_HAVE_DATA;
return io->status;
}
@ -336,7 +336,7 @@ static void on_output(struct spa_source *source)
res = make_buffer(this);
if (res == SPA_STATUS_HAVE_BUFFER)
if (res == SPA_STATUS_HAVE_DATA)
spa_node_call_ready(&this->callbacks, res);
}
@ -776,15 +776,15 @@ static int impl_node_process(void *object)
io = port->io;
spa_return_val_if_fail(io != NULL, -EIO);
if (io->status == SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_HAVE_BUFFER;
if (io->status == SPA_STATUS_HAVE_DATA)
return SPA_STATUS_HAVE_DATA;
if (io->buffer_id < port->n_buffers) {
reuse_buffer(this, port, io->buffer_id);
io->buffer_id = SPA_ID_INVALID;
}
if (!this->props.live && (io->status == SPA_STATUS_NEED_BUFFER))
if (!this->props.live && (io->status == SPA_STATUS_NEED_DATA))
return make_buffer(this);
else
return SPA_STATUS_OK;

View file

@ -680,8 +680,8 @@ static int impl_node_process(void *object)
output = out_port->io;
spa_return_val_if_fail(output != NULL, -EIO);
if (output->status == SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_HAVE_BUFFER;
if (output->status == SPA_STATUS_HAVE_DATA)
return SPA_STATUS_HAVE_DATA;
/* recycle */
if (output->buffer_id < out_port->n_buffers) {
@ -693,8 +693,8 @@ static int impl_node_process(void *object)
input = in_port->io;
spa_return_val_if_fail(input != NULL, -EIO);
if (input->status != SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_NEED_BUFFER;
if (input->status != SPA_STATUS_HAVE_DATA)
return SPA_STATUS_NEED_DATA;
if (input->buffer_id >= in_port->n_buffers) {
input->status = -EINVAL;
@ -712,11 +712,11 @@ static int impl_node_process(void *object)
do_volume(this, dbuf->outbuf, sbuf->outbuf);
output->buffer_id = dbuf->id;
output->status = SPA_STATUS_HAVE_BUFFER;
output->status = SPA_STATUS_HAVE_DATA;
input->status = SPA_STATUS_NEED_BUFFER;
input->status = SPA_STATUS_NEED_DATA;
return SPA_STATUS_HAVE_BUFFER;
return SPA_STATUS_HAVE_DATA;
}
static const struct spa_node_methods impl_node = {

View file

@ -308,7 +308,7 @@ static int make_buffer(struct impl *this)
SPA_FLAG_SET(b->flags, BUFFER_FLAG_OUT);
spa_list_append(&port->ready, &b->link);
res = SPA_STATUS_HAVE_BUFFER;
res = SPA_STATUS_HAVE_DATA;
}
next:
this->frame_count++;
@ -343,7 +343,7 @@ static void on_output(struct spa_source *source)
if (io == NULL)
return;
if (io->status == SPA_STATUS_HAVE_BUFFER)
if (io->status == SPA_STATUS_HAVE_DATA)
return;
if (io->buffer_id < port->n_buffers) {
@ -358,7 +358,7 @@ static void on_output(struct spa_source *source)
spa_list_remove(&b->link);
io->buffer_id = b->id;
io->status = SPA_STATUS_HAVE_BUFFER;
io->status = SPA_STATUS_HAVE_DATA;
}
spa_node_call_ready(&this->callbacks, res);
}
@ -789,15 +789,15 @@ static int impl_node_process(void *object)
io = port->io;
spa_return_val_if_fail(io != NULL, -EIO);
if (io->status == SPA_STATUS_HAVE_BUFFER)
return SPA_STATUS_HAVE_BUFFER;
if (io->status == SPA_STATUS_HAVE_DATA)
return SPA_STATUS_HAVE_DATA;
if (io->buffer_id < port->n_buffers) {
reuse_buffer(this, port, io->buffer_id);
io->buffer_id = SPA_ID_INVALID;
}
if (!this->props.live && (io->status == SPA_STATUS_NEED_BUFFER))
if (!this->props.live && (io->status == SPA_STATUS_NEED_DATA))
return make_buffer(this);
else
return SPA_STATUS_OK;