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

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