mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
parent
59203c11b8
commit
6f519d4052
2 changed files with 14 additions and 2 deletions
|
|
@ -174,6 +174,7 @@ int module_args_to_audioinfo(struct impl *impl, struct pw_properties *props, str
|
||||||
|
|
||||||
/* We don't use any incoming format setting and use our native format */
|
/* We don't use any incoming format setting and use our native format */
|
||||||
spa_zero(*info);
|
spa_zero(*info);
|
||||||
|
info->flags = SPA_AUDIO_FLAG_UNPOSITIONED;
|
||||||
info->format = SPA_AUDIO_FORMAT_F32P;
|
info->format = SPA_AUDIO_FORMAT_F32P;
|
||||||
|
|
||||||
if ((str = pw_properties_get(props, "channels")) != NULL) {
|
if ((str = pw_properties_get(props, "channels")) != NULL) {
|
||||||
|
|
@ -199,6 +200,7 @@ int module_args_to_audioinfo(struct impl *impl, struct pw_properties *props, str
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
channel_map_to_positions(&map, info->position);
|
channel_map_to_positions(&map, info->position);
|
||||||
|
info->flags &= ~SPA_AUDIO_FLAG_UNPOSITIONED;
|
||||||
pw_properties_set(props, "channel_map", NULL);
|
pw_properties_set(props, "channel_map", NULL);
|
||||||
} else {
|
} else {
|
||||||
if (info->channels == 0)
|
if (info->channels == 0)
|
||||||
|
|
@ -216,6 +218,8 @@ int module_args_to_audioinfo(struct impl *impl, struct pw_properties *props, str
|
||||||
for (i = 0; i < info->channels; i++)
|
for (i = 0; i < info->channels; i++)
|
||||||
info->position[i] = SPA_AUDIO_CHANNEL_UNKNOWN;
|
info->position[i] = SPA_AUDIO_CHANNEL_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
if (info->position[0] != SPA_AUDIO_CHANNEL_UNKNOWN)
|
||||||
|
info->flags &= ~SPA_AUDIO_FLAG_UNPOSITIONED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((str = pw_properties_get(props, "rate")) != NULL) {
|
if ((str = pw_properties_get(props, "rate")) != NULL) {
|
||||||
|
|
|
||||||
|
|
@ -63,15 +63,23 @@ static int module_loopback_load(struct client *client, struct module *module)
|
||||||
struct module_loopback_data *data = module->user_data;
|
struct module_loopback_data *data = module->user_data;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
char *args;
|
char *args;
|
||||||
size_t size;
|
size_t size, i;
|
||||||
|
|
||||||
pw_properties_setf(data->capture_props, PW_KEY_NODE_GROUP, "loopback-%u", module->idx);
|
pw_properties_setf(data->capture_props, PW_KEY_NODE_GROUP, "loopback-%u", module->idx);
|
||||||
pw_properties_setf(data->playback_props, PW_KEY_NODE_GROUP, "loopback-%u", module->idx);
|
pw_properties_setf(data->playback_props, PW_KEY_NODE_GROUP, "loopback-%u", module->idx);
|
||||||
|
|
||||||
f = open_memstream(&args, &size);
|
f = open_memstream(&args, &size);
|
||||||
fprintf(f, "{");
|
fprintf(f, "{");
|
||||||
if (data->info.channels != 0)
|
if (data->info.channels != 0) {
|
||||||
fprintf(f, " audio.channels = %u", data->info.channels);
|
fprintf(f, " audio.channels = %u", data->info.channels);
|
||||||
|
if (!(data->info.flags & SPA_AUDIO_FLAG_UNPOSITIONED)) {
|
||||||
|
fprintf(f, " audio.position = [ ");
|
||||||
|
for (i = 0; i < data->info.channels; i++)
|
||||||
|
fprintf(f, "%s%s", i == 0 ? "" : ",",
|
||||||
|
channel_id2name(data->info.position[i]));
|
||||||
|
fprintf(f, " ]");
|
||||||
|
}
|
||||||
|
}
|
||||||
fprintf(f, " capture.props = {");
|
fprintf(f, " capture.props = {");
|
||||||
pw_properties_serialize_dict(f, &data->capture_props->dict, 0);
|
pw_properties_serialize_dict(f, &data->capture_props->dict, 0);
|
||||||
fprintf(f, " } playback.props = {");
|
fprintf(f, " } playback.props = {");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue