Skip to content

Commit

Permalink
autochange - step2
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinszkudlinski committed Sep 12, 2024
1 parent aa1e390 commit 027a4cc
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 33 deletions.
6 changes: 3 additions & 3 deletions src/audio/asrc/asrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ static int asrc_params(struct processing_module *mod)
return -EINVAL;
}

sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
sourceb = comp_dev_get_first_data_producer(dev);
sinkb = comp_dev_get_first_data_consumer(dev);

/* update the source/sink buffer formats. Sink rate will be modified below */
Expand Down Expand Up @@ -543,7 +543,7 @@ static int asrc_prepare(struct processing_module *mod,
return ret;

/* SRC component will only ever have 1 source and 1 sink buffer */
sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
sourceb = comp_dev_get_first_data_producer(dev);
sinkb = comp_dev_get_first_data_consumer(dev);

/* get source data format and period bytes */
Expand Down Expand Up @@ -792,7 +792,7 @@ static int asrc_process(struct processing_module *mod,
return ret;

/* asrc component needs 1 source and 1 sink buffer */
source = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
source = comp_dev_get_first_data_producer(dev);
sink = comp_dev_get_first_data_consumer(dev);

frames_src = audio_stream_get_avail_frames(source_s);
Expand Down
2 changes: 1 addition & 1 deletion src/audio/codec/dts/dts.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static int dts_effect_convert_sof_interface_result(struct comp_dev *dev,
static int dts_effect_populate_buffer_configuration(struct comp_dev *dev,
DtsSofInterfaceBufferConfiguration *buffer_config)
{
struct comp_buffer *source = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
struct comp_buffer *source = comp_dev_get_first_data_producer(dev);
const struct audio_stream *stream;
DtsSofInterfaceBufferLayout buffer_layout;
DtsSofInterfaceBufferFormat buffer_format;
Expand Down
2 changes: 1 addition & 1 deletion src/audio/dai-legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ int dai_common_params(struct dai_data *dd, struct comp_dev *dev,
}

if (dev->direction == SOF_IPC_STREAM_PLAYBACK)
dd->local_buffer = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
dd->local_buffer = comp_dev_get_first_data_producer(dev);
else
dd->local_buffer = comp_dev_get_first_data_consumer(dev);

Expand Down
4 changes: 2 additions & 2 deletions src/audio/dai-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ static int dai_set_dma_buffer(struct dai_data *dd, struct comp_dev *dev,
comp_dbg(dev, "dai_set_dma_buffer()");

if (dev->direction == SOF_IPC_STREAM_PLAYBACK)
dd->local_buffer = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
dd->local_buffer = comp_dev_get_first_data_producer(dev);
else
dd->local_buffer = comp_dev_get_first_data_consumer(dev);

Expand Down Expand Up @@ -1524,7 +1524,7 @@ static void set_new_local_buffer(struct dai_data *dd, struct comp_dev *dev)
uint32_t local_fmt;

if (dev->direction == SOF_IPC_STREAM_PLAYBACK)
dd->local_buffer = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
dd->local_buffer = comp_dev_get_first_data_producer(dev);
else
dd->local_buffer = comp_dev_get_first_data_consumer(dev);

Expand Down
2 changes: 1 addition & 1 deletion src/audio/eq_iir/eq_iir_ipc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ static int eq_iir_verify_params(struct comp_dev *dev,
comp_dbg(dev, "eq_iir_verify_params()");

/* EQ component will only ever have 1 source and 1 sink buffer */
sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
sourceb = comp_dev_get_first_data_producer(dev);
sinkb = comp_dev_get_first_data_consumer(dev);

/* we check whether we can support frame_fmt conversion (whether we have
Expand Down
4 changes: 2 additions & 2 deletions src/audio/google/google_hotword_detect.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ static int ghd_params(struct comp_dev *dev,
}

/* This detector component will only ever have 1 source */
sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
sourceb = comp_dev_get_first_data_producer(dev);

if (audio_stream_get_channels(sourceb->stream) != 1) {
comp_err(dev, "ghd_params(): Only single-channel supported");
Expand Down Expand Up @@ -390,7 +390,7 @@ static int ghd_copy(struct comp_dev *dev)
}

/* keyword components will only ever have 1 source */
source = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
source = comp_dev_get_first_data_producer(dev);
stream = &sourceb->stream;

bytes = audio_stream_get_avail_bytes(stream);
Expand Down
2 changes: 1 addition & 1 deletion src/audio/google/google_rtc_audio_processing.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ static int google_rtc_audio_processing_prepare(struct processing_module *mod,
/* Don't need the ref buffer on IPC4 as pipelines are always
* activated in tandem; also the API is deprecated
*/
cd->ref_comp_buffer = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
cd->ref_comp_buffer = comp_dev_get_first_data_producer(dev);
if (cd->aec_reference_source == 1)
cd->ref_comp_buffer = comp_dev_get_next_data_producer(dev, cd->ref_comp_buffer);
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/audio/host-legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev,
if (dev->direction == SOF_IPC_STREAM_PLAYBACK)
hd->local_buffer = comp_dev_get_first_data_consumer(dev);
else
hd->local_buffer = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
hd->local_buffer = comp_dev_get_first_data_producer(dev);

period_bytes = dev->frames *
audio_stream_frame_bytes(&hd->local_buffer->stream);
Expand Down
2 changes: 1 addition & 1 deletion src/audio/host-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev,
if (params->direction == SOF_IPC_STREAM_PLAYBACK)
hd->local_buffer = comp_dev_get_first_data_consumer(dev);
else
hd->local_buffer = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
hd->local_buffer = comp_dev_get_first_data_producer(dev);

period_bytes = dev->frames * get_frame_bytes(params->frame_fmt, params->channels);

Expand Down
2 changes: 1 addition & 1 deletion src/audio/kpb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ static int kpb_copy(struct comp_dev *dev)
}

/* Get source and sink buffers */
source = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
source = comp_dev_get_first_data_producer(dev);

/* Validate source */
if (!audio_stream_get_rptr(&source->stream)) {
Expand Down
4 changes: 2 additions & 2 deletions src/audio/module_adapter/module/waves/waves.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ static int waves_effect_allocate(struct processing_module *mod)
static int waves_effect_check(struct comp_dev *dev)
{
struct comp_buffer *sink = comp_dev_get_first_data_consumer(dev);
struct comp_buffer *source = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
struct comp_buffer *source = comp_dev_get_first_data_producer(dev);
const struct audio_stream *src_fmt = &source->stream;
const struct audio_stream *snk_fmt = &sink->stream;

Expand Down Expand Up @@ -282,7 +282,7 @@ static int waves_effect_check(struct comp_dev *dev)
static int waves_effect_init(struct processing_module *mod)
{
struct comp_dev *dev = mod->dev;
struct comp_buffer *source = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
struct comp_buffer *source = comp_dev_get_first_data_producer(dev);
struct module_data *codec = &mod->priv;
struct waves_codec_data *waves_codec = codec->private;
const struct audio_stream *src_fmt = &source->stream;
Expand Down
2 changes: 1 addition & 1 deletion src/audio/module_adapter/module_adapter_ipc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void module_adapter_check_data(struct processing_module *mod, struct comp_dev *d
*/
if (IS_PROCESSING_MODE_AUDIO_STREAM(mod) && mod->num_of_sources == 1 &&
mod->num_of_sinks == 1) {
mod->source_comp_buffer = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
mod->source_comp_buffer = comp_dev_get_first_data_producer(dev);
mod->sink_comp_buffer = sink;
mod->stream_copy_single_to_single = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/audio/module_adapter/module_adapter_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static bool module_adapter_multi_sink_source_prepare(struct comp_dev *dev)

/* re-assign the source/sink modules */
mod->sink_comp_buffer = comp_dev_get_first_data_consumer(dev);
mod->source_comp_buffer = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
mod->source_comp_buffer = comp_dev_get_first_data_producer(dev);

return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/audio/mux/mux_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ demux_func demux_get_processing_function(struct processing_module *mod)
if (list_is_empty(&dev->bsource_list))
return NULL;

sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
sourceb = comp_dev_get_first_data_producer(dev);

for (i = 0; i < ARRAY_SIZE(mux_func_map); i++) {
enum sof_ipc_frame fmt = audio_stream_get_frm_fmt(&sourceb->stream);
Expand Down
8 changes: 4 additions & 4 deletions src/audio/selector/selector.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static int selector_verify_params(struct comp_dev *dev,
params->channels = out_channels;
} else {
/* fetch source buffer for capture */
buffer = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
buffer = comp_dev_get_first_data_producer(dev);
if (cd->config.out_channels_count &&
cd->config.out_channels_count != params->channels) {
comp_err(dev, "selector_verify_params(): src in_channels_count does not match pcm channels");
Expand Down Expand Up @@ -352,7 +352,7 @@ static int selector_trigger(struct comp_dev *dev, int cmd)

comp_dbg(dev, "selector_trigger()");

sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
sourceb = comp_dev_get_first_data_producer(dev);

ret = comp_set_state(dev, cmd);

Expand Down Expand Up @@ -381,7 +381,7 @@ static int selector_copy(struct comp_dev *dev)
comp_dbg(dev, "selector_copy()");

/* selector component will have 1 source and 1 sink buffer */
source = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
source = comp_dev_get_first_data_producer(dev);
sink = comp_dev_get_first_data_consumer(dev);

if (!audio_stream_get_avail(&source->stream))
Expand Down Expand Up @@ -428,7 +428,7 @@ static int selector_prepare(struct comp_dev *dev)
return PPL_STATUS_PATH_STOP;

/* selector component will have 1 source and 1 sink buffer */
sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
sourceb = comp_dev_get_first_data_producer(dev);
sinkb = comp_dev_get_first_data_consumer(dev);

/* get source data format and period bytes */
Expand Down
4 changes: 2 additions & 2 deletions src/audio/tone.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ static int tone_params(struct comp_dev *dev,
struct comp_data *cd = comp_get_drvdata(dev);
struct comp_buffer *sourceb, *sinkb;

sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
sourceb = comp_dev_get_first_data_producer(dev);

sinkb = comp_dev_get_first_data_consumer(dev);

Expand Down Expand Up @@ -672,7 +672,7 @@ static int tone_prepare(struct comp_dev *dev)
if (ret == COMP_STATUS_STATE_ALREADY_SET)
return PPL_STATUS_PATH_STOP;

sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
sourceb = comp_dev_get_first_data_producer(dev);

cd->channels = audio_stream_get_channels(&sourceb->stream);
comp_info(dev, "tone_prepare(), cd->channels = %u, cd->rate = %u",
Expand Down
2 changes: 1 addition & 1 deletion src/audio/volume/volume.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ static int volume_prepare(struct processing_module *mod,

/* volume component will only ever have 1 sink and source buffer */
sinkb = comp_dev_get_first_data_consumer(dev);
sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
sourceb = comp_dev_get_first_data_producer(dev);

volume_set_alignment(&sourceb->stream, &sinkb->stream);

Expand Down
2 changes: 1 addition & 1 deletion src/audio/volume/volume_ipc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void set_volume_process(struct vol_data *cd, struct comp_dev *dev, bool source_o
struct comp_buffer *bufferb;

if (source_or_sink)
bufferb = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
bufferb = comp_dev_get_first_data_producer(dev);
else
bufferb = comp_dev_get_first_data_consumer(dev);

Expand Down
4 changes: 2 additions & 2 deletions src/samples/audio/detect_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ static int test_keyword_params(struct comp_dev *dev,
cd->sample_valid_bytes = params->sample_valid_bytes;

/* keyword components will only ever have 1 source */
sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
sourceb = comp_dev_get_first_data_producer(dev);
channels = audio_stream_get_channels(&sourceb->stream);
frame_fmt = audio_stream_get_frm_fmt(&sourceb->stream);
rate = audio_stream_get_rate(&sourceb->stream);
Expand Down Expand Up @@ -894,7 +894,7 @@ static int test_keyword_copy(struct comp_dev *dev)
comp_dbg(dev, "test_keyword_copy()");

/* keyword components will only ever have 1 source */
source = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
source = comp_dev_get_first_data_producer(dev);

if (!audio_stream_get_avail(&source->stream))
return PPL_STATUS_PATH_STOP;
Expand Down
4 changes: 2 additions & 2 deletions tools/plugin/modules/alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ static int aplay_params(struct comp_dev *dev, struct sof_ipc_stream_params *para
memcpy(&cd->params, params, sizeof(*params));

/* file component sink/source buffer period count */
buffer = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
buffer = comp_dev_get_first_data_producer(dev);
buffer_reset_pos(buffer, NULL);

comp_dbg(dev, "prepare done ret = %d", ret);
Expand Down Expand Up @@ -586,7 +586,7 @@ static int aplay_copy(struct comp_dev *dev)
}

/* file component source buffer */
buffer = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
buffer = comp_dev_get_first_data_producer(dev);
source = &buffer->stream;
pos = source->r_ptr;
avail = audio_stream_get_avail_frames(source);
Expand Down
2 changes: 1 addition & 1 deletion tools/plugin/modules/shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ static int shmread_copy(struct comp_dev *dev)
void *dest;

/* local SOF source buffer */
buffer = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
buffer = comp_dev_get_first_data_producer(dev);
source = &buffer->stream;
rptr = source->r_ptr;

Expand Down
2 changes: 1 addition & 1 deletion tools/testbench/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ static int file_copy(struct comp_dev *dev)
break;
case FILE_WRITE:
/* file component source buffer */
buffer = list_first_item(&dev->bsource_list, struct comp_buffer, Xsink_list);
buffer = comp_dev_get_first_data_producer(dev);

/* test source has enough free frames */
src_frames = audio_stream_get_avail_frames(&buffer->stream);
Expand Down

0 comments on commit 027a4cc

Please sign in to comment.