From e009fead09410846d3dc39cd9b8e8d4c717f296e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 16 May 2019 16:42:49 +0200 Subject: [PATCH] io: remove unused range --- spa/plugins/alsa/alsa-utils.c | 6 +----- spa/plugins/alsa/alsa-utils.h | 1 - spa/plugins/audioconvert/fmtconvert.c | 6 ------ spa/plugins/audioconvert/merger.c | 6 ------ spa/plugins/audioconvert/splitter.c | 6 ------ spa/plugins/audiomixer/audiomixer.c | 12 ------------ spa/plugins/audiotestsrc/audiotestsrc.c | 16 ---------------- spa/plugins/bluez5/a2dp-sink.c | 10 +--------- spa/plugins/bluez5/a2dp-source.c | 1 - spa/plugins/volume/volume.c | 12 ------------ 10 files changed, 2 insertions(+), 74 deletions(-) diff --git a/spa/plugins/alsa/alsa-utils.c b/spa/plugins/alsa/alsa-utils.c index 647c625fb..87582c1ca 100644 --- a/spa/plugins/alsa/alsa-utils.c +++ b/spa/plugins/alsa/alsa-utils.c @@ -950,11 +950,7 @@ static int handle_play(struct state *state, uint64_t nsec, snd_pcm_sframes_t del spa_log_trace_fp(state->log, "alsa-util %p: %d", state, io->status); io->status = SPA_STATUS_NEED_BUFFER; - if (state->range) { - state->range->offset = state->sample_count * state->frame_size; - state->range->min_size = state->threshold * state->frame_size; - state->range->max_size = state->threshold * state->frame_size; - } + res = spa_node_call_ready(&state->callbacks, SPA_STATUS_NEED_BUFFER); } else { diff --git a/spa/plugins/alsa/alsa-utils.h b/spa/plugins/alsa/alsa-utils.h index d71fe55f4..a862873fb 100644 --- a/spa/plugins/alsa/alsa-utils.h +++ b/spa/plugins/alsa/alsa-utils.h @@ -106,7 +106,6 @@ struct state { struct spa_port_info port_info; struct spa_param_info port_params[8]; struct spa_io_buffers *io; - struct spa_io_range *range; struct spa_io_clock *clock; struct spa_io_position *position; struct spa_io_sequence *notify; diff --git a/spa/plugins/audioconvert/fmtconvert.c b/spa/plugins/audioconvert/fmtconvert.c index 52026653c..df4ffb6ba 100644 --- a/spa/plugins/audioconvert/fmtconvert.c +++ b/spa/plugins/audioconvert/fmtconvert.c @@ -81,7 +81,6 @@ struct port { uint32_t id; struct spa_io_buffers *io; - struct spa_io_range *ctrl; uint64_t info_all; struct spa_port_info info; @@ -755,9 +754,6 @@ impl_node_port_set_io(struct spa_node *node, case SPA_IO_Buffers: port->io = data; break; - case SPA_IO_Range: - port->ctrl = data; - break; default: return -ENOENT; } @@ -869,8 +865,6 @@ static int impl_node_process(struct spa_node *node) dst_datas = alloca(sizeof(void*) * n_dst_datas); maxsize = outb->datas[0].maxsize; - if (outport->ctrl) - maxsize = SPA_MIN(outport->ctrl->max_size, maxsize); n_samples = SPA_MIN(n_samples, maxsize / outport->stride); spa_log_trace_fp(this->log, NAME " %p: n_src:%d n_dst:%d size:%d maxsize:%d n_samples:%d", diff --git a/spa/plugins/audioconvert/merger.c b/spa/plugins/audioconvert/merger.c index 2233b5521..fc8ee0856 100644 --- a/spa/plugins/audioconvert/merger.c +++ b/spa/plugins/audioconvert/merger.c @@ -66,7 +66,6 @@ struct port { uint32_t id; struct spa_io_buffers *io; - struct spa_io_range *ctrl; uint64_t info_all; struct spa_port_info info; @@ -845,9 +844,6 @@ impl_node_port_set_io(struct spa_node *node, case SPA_IO_Buffers: port->io = data; break; - case SPA_IO_Range: - port->ctrl = data; - break; default: return -ENOENT; } @@ -958,8 +954,6 @@ static int impl_node_process(struct spa_node *node) dd = &dbuf->buf->datas[0]; maxsize = dd->maxsize; - if (outport->ctrl) - maxsize = SPA_MIN(outport->ctrl->max_size, maxsize); n_samples = maxsize / outport->stride; src_datas = alloca(sizeof(void*) * this->port_count); diff --git a/spa/plugins/audioconvert/splitter.c b/spa/plugins/audioconvert/splitter.c index 5f5ead905..e9e0e1e0a 100644 --- a/spa/plugins/audioconvert/splitter.c +++ b/spa/plugins/audioconvert/splitter.c @@ -66,7 +66,6 @@ struct port { uint32_t id; struct spa_io_buffers *io; - struct spa_io_range *ctrl; uint64_t info_all; struct spa_port_info info; @@ -808,9 +807,6 @@ impl_node_port_set_io(struct spa_node *node, case SPA_IO_Buffers: port->io = data; break; - case SPA_IO_Range: - port->ctrl = data; - break; default: return -ENOENT; } @@ -911,8 +907,6 @@ static int impl_node_process(struct spa_node *node) dd = dbuf->buf->datas; maxsize = dd->maxsize; - if (outport->ctrl) - maxsize = SPA_MIN(outport->ctrl->max_size, maxsize); n_samples = SPA_MIN(n_samples, maxsize / outport->stride); for (j = 0; j < dbuf->buf->n_datas; j++) { diff --git a/spa/plugins/audiomixer/audiomixer.c b/spa/plugins/audiomixer/audiomixer.c index bf8947d31..2a30f1791 100644 --- a/spa/plugins/audiomixer/audiomixer.c +++ b/spa/plugins/audiomixer/audiomixer.c @@ -72,7 +72,6 @@ struct port { struct port_props props; struct spa_io_buffers *io; - struct spa_io_range *io_range; double *io_volume; int32_t *io_mute; @@ -429,12 +428,6 @@ impl_node_port_enum_params(struct spa_node *node, int seq, SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_buffers))); break; case 1: - param = spa_pod_builder_add_object(&b, - SPA_TYPE_OBJECT_ParamIO, id, - SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Range), - SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_range))); - break; - case 2: param = spa_pod_builder_add_object(&b, SPA_TYPE_OBJECT_ParamIO, id, SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Control), @@ -654,9 +647,6 @@ impl_node_port_set_io(struct spa_node *node, case SPA_IO_Buffers: port->io = data; break; - case SPA_IO_Range: - port->io_range = data; - break; default: return -ENOENT; } @@ -869,8 +859,6 @@ static int impl_node_process(struct spa_node *node) i, inport->queued_bytes, inio->status); if (inport->queued_bytes == 0) { - if (inport->io_range && outport->io_range) - *inport->io_range = *outport->io_range; inio->status = SPA_STATUS_NEED_BUFFER; } } diff --git a/spa/plugins/audiotestsrc/audiotestsrc.c b/spa/plugins/audiotestsrc/audiotestsrc.c index 73221c0f0..9dbef82ff 100644 --- a/spa/plugins/audiotestsrc/audiotestsrc.c +++ b/spa/plugins/audiotestsrc/audiotestsrc.c @@ -91,7 +91,6 @@ struct port { struct spa_param_info params[5]; struct spa_io_buffers *io; - struct spa_io_range *io_range; struct spa_io_sequence *io_control; bool have_format; @@ -317,7 +316,6 @@ static int make_buffer(struct impl *this) struct buffer *b; struct port *port = &this->port; struct spa_io_buffers *io = port->io; - struct spa_io_range *range = port->io_range; uint32_t n_bytes, n_samples, maxsize; void *data; struct spa_data *d; @@ -340,11 +338,6 @@ static int make_buffer(struct impl *this) data = d[0].data; n_bytes = maxsize; - if (range && range->min_size != 0) { - n_bytes = SPA_MIN(n_bytes, range->min_size); - if (range->max_size < n_bytes) - n_bytes = range->max_size; - } spa_log_trace(this->log, NAME " %p: dequeue buffer %d %d %d", this, b->id, maxsize, n_bytes); @@ -640,12 +633,6 @@ impl_node_port_enum_params(struct spa_node *node, int seq, SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_buffers))); break; case 1: - param = spa_pod_builder_add_object(&b, - SPA_TYPE_OBJECT_ParamIO, id, - SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Range), - SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_range))); - break; - case 2: param = spa_pod_builder_add_object(&b, SPA_TYPE_OBJECT_ParamIO, id, SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Control), @@ -864,9 +851,6 @@ impl_node_port_set_io(struct spa_node *node, case SPA_IO_Buffers: port->io = data; break; - case SPA_IO_Range: - port->io_range = data; - break; case SPA_IO_Control: port->io_control = data; break; diff --git a/spa/plugins/bluez5/a2dp-sink.c b/spa/plugins/bluez5/a2dp-sink.c index de4178609..731577e56 100644 --- a/spa/plugins/bluez5/a2dp-sink.c +++ b/spa/plugins/bluez5/a2dp-sink.c @@ -71,7 +71,6 @@ struct port { uint64_t info_all; struct spa_port_info info; struct spa_io_buffers *io; - struct spa_io_range *range; struct spa_param_info params[8]; struct buffer buffers[MAX_BUFFERS]; @@ -694,11 +693,7 @@ static void a2dp_on_timeout(struct spa_source *source) spa_log_trace(this->log, "a2dp-sink %p: %d", this, io->status); io->status = SPA_STATUS_NEED_BUFFER; - if (port->range) { - port->range->offset = this->sample_count * port->frame_size; - port->range->min_size = this->threshold * port->frame_size; - port->range->max_size = this->write_samples * port->frame_size; - } + spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_BUFFER); } flush_data(this, now_time); @@ -1296,9 +1291,6 @@ impl_node_port_set_io(struct spa_node *node, case SPA_IO_Buffers: port->io = data; break; - case SPA_IO_Range: - port->range = data; - break; default: return -ENOENT; } diff --git a/spa/plugins/bluez5/a2dp-source.c b/spa/plugins/bluez5/a2dp-source.c index 0de07e9a1..0f7802a7a 100644 --- a/spa/plugins/bluez5/a2dp-source.c +++ b/spa/plugins/bluez5/a2dp-source.c @@ -72,7 +72,6 @@ struct port { uint64_t info_all; struct spa_port_info info; struct spa_io_buffers *io; - struct spa_io_range *range; struct spa_param_info params[8]; struct buffer buffers[MAX_BUFFERS]; diff --git a/spa/plugins/volume/volume.c b/spa/plugins/volume/volume.c index b93fd781c..a8d5918bc 100644 --- a/spa/plugins/volume/volume.c +++ b/spa/plugins/volume/volume.c @@ -77,7 +77,6 @@ struct port { uint32_t n_buffers; struct spa_io_buffers *io; - struct spa_io_range *range; struct spa_list empty; }; @@ -416,12 +415,6 @@ impl_node_port_enum_params(struct spa_node *node, int seq, SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Buffers), SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_buffers))); break; - case 1: - param = spa_pod_builder_add_object(&b, - SPA_TYPE_OBJECT_ParamIO, id, - SPA_PARAM_IO_id, SPA_POD_Id(SPA_IO_Range), - SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_range))); - break; default: return 0; } @@ -599,9 +592,6 @@ impl_node_port_set_io(struct spa_node *node, case SPA_IO_Buffers: port->io = data; break; - case SPA_IO_Range: - port->range = data; - break; default: return -ENOENT; } @@ -754,8 +744,6 @@ static int impl_node_process(struct spa_node *node) 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_HAVE_BUFFER;