Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codec_adapter: remove term "dummy" from adapters #3935

Merged
merged 1 commit into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/audio/codec_adapter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ if(CONFIG_CADENCE_CODEC)
add_local_sources(sof codec/cadence.c)
endif()

if(CONFIG_DUMMY_CODEC)
add_local_sources(sof codec/dummy.c)
if(CONFIG_PASSTHROUGH_CODEC)
add_local_sources(sof codec/passthrough.c)
endif()

if(CONFIG_WAVES_CODEC)
Expand Down
8 changes: 4 additions & 4 deletions src/audio/codec_adapter/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ if CADENCE_CODEC
api symbol.
endif

config DUMMY_CODEC
bool "Dummy codec"
config PASSTHROUGH_CODEC
bool "Passthrough codec"
default n
help
Select for a dummy API codec implementation.
Select for a passthrough API codec implementation.
This will cause codec adapter component to include header
files specific to DUMMY base codecs.
files specific to PASSTHROUGH base codecs.

config WAVES_CODEC
bool "Waves codec"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@
//
// Author: Daniel Baluta <[email protected]>
//
// Dummy codec implementation to demonstrate Codec Adapter API
// Passthrough codec implementation to demonstrate Codec Adapter API

#include <sof/audio/codec_adapter/codec/generic.h>
#include <sof/audio/codec_adapter/codec/dummy.h>
#include <sof/audio/codec_adapter/codec/passthrough.h>

int dummy_codec_init(struct comp_dev *dev)
int passthrough_codec_init(struct comp_dev *dev)
{
comp_info(dev, "dummy_codec_init() start");
comp_info(dev, "passthrough_codec_init() start");
return 0;
}

int dummy_codec_prepare(struct comp_dev *dev)
int passthrough_codec_prepare(struct comp_dev *dev)
{
struct codec_data *codec = comp_get_codec(dev);
struct comp_data *cd = comp_get_drvdata(dev);

comp_info(dev, "dummy_codec_process()");
comp_info(dev, "passthrough_codec_process()");

codec->cpd.in_buff = rballoc(0, SOF_MEM_CAPS_RAM, cd->period_bytes);
if (!codec->cpd.in_buff) {
comp_err(dev, "dummy_codec_prepare(): Failed to alloc in_buff");
comp_err(dev, "passthrough_codec_prepare(): Failed to alloc in_buff");
return -ENOMEM;
}
codec->cpd.in_buff_size = cd->period_bytes;

codec->cpd.out_buff = rballoc(0, SOF_MEM_CAPS_RAM, cd->period_bytes);
if (!codec->cpd.out_buff) {
comp_err(dev, "dummy_codec_prepare(): Failed to alloc out_buff");
comp_err(dev, "passthrough_codec_prepare(): Failed to alloc out_buff");
rfree(codec->cpd.in_buff);
return -ENOMEM;
}
Expand All @@ -40,12 +40,12 @@ int dummy_codec_prepare(struct comp_dev *dev)
return 0;
}

int dummy_codec_process(struct comp_dev *dev)
int passthrough_codec_process(struct comp_dev *dev)
{
struct codec_data *codec = comp_get_codec(dev);
struct comp_data *cd = comp_get_drvdata(dev);

comp_dbg(dev, "dummy_codec_process()");
comp_dbg(dev, "passthrough_codec_process()");

memcpy_s(codec->cpd.out_buff, codec->cpd.out_buff_size,
codec->cpd.in_buff, codec->cpd.in_buff_size);
Expand All @@ -54,27 +54,27 @@ int dummy_codec_process(struct comp_dev *dev)
return 0;
}

int dummy_codec_apply_config(struct comp_dev *dev)
int passthrough_codec_apply_config(struct comp_dev *dev)
{
comp_info(dev, "dummy_codec_apply_config()");
comp_info(dev, "passthrough_codec_apply_config()");

/* nothing to do */
return 0;
}

int dummy_codec_reset(struct comp_dev *dev)
int passthrough_codec_reset(struct comp_dev *dev)
{
comp_info(dev, "dummy_codec_reset()");
comp_info(dev, "passthrough_codec_reset()");

/* nothing to do */
return 0;
}

int dummy_codec_free(struct comp_dev *dev)
int passthrough_codec_free(struct comp_dev *dev)
{
struct codec_data *codec = comp_get_codec(dev);

comp_info(dev, "dummy_codec_free()");
comp_info(dev, "passthrough_codec_free()");

rfree(codec->cpd.in_buff);
rfree(codec->cpd.out_buff);
Expand Down
18 changes: 0 additions & 18 deletions src/include/sof/audio/codec_adapter/codec/dummy.h

This file was deleted.

18 changes: 18 additions & 0 deletions src/include/sof/audio/codec_adapter/codec/passthrough.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright 2020 NXP
*
* Author: Daniel Baluta <[email protected]>
*/

#ifndef __SOF_AUDIO_PASSTHROUGH_CODEC__
#define __SOF_AUDIO_PASSTHROUGH_CODEC__

int passthrough_codec_init(struct comp_dev *dev);
int passthrough_codec_prepare(struct comp_dev *dev);
int passthrough_codec_process(struct comp_dev *dev);
int passthrough_codec_apply_config(struct comp_dev *dev);
int passthrough_codec_reset(struct comp_dev *dev);
int passthrough_codec_free(struct comp_dev *dev);

#endif /* __SOF_AUDIO_PASSTHROUGH_CODEC__ */