Lines Matching +full:- +full:- +full:config

2  * SPDX-License-Identifier: BSD-2-Clause
41 to_channels(struct config *config, void *output) in to_channels() argument
43 uint8_t *in = config->buf; in to_channels()
48 for (byte = 0; byte < config->buffer_info.bytes; in to_channels()
49 byte += config->sample_size) { in to_channels()
54 i = byte / config->sample_size; in to_channels()
57 channel = i % config->audio_info.max_channels; in to_channels()
60 offset = i / config->audio_info.max_channels; in to_channels()
63 index = (channel * config->chsamples + offset) * in to_channels()
64 config->sample_size; in to_channels()
67 memcpy(out+index, in+byte, config->sample_size); in to_channels()
75 to_interleaved(struct config *config, void *input) in to_interleaved() argument
77 uint8_t *out = config->buf; in to_interleaved()
82 for (byte = 0; byte < config->buffer_info.bytes; in to_interleaved()
83 byte += config->sample_size) { in to_interleaved()
88 index = byte / config->sample_size; in to_interleaved()
91 channel = index / config->chsamples; in to_interleaved()
94 offset = index % config->chsamples; in to_interleaved()
97 i = (config->audio_info.max_channels * offset + channel) * in to_interleaved()
98 config->sample_size; in to_interleaved()
101 memcpy(out+i, in+byte, config->sample_size); in to_interleaved()
108 struct config config = { in main() local
117 oss_init(&config); in main()
118 bytes = config.buffer_info.bytes; in main()
122 if ((rc = read(config.fd, config.buf, bytes)) < bytes) { in main()
128 * using config->buf, but this example tries to show the real in main()
134 to_channels(&config, channels); in main()
135 to_interleaved(&config, channels); in main()
136 if ((rc = write(config.fd, config.buf, bytes)) < bytes) { in main()
143 free(config.buf); in main()
144 close(config.fd); in main()