Lines Matching full:config

42 to_channels(struct config *config, void *output)  in to_channels()  argument
44 uint8_t *in = config->buf; in to_channels()
49 for (byte = 0; byte < config->buffer_info.bytes; in to_channels()
50 byte += config->sample_size) { in to_channels()
55 i = byte / config->sample_size; in to_channels()
58 channel = i % config->audio_info.max_channels; in to_channels()
61 offset = i / config->audio_info.max_channels; in to_channels()
64 index = (channel * config->chsamples + offset) * in to_channels()
65 config->sample_size; in to_channels()
68 memcpy(out+index, in+byte, config->sample_size); in to_channels()
76 to_interleaved(struct config *config, void *input) in to_interleaved() argument
78 uint8_t *out = config->buf; in to_interleaved()
83 for (byte = 0; byte < config->buffer_info.bytes; in to_interleaved()
84 byte += config->sample_size) { in to_interleaved()
89 index = byte / config->sample_size; in to_interleaved()
92 channel = index / config->chsamples; in to_interleaved()
95 offset = index % config->chsamples; in to_interleaved()
98 i = (config->audio_info.max_channels * offset + channel) * in to_interleaved()
99 config->sample_size; in to_interleaved()
102 memcpy(out+i, in+byte, config->sample_size); in to_interleaved()
109 struct config config = { in main() local
118 oss_init(&config); in main()
119 if (config.format != AFMT_S32_NE) in main()
122 bytes = config.buffer_info.bytes; in main()
126 if ((rc = read(config.fd, config.buf, bytes)) < bytes) { in main()
132 * using config->buf, but this example tries to show the real in main()
138 to_channels(&config, channels); in main()
139 to_interleaved(&config, channels); in main()
140 if ((rc = write(config.fd, config.buf, bytes)) < bytes) { in main()
147 free(config.buf); in main()
148 close(config.fd); in main()