mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
rename HAVE/NEED_BUFFER -> HAVE/NEED_DATA
It is more generic and works with control-only ports as well
This commit is contained in:
parent
d648ea4ad3
commit
8b85cc225e
40 changed files with 176 additions and 176 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue