-
Notifications
You must be signed in to change notification settings - Fork 349
src: codec_adapter: Add process passthrough path #3766
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -245,6 +245,22 @@ int codec_prepare(struct comp_dev *dev) | |
| return ret; | ||
| } | ||
|
|
||
| static int process_passthrough(struct comp_dev *dev) | ||
| { | ||
| int ret; | ||
| struct codec_data *codec = comp_get_codec(dev); | ||
|
|
||
| ret = memcpy_s(codec->cpd.out_buff, codec->cpd.avail, codec->cpd.in_buff, codec->cpd.avail); | ||
| if (ret) { | ||
| comp_err(dev, "process_through() error %d: failed to copy data from in to out", | ||
| ret); | ||
| codec->cpd.produced = 0; | ||
| return ret; | ||
| } | ||
| codec->cpd.produced = codec->cpd.avail; | ||
| return 0; | ||
| } | ||
|
|
||
| int codec_process(struct comp_dev *dev) | ||
| { | ||
| int ret; | ||
|
|
@@ -260,7 +276,12 @@ int codec_process(struct comp_dev *dev) | |
| return -EPERM; | ||
| } | ||
|
|
||
| ret = codec->ops->process(dev); | ||
| // TODO: how to set cd->passthrough flag? | ||
| if (cd->passthrough) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. via topology?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, but we have no example of enum or on/off controls I think is why it's left as a todo
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @juimonen any example so thi scan be added into topology and code here ?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have examples of enums in tdfb, @johnylin76 please us those |
||
| ret = process_passthrough(dev); | ||
| } else { | ||
| ret = codec->ops->process(dev); | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need for curly brackets here. |
||
| if (ret) { | ||
| comp_err(dev, "codec_prepare() error %d: codec process failed for codec_id %x", | ||
| ret, codec_id); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,6 +50,9 @@ define(`W_CODEC_ADAPTER', | |
| ` bytes [' | ||
| $6 | ||
| ` ]' | ||
| ` enum [' | ||
| $7 | ||
| ` ]' | ||
|
|
||
| `}') | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.