Lines Matching defs:config
21 #include <config.h>
157 static void set_info_and_sample_spec_from_sbc_config(struct sbc_info *sbc_info, pa_sample_spec *sample_spec, const a2dp_sbc_t *config) {
158 switch (config->frequency) {
179 switch (config->channel_mode) {
200 switch (config->allocation_method) {
211 switch (config->subbands) {
224 switch (config->block_length) {
245 sbc_info->min_bitpool = config->min_bitpool;
246 sbc_info->max_bitpool = config->max_bitpool;
262 static uint8_t sbc_get_max_bitpool_below_rate(a2dp_sbc_t *config, uint8_t lower_bound, uint8_t upper_bound, uint32_t bitrate_cap) {
267 pa_assert(config);
275 set_info_and_sample_spec_from_sbc_config(&sbc_info, &sample_spec, config);
330 const a2dp_sbc_t *config = (const a2dp_sbc_t *) config_buffer;
332 if (config_size != sizeof(*config)) {
333 pa_log_error("Invalid size of config buffer");
337 if (config->frequency != SBC_SAMPLING_FREQ_16000 && config->frequency != SBC_SAMPLING_FREQ_32000 &&
338 config->frequency != SBC_SAMPLING_FREQ_44100 && config->frequency != SBC_SAMPLING_FREQ_48000) {
343 if (config->channel_mode != SBC_CHANNEL_MODE_MONO && config->channel_mode != SBC_CHANNEL_MODE_DUAL_CHANNEL &&
344 config->channel_mode != SBC_CHANNEL_MODE_STEREO && config->channel_mode != SBC_CHANNEL_MODE_JOINT_STEREO) {
349 if (config->allocation_method != SBC_ALLOCATION_SNR && config->allocation_method != SBC_ALLOCATION_LOUDNESS) {
354 if (config->subbands != SBC_SUBBANDS_4 && config->subbands != SBC_SUBBANDS_8) {
359 if (config->block_length != SBC_BLOCK_LENGTH_4 && config->block_length != SBC_BLOCK_LENGTH_8 &&
360 config->block_length != SBC_BLOCK_LENGTH_12 && config->block_length != SBC_BLOCK_LENGTH_16) {
365 if (config->min_bitpool > config->max_bitpool) {
416 a2dp_sbc_t *config = (a2dp_sbc_t *) config_buffer;
435 pa_zero(*config);
440 config->frequency = freq_table[i].cap;
447 config->frequency = freq_table[i].cap;
462 config->channel_mode = SBC_CHANNEL_MODE_MONO;
464 config->channel_mode = SBC_CHANNEL_MODE_JOINT_STEREO;
466 config->channel_mode = SBC_CHANNEL_MODE_STEREO;
468 config->channel_mode = SBC_CHANNEL_MODE_DUAL_CHANNEL;
475 config->channel_mode = SBC_CHANNEL_MODE_JOINT_STEREO;
477 config->channel_mode = SBC_CHANNEL_MODE_STEREO;
479 config->channel_mode = SBC_CHANNEL_MODE_DUAL_CHANNEL;
481 config->channel_mode = SBC_CHANNEL_MODE_MONO;
489 config->block_length = SBC_BLOCK_LENGTH_16;
491 config->block_length = SBC_BLOCK_LENGTH_12;
493 config->block_length = SBC_BLOCK_LENGTH_8;
495 config->block_length = SBC_BLOCK_LENGTH_4;
502 config->subbands = SBC_SUBBANDS_8;
504 config->subbands = SBC_SUBBANDS_4;
511 config->allocation_method = SBC_ALLOCATION_LOUDNESS;
513 config->allocation_method = SBC_ALLOCATION_SNR;
519 config->min_bitpool = (uint8_t) PA_MAX(SBC_MIN_BITPOOL, capabilities->min_bitpool);
520 config->max_bitpool = (uint8_t) PA_MIN(default_bitpool(config->frequency, config->channel_mode), capabilities->max_bitpool);
522 if (config->min_bitpool > config->max_bitpool) {
527 return sizeof(*config);
531 a2dp_sbc_t *config = (a2dp_sbc_t *) config_buffer;
550 pa_zero(*config);
555 config->frequency = freq_table[i].cap;
562 config->frequency = freq_table[i].cap;
577 config->channel_mode = SBC_CHANNEL_MODE_DUAL_CHANNEL;
584 config->channel_mode = SBC_CHANNEL_MODE_DUAL_CHANNEL;
592 config->block_length = SBC_BLOCK_LENGTH_16;
599 config->subbands = SBC_SUBBANDS_8;
606 config->allocation_method = SBC_ALLOCATION_LOUDNESS;
612 config->min_bitpool = (uint8_t) PA_MAX(SBC_MIN_BITPOOL, capabilities->min_bitpool);
613 config->max_bitpool = sbc_get_max_bitpool_below_rate(config, config->min_bitpool, capabilities->max_bitpool, bitrate_cap);
615 if (config->min_bitpool > config->max_bitpool) {
620 return sizeof(*config);
649 const a2dp_sbc_t *config = (const a2dp_sbc_t *) config_buffer;
652 pa_assert(config_size == sizeof(*config));
666 set_info_and_sample_spec_from_sbc_config(sbc_info, sample_spec, config);