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

util/stream: Add pumping functions #3233

Merged
merged 2 commits into from
Jun 10, 2024
Merged

Conversation

kasjer
Copy link
Contributor

@kasjer kasjer commented May 24, 2024

This extends in_stream and out_stream to provide pumping
functions

Additionally stream_pump() function is added to allow easy
pumping data between streams.

Signed-off-by: Jerzy Kasenberg [email protected]

}
sample_count = count / i2s->sample_size_in_bytes;

while (count) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks bit odd since count is never modified inside loop

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loop was not needed and now is removed it could be replaced with if

/* Both stream don't provide pump functions, use local buffer for pumping data */
uint8_t buf[16];
pumped = 0;
while (count) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

This extends in_stream and out_stream to provide pumping
functions

Additionally stream_pump() function is added to allow easy
pumping data between streams.

Signed-off-by: Jerzy Kasenberg <[email protected]>
Code provides wrapper to use i2s with streaming API

Signed-off-by: Jerzy Kasenberg <[email protected]>
@kasjer kasjer merged commit d0e9954 into apache:master Jun 10, 2024
17 checks passed
@kasjer kasjer deleted the kasjer/stream-pump branch June 10, 2024 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants