mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-06-13 14:33:03 -04:00
port-config: add internalFormat to PortConfig
Use the Format for all possible formats on the EnumPortConfig and the configured external format on PortConfig. Make a new internalFormat that contains the configured format of the adapter follower. Make pw-top use the PortConfig internalFormat in the FORMAT view and fall back to Format, when not available (for older clients).
This commit is contained in:
parent
d780f4f535
commit
b5555cc3f6
5 changed files with 23 additions and 10 deletions
|
|
@ -173,16 +173,20 @@ static int convert_enum_port_config(struct impl *this,
|
|||
{
|
||||
struct spa_pod *f1, *f2 = NULL, *format = NULL;
|
||||
struct spa_pod_frame f[1];
|
||||
uint32_t fmt_id, fmt_start = 0;
|
||||
uint32_t fmt_id, fmt_start = 0, pc_id;
|
||||
int res;
|
||||
|
||||
if (this->convert == NULL)
|
||||
return 0;
|
||||
|
||||
if (id == SPA_PARAM_EnumPortConfig)
|
||||
if (id == SPA_PARAM_EnumPortConfig) {
|
||||
fmt_id = SPA_PARAM_EnumFormat;
|
||||
else
|
||||
pc_id = SPA_PARAM_PORT_CONFIG_format;
|
||||
}
|
||||
else {
|
||||
fmt_id = SPA_PARAM_Format;
|
||||
pc_id = SPA_PARAM_PORT_CONFIG_internalFormat;
|
||||
}
|
||||
|
||||
res = spa_node_port_enum_params_sync(this->follower,
|
||||
this->direction, 0,
|
||||
|
|
@ -195,7 +199,7 @@ static int convert_enum_port_config(struct impl *this,
|
|||
0);
|
||||
if (res > 0) {
|
||||
spa_pod_builder_add(builder,
|
||||
SPA_PARAM_PORT_CONFIG_format, SPA_POD_Pod(format),
|
||||
pc_id, SPA_POD_Pod(format),
|
||||
0);
|
||||
}
|
||||
f1 = spa_pod_builder_pop(builder, &f[0]);
|
||||
|
|
@ -253,7 +257,8 @@ next:
|
|||
SPA_PARAM_PORT_CONFIG_direction, SPA_POD_Id(this->direction),
|
||||
SPA_PARAM_PORT_CONFIG_mode, SPA_POD_Id(
|
||||
SPA_PARAM_PORT_CONFIG_MODE_passthrough),
|
||||
SPA_PARAM_PORT_CONFIG_format, SPA_POD_Pod(format));
|
||||
SPA_PARAM_PORT_CONFIG_format, SPA_POD_Pod(format),
|
||||
SPA_PARAM_PORT_CONFIG_internalFormat, SPA_POD_Pod(format));
|
||||
result.next++;
|
||||
res = 1;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue