mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
graph: new scheduling model
Make explicit links between elements that are used to activate the next element in the graph. Make subgraphs a special regular node. Make a link from the subgraph children to the parent so that the subgraph completes when all the children completed. Implement a single process function in plugins Remove many messages in the client node
This commit is contained in:
parent
9b0a880afb
commit
33a322b96e
36 changed files with 401 additions and 750 deletions
|
|
@ -593,12 +593,7 @@ impl_node_port_send_command(struct spa_node *node,
|
|||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int impl_node_process_input(struct spa_node *node)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int impl_node_process_output(struct spa_node *node)
|
||||
static int impl_node_process(struct spa_node *node)
|
||||
{
|
||||
struct state *this;
|
||||
struct spa_io_buffers *io;
|
||||
|
|
@ -647,8 +642,7 @@ static const struct spa_node impl_node = {
|
|||
impl_node_port_set_io,
|
||||
impl_node_port_reuse_buffer,
|
||||
impl_node_port_send_command,
|
||||
impl_node_process_input,
|
||||
impl_node_process_output,
|
||||
impl_node_process,
|
||||
};
|
||||
|
||||
static int impl_clock_enum_params(struct spa_clock *clock, uint32_t id, uint32_t *index,
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ static inline void try_pull(struct state *state, snd_pcm_uframes_t frames,
|
|||
state->range->min_size = state->threshold * state->frame_size;
|
||||
state->range->max_size = frames * state->frame_size;
|
||||
}
|
||||
state->callbacks->need_input(state->callbacks_data);
|
||||
state->callbacks->process(state->callbacks_data, SPA_STATUS_NEED_BUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -480,7 +480,7 @@ push_frames(struct state *state,
|
|||
SPA_FLAG_SET(b->flags, BUFFER_FLAG_OUT);
|
||||
io->buffer_id = b->outbuf->id;
|
||||
io->status = SPA_STATUS_HAVE_BUFFER;
|
||||
state->callbacks->have_output(state->callbacks_data);
|
||||
state->callbacks->process(state->callbacks_data, SPA_STATUS_HAVE_BUFFER);
|
||||
}
|
||||
return total_frames;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -943,6 +943,7 @@ static int mix_output(struct impl *this, size_t n_bytes)
|
|||
return SPA_STATUS_HAVE_BUFFER;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int impl_node_process_input(struct spa_node *node)
|
||||
{
|
||||
struct impl *this;
|
||||
|
|
@ -1005,8 +1006,9 @@ static int impl_node_process_input(struct spa_node *node)
|
|||
}
|
||||
return outio->status;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int impl_node_process_output(struct spa_node *node)
|
||||
static int impl_node_process(struct spa_node *node)
|
||||
{
|
||||
struct impl *this;
|
||||
struct port *outport;
|
||||
|
|
@ -1087,8 +1089,7 @@ static const struct spa_node impl_node = {
|
|||
impl_node_port_set_io,
|
||||
impl_node_port_reuse_buffer,
|
||||
impl_node_port_send_command,
|
||||
impl_node_process_input,
|
||||
impl_node_process_output,
|
||||
impl_node_process,
|
||||
};
|
||||
|
||||
static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface)
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@ static void on_output(struct spa_source *source)
|
|||
res = make_buffer(this);
|
||||
|
||||
if (res == SPA_STATUS_HAVE_BUFFER)
|
||||
this->callbacks->have_output(this->callbacks_data);
|
||||
this->callbacks->process(this->callbacks_data, res);
|
||||
}
|
||||
|
||||
static int impl_node_send_command(struct spa_node *node, const struct spa_command *command)
|
||||
|
|
@ -1010,12 +1010,7 @@ impl_node_port_send_command(struct spa_node *node,
|
|||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int impl_node_process_input(struct spa_node *node)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int impl_node_process_output(struct spa_node *node)
|
||||
static int impl_node_process(struct spa_node *node)
|
||||
{
|
||||
struct impl *this;
|
||||
struct spa_io_buffers *io;
|
||||
|
|
@ -1068,8 +1063,7 @@ static const struct spa_node impl_node = {
|
|||
impl_node_port_set_io,
|
||||
impl_node_port_reuse_buffer,
|
||||
impl_node_port_send_command,
|
||||
impl_node_process_input,
|
||||
impl_node_process_output,
|
||||
impl_node_process,
|
||||
};
|
||||
|
||||
static int impl_clock_enum_params(struct spa_clock *clock, uint32_t id, uint32_t *index,
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ static inline void try_pull(struct impl *this, uint32_t frames, bool do_pull)
|
|||
this->range->min_size = this->threshold * this->frame_size;
|
||||
this->range->max_size = frames * this->frame_size;
|
||||
}
|
||||
this->callbacks->need_input(this->callbacks_data);
|
||||
this->callbacks->process(this->callbacks_data, SPA_STATUS_NEED_BUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1257,7 +1257,7 @@ impl_node_port_send_command(struct spa_node *node,
|
|||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int impl_node_process_input(struct spa_node *node)
|
||||
static int impl_node_process(struct spa_node *node)
|
||||
{
|
||||
struct impl *this;
|
||||
struct spa_io_buffers *input;
|
||||
|
|
@ -1287,11 +1287,6 @@ static int impl_node_process_input(struct spa_node *node)
|
|||
return SPA_STATUS_OK;
|
||||
}
|
||||
|
||||
static int impl_node_process_output(struct spa_node *node)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static const struct spa_dict_item node_info_items[] = {
|
||||
{ "media.class", "Audio/Sink" },
|
||||
};
|
||||
|
|
@ -1320,8 +1315,7 @@ static const struct spa_node impl_node = {
|
|||
impl_node_port_set_io,
|
||||
impl_node_port_reuse_buffer,
|
||||
impl_node_port_send_command,
|
||||
impl_node_process_input,
|
||||
impl_node_process_output,
|
||||
impl_node_process,
|
||||
};
|
||||
|
||||
static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface)
|
||||
|
|
|
|||
|
|
@ -437,12 +437,7 @@ spa_ffmpeg_dec_node_port_set_io(struct spa_node *node,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int spa_ffmpeg_dec_node_process_input(struct spa_node *node)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int spa_ffmpeg_dec_node_process_output(struct spa_node *node)
|
||||
static int spa_ffmpeg_dec_node_process(struct spa_node *node)
|
||||
{
|
||||
struct impl *this;
|
||||
struct port *port;
|
||||
|
|
@ -508,8 +503,7 @@ static const struct spa_node ffmpeg_dec_node = {
|
|||
spa_ffmpeg_dec_node_port_set_io,
|
||||
spa_ffmpeg_dec_node_port_reuse_buffer,
|
||||
spa_ffmpeg_dec_node_port_send_command,
|
||||
spa_ffmpeg_dec_node_process_input,
|
||||
spa_ffmpeg_dec_node_process_output,
|
||||
spa_ffmpeg_dec_node_process,
|
||||
};
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -442,12 +442,7 @@ spa_ffmpeg_enc_node_port_send_command(struct spa_node *node,
|
|||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int spa_ffmpeg_enc_node_process_input(struct spa_node *node)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int spa_ffmpeg_enc_node_process_output(struct spa_node *node)
|
||||
static int spa_ffmpeg_enc_node_process(struct spa_node *node)
|
||||
{
|
||||
struct impl *this;
|
||||
struct port *port;
|
||||
|
|
@ -491,8 +486,7 @@ static const struct spa_node ffmpeg_enc_node = {
|
|||
spa_ffmpeg_enc_node_port_set_io,
|
||||
spa_ffmpeg_enc_node_port_reuse_buffer,
|
||||
spa_ffmpeg_enc_node_port_send_command,
|
||||
spa_ffmpeg_enc_node_process_input,
|
||||
spa_ffmpeg_enc_node_process_output,
|
||||
spa_ffmpeg_enc_node_process,
|
||||
};
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -269,15 +269,20 @@ static void wakeup_func(void *data, uint64_t count)
|
|||
struct impl *impl = data;
|
||||
uint32_t index;
|
||||
while (spa_ringbuffer_get_read_index(&impl->buffer, &index) > 0) {
|
||||
struct invoke_item *item =
|
||||
SPA_MEMBER(impl->buffer_data, index & (DATAS_SIZE - 1), struct invoke_item);
|
||||
struct invoke_item *item;
|
||||
bool block;
|
||||
|
||||
item = SPA_MEMBER(impl->buffer_data, index & (DATAS_SIZE - 1), struct invoke_item);
|
||||
block = item->block;
|
||||
|
||||
item->res = item->func(&impl->loop, true, item->seq, item->data, item->size,
|
||||
item->user_data);
|
||||
|
||||
spa_ringbuffer_read_update(&impl->buffer, index + item->item_size);
|
||||
|
||||
if (item->block) {
|
||||
uint64_t count = 1;
|
||||
if (write(impl->ack_fd, &count, sizeof(uint64_t)) != sizeof(uint64_t))
|
||||
if (block) {
|
||||
uint64_t c = 1;
|
||||
if (write(impl->ack_fd, &c, sizeof(uint64_t)) != sizeof(uint64_t))
|
||||
spa_log_warn(impl->log, NAME " %p: failed to write event fd: %s",
|
||||
impl, strerror(errno));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ static int impl_node_set_param(struct spa_node *node, uint32_t id, uint32_t flag
|
|||
|
||||
static void set_timer(struct impl *this, bool enabled)
|
||||
{
|
||||
if ((this->callbacks && this->callbacks->need_input) || this->props.live) {
|
||||
if ((this->callbacks && this->callbacks->process) || this->props.live) {
|
||||
if (enabled) {
|
||||
if (this->props.live) {
|
||||
uint64_t next_time = this->start_time + this->elapsed_time;
|
||||
|
|
@ -233,7 +233,7 @@ static inline void read_timer(struct impl *this)
|
|||
{
|
||||
uint64_t expirations;
|
||||
|
||||
if ((this->callbacks && this->callbacks->need_input) || this->props.live) {
|
||||
if ((this->callbacks && this->callbacks->process) || this->props.live) {
|
||||
if (read(this->timer_source.fd, &expirations, sizeof(uint64_t)) != sizeof(uint64_t))
|
||||
perror("read timerfd");
|
||||
}
|
||||
|
|
@ -253,8 +253,8 @@ static int consume_buffer(struct impl *this)
|
|||
|
||||
if (spa_list_is_empty(&this->ready)) {
|
||||
io->status = SPA_STATUS_NEED_BUFFER;
|
||||
if (this->callbacks->need_input)
|
||||
this->callbacks->need_input(this->callbacks_data);
|
||||
if (this->callbacks->process)
|
||||
this->callbacks->process(this->callbacks_data, SPA_STATUS_NEED_BUFFER);
|
||||
}
|
||||
if (spa_list_is_empty(&this->ready)) {
|
||||
spa_log_error(this->log, NAME " %p: no buffers", this);
|
||||
|
|
@ -356,7 +356,7 @@ impl_node_set_callbacks(struct spa_node *node,
|
|||
|
||||
this = SPA_CONTAINER_OF(node, struct impl, node);
|
||||
|
||||
if (this->data_loop == NULL && callbacks != NULL && callbacks->need_input != NULL) {
|
||||
if (this->data_loop == NULL && callbacks != NULL && callbacks->process != NULL) {
|
||||
spa_log_error(this->log, "a data_loop is needed for async operation");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -703,7 +703,7 @@ impl_node_port_send_command(struct spa_node *node,
|
|||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int impl_node_process_input(struct spa_node *node)
|
||||
static int impl_node_process(struct spa_node *node)
|
||||
{
|
||||
struct impl *this;
|
||||
struct spa_io_buffers *input;
|
||||
|
|
@ -732,17 +732,12 @@ static int impl_node_process_input(struct spa_node *node)
|
|||
input->buffer_id = SPA_ID_INVALID;
|
||||
input->status = SPA_STATUS_OK;
|
||||
}
|
||||
if (this->callbacks == NULL || this->callbacks->need_input == NULL)
|
||||
if (this->callbacks == NULL || this->callbacks->process == NULL)
|
||||
return consume_buffer(this);
|
||||
else
|
||||
return SPA_STATUS_OK;
|
||||
}
|
||||
|
||||
static int impl_node_process_output(struct spa_node *node)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static const struct spa_node impl_node = {
|
||||
SPA_VERSION_NODE,
|
||||
NULL,
|
||||
|
|
@ -762,8 +757,7 @@ static const struct spa_node impl_node = {
|
|||
impl_node_port_set_io,
|
||||
impl_node_port_reuse_buffer,
|
||||
impl_node_port_send_command,
|
||||
impl_node_process_input,
|
||||
impl_node_process_output,
|
||||
impl_node_process,
|
||||
};
|
||||
|
||||
static int impl_clock_enum_params(struct spa_clock *clock, uint32_t id, uint32_t *index,
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ static int fill_buffer(struct impl *this, struct buffer *b)
|
|||
|
||||
static void set_timer(struct impl *this, bool enabled)
|
||||
{
|
||||
if ((this->callbacks && this->callbacks->have_output) || this->props.live) {
|
||||
if ((this->callbacks && this->callbacks->process) || this->props.live) {
|
||||
if (enabled) {
|
||||
if (this->props.live) {
|
||||
uint64_t next_time = this->start_time + this->elapsed_time;
|
||||
|
|
@ -252,7 +252,7 @@ static inline void read_timer(struct impl *this)
|
|||
{
|
||||
uint64_t expirations;
|
||||
|
||||
if ((this->callbacks && this->callbacks->have_output) || this->props.live) {
|
||||
if ((this->callbacks && this->callbacks->process) || this->props.live) {
|
||||
if (read(this->timer_source.fd, &expirations, sizeof(uint64_t)) != sizeof(uint64_t))
|
||||
perror("read timerfd");
|
||||
}
|
||||
|
|
@ -309,8 +309,8 @@ static void on_output(struct spa_source *source)
|
|||
|
||||
res = make_buffer(this);
|
||||
|
||||
if (res == SPA_STATUS_HAVE_BUFFER && this->callbacks && this->callbacks->have_output)
|
||||
this->callbacks->have_output(this->callbacks_data);
|
||||
if (res == SPA_STATUS_HAVE_BUFFER && this->callbacks && this->callbacks->process)
|
||||
this->callbacks->process(this->callbacks_data, res);
|
||||
}
|
||||
|
||||
static int impl_node_send_command(struct spa_node *node, const struct spa_command *command)
|
||||
|
|
@ -372,7 +372,7 @@ impl_node_set_callbacks(struct spa_node *node,
|
|||
|
||||
this = SPA_CONTAINER_OF(node, struct impl, node);
|
||||
|
||||
if (this->data_loop == NULL && (callbacks != NULL && callbacks->have_output != NULL)) {
|
||||
if (this->data_loop == NULL && (callbacks != NULL && callbacks->process != NULL)) {
|
||||
spa_log_error(this->log, "a data_loop is needed for async operation");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -747,12 +747,7 @@ impl_node_port_send_command(struct spa_node *node,
|
|||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int impl_node_process_input(struct spa_node *node)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int impl_node_process_output(struct spa_node *node)
|
||||
static int impl_node_process(struct spa_node *node)
|
||||
{
|
||||
struct impl *this;
|
||||
struct spa_io_buffers *io;
|
||||
|
|
@ -771,7 +766,7 @@ static int impl_node_process_output(struct spa_node *node)
|
|||
this->io->buffer_id = SPA_ID_INVALID;
|
||||
}
|
||||
|
||||
if ((this->callbacks == NULL || this->callbacks->have_output == NULL) &&
|
||||
if ((this->callbacks == NULL || this->callbacks->process == NULL) &&
|
||||
(io->status == SPA_STATUS_NEED_BUFFER))
|
||||
return make_buffer(this);
|
||||
else
|
||||
|
|
@ -797,8 +792,7 @@ static const struct spa_node impl_node = {
|
|||
impl_node_port_set_io,
|
||||
impl_node_port_reuse_buffer,
|
||||
impl_node_port_send_command,
|
||||
impl_node_process_input,
|
||||
impl_node_process_output,
|
||||
impl_node_process,
|
||||
};
|
||||
|
||||
static int impl_clock_enum_params(struct spa_clock *clock, uint32_t id, uint32_t *index,
|
||||
|
|
|
|||
|
|
@ -828,6 +828,8 @@ static int impl_node_process(struct spa_node *node)
|
|||
io = port->io;
|
||||
spa_return_val_if_fail(io != NULL, -EIO);
|
||||
|
||||
spa_log_trace(port->log, NAME " %p; status %d", node, io->status);
|
||||
|
||||
if (io->status == SPA_STATUS_HAVE_BUFFER)
|
||||
return SPA_STATUS_HAVE_BUFFER;
|
||||
|
||||
|
|
@ -862,6 +864,8 @@ static int impl_node_process(struct spa_node *node)
|
|||
b = spa_list_first(&port->queue, struct buffer, link);
|
||||
spa_list_remove(&b->link);
|
||||
|
||||
spa_log_trace(port->log, NAME " %p: dequeue buffer %d", node, b->outbuf->id);
|
||||
|
||||
io->buffer_id = b->outbuf->id;
|
||||
io->status = SPA_STATUS_HAVE_BUFFER;
|
||||
|
||||
|
|
|
|||
|
|
@ -1181,7 +1181,7 @@ static int mmap_read(struct impl *this)
|
|||
spa_list_append(&port->queue, &b->link);
|
||||
|
||||
spa_log_trace(port->log, "v4l2 %p: have output %d", this, buf.index);
|
||||
this->callbacks->have_output(this->callbacks_data);
|
||||
this->callbacks->process(this->callbacks_data, SPA_STATUS_HAVE_BUFFER);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ static void on_output(struct spa_source *source)
|
|||
res = make_buffer(this);
|
||||
|
||||
if (res == SPA_STATUS_HAVE_BUFFER)
|
||||
this->callbacks->have_output(this->callbacks_data);
|
||||
this->callbacks->process(this->callbacks_data, res);
|
||||
}
|
||||
|
||||
static int impl_node_send_command(struct spa_node *node, const struct spa_command *command)
|
||||
|
|
@ -849,12 +849,7 @@ impl_node_port_send_command(struct spa_node *node,
|
|||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int impl_node_process_input(struct spa_node *node)
|
||||
{
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
static int impl_node_process_output(struct spa_node *node)
|
||||
static int impl_node_process(struct spa_node *node)
|
||||
{
|
||||
struct impl *this;
|
||||
struct spa_io_buffers *io;
|
||||
|
|
@ -907,8 +902,7 @@ static const struct spa_node impl_node = {
|
|||
impl_node_port_set_io,
|
||||
impl_node_port_reuse_buffer,
|
||||
impl_node_port_send_command,
|
||||
impl_node_process_input,
|
||||
impl_node_process_output,
|
||||
impl_node_process,
|
||||
};
|
||||
|
||||
static int impl_clock_enum_params(struct spa_clock *clock, uint32_t id, uint32_t *index,
|
||||
|
|
|
|||
|
|
@ -799,11 +799,11 @@ static void do_volume(struct impl *this, struct spa_buffer *dbuf, struct spa_buf
|
|||
dd[0].chunk->stride = 0;
|
||||
}
|
||||
|
||||
static int impl_node_process_input(struct spa_node *node)
|
||||
static int impl_node_process(struct spa_node *node)
|
||||
{
|
||||
struct impl *this;
|
||||
struct spa_io_buffers *input, *output;
|
||||
struct port *in_port, *out_port;
|
||||
struct spa_io_buffers *input, *output;
|
||||
struct spa_buffer *dbuf, *sbuf;
|
||||
|
||||
spa_return_val_if_fail(node != NULL, -EINVAL);
|
||||
|
|
@ -814,50 +814,6 @@ static int impl_node_process_input(struct spa_node *node)
|
|||
output = out_port->io;
|
||||
spa_return_val_if_fail(output != NULL, -EIO);
|
||||
|
||||
if (output->status == SPA_STATUS_HAVE_BUFFER)
|
||||
return SPA_STATUS_HAVE_BUFFER;
|
||||
|
||||
in_port = GET_IN_PORT(this, 0);
|
||||
input = in_port->io;
|
||||
spa_return_val_if_fail(input != NULL, -EIO);
|
||||
|
||||
if (input->buffer_id >= in_port->n_buffers) {
|
||||
input->status = -EINVAL;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ((dbuf = find_free_buffer(this, out_port)) == NULL) {
|
||||
spa_log_error(this->log, NAME " %p: out of buffers", this);
|
||||
return -EPIPE;
|
||||
}
|
||||
|
||||
sbuf = in_port->buffers[input->buffer_id].outbuf;
|
||||
|
||||
input->status = SPA_STATUS_OK;
|
||||
|
||||
spa_log_trace(this->log, NAME " %p: do volume %d -> %d", this, sbuf->id, dbuf->id);
|
||||
do_volume(this, dbuf, sbuf);
|
||||
|
||||
output->buffer_id = dbuf->id;
|
||||
output->status = SPA_STATUS_HAVE_BUFFER;
|
||||
|
||||
return SPA_STATUS_HAVE_BUFFER;
|
||||
}
|
||||
|
||||
static int impl_node_process_output(struct spa_node *node)
|
||||
{
|
||||
struct impl *this;
|
||||
struct port *in_port, *out_port;
|
||||
struct spa_io_buffers *input, *output;
|
||||
|
||||
spa_return_val_if_fail(node != NULL, -EINVAL);
|
||||
|
||||
this = SPA_CONTAINER_OF(node, struct impl, node);
|
||||
|
||||
out_port = GET_OUT_PORT(this, 0);
|
||||
output = out_port->io;
|
||||
spa_return_val_if_fail(output != NULL, -EIO);
|
||||
|
||||
if (output->status == SPA_STATUS_HAVE_BUFFER)
|
||||
return SPA_STATUS_HAVE_BUFFER;
|
||||
|
||||
|
|
@ -871,11 +827,32 @@ static int impl_node_process_output(struct spa_node *node)
|
|||
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->buffer_id >= in_port->n_buffers) {
|
||||
input->status = -EINVAL;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ((dbuf = find_free_buffer(this, out_port)) == NULL) {
|
||||
spa_log_error(this->log, NAME " %p: out of buffers", this);
|
||||
return -EPIPE;
|
||||
}
|
||||
|
||||
sbuf = in_port->buffers[input->buffer_id].outbuf;
|
||||
|
||||
spa_log_trace(this->log, NAME " %p: do volume %d -> %d", this, sbuf->id, dbuf->id);
|
||||
do_volume(this, dbuf, sbuf);
|
||||
|
||||
output->buffer_id = dbuf->id;
|
||||
output->status = SPA_STATUS_HAVE_BUFFER;
|
||||
|
||||
if (in_port->range && out_port->range)
|
||||
*in_port->range = *out_port->range;
|
||||
input->status = SPA_STATUS_NEED_BUFFER;
|
||||
|
||||
return SPA_STATUS_NEED_BUFFER;
|
||||
return SPA_STATUS_HAVE_BUFFER;
|
||||
}
|
||||
|
||||
static const struct spa_node impl_node = {
|
||||
|
|
@ -897,8 +874,7 @@ static const struct spa_node impl_node = {
|
|||
impl_node_port_set_io,
|
||||
impl_node_port_reuse_buffer,
|
||||
impl_node_port_send_command,
|
||||
impl_node_process_input,
|
||||
impl_node_process_output,
|
||||
impl_node_process,
|
||||
};
|
||||
|
||||
static int impl_get_interface(struct spa_handle *handle, uint32_t interface_id, void **interface)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue