mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
audioconvert: don't forward node results
Don't just always forward node results but use port_enum_param_sync. Avoids duplicate param results in pw-dump for ports.
This commit is contained in:
parent
94dd797aa5
commit
7b9321dea9
1 changed files with 7 additions and 19 deletions
|
|
@ -614,13 +614,6 @@ static int impl_node_set_io(void *object, uint32_t id, void *data, size_t size)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void on_node_result(void *data, int seq, int res, uint32_t type, const void *result)
|
|
||||||
{
|
|
||||||
struct impl *this = data;
|
|
||||||
spa_log_trace(this->log, "%p: result %d %d", this, seq, res);
|
|
||||||
spa_node_emit_result(&this->hooks, seq, res, type, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void fmt_input_port_info(void *data,
|
static void fmt_input_port_info(void *data,
|
||||||
enum spa_direction direction, uint32_t port,
|
enum spa_direction direction, uint32_t port,
|
||||||
const struct spa_port_info *info)
|
const struct spa_port_info *info)
|
||||||
|
|
@ -642,7 +635,6 @@ static void fmt_input_port_info(void *data,
|
||||||
static const struct spa_node_events fmt_input_events = {
|
static const struct spa_node_events fmt_input_events = {
|
||||||
SPA_VERSION_NODE_EVENTS,
|
SPA_VERSION_NODE_EVENTS,
|
||||||
.port_info = fmt_input_port_info,
|
.port_info = fmt_input_port_info,
|
||||||
.result = on_node_result,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void fmt_output_port_info(void *data,
|
static void fmt_output_port_info(void *data,
|
||||||
|
|
@ -663,7 +655,6 @@ static void fmt_output_port_info(void *data,
|
||||||
static const struct spa_node_events fmt_output_events = {
|
static const struct spa_node_events fmt_output_events = {
|
||||||
SPA_VERSION_NODE_EVENTS,
|
SPA_VERSION_NODE_EVENTS,
|
||||||
.port_info = fmt_output_port_info,
|
.port_info = fmt_output_port_info,
|
||||||
.result = on_node_result,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void on_channelmix_info(void *data, const struct spa_node_info *info)
|
static void on_channelmix_info(void *data, const struct spa_node_info *info)
|
||||||
|
|
@ -706,12 +697,6 @@ static void on_channelmix_info(void *data, const struct spa_node_info *info)
|
||||||
static const struct spa_node_events channelmix_events = {
|
static const struct spa_node_events channelmix_events = {
|
||||||
SPA_VERSION_NODE_EVENTS,
|
SPA_VERSION_NODE_EVENTS,
|
||||||
.info = on_channelmix_info,
|
.info = on_channelmix_info,
|
||||||
.result = on_node_result,
|
|
||||||
};
|
|
||||||
|
|
||||||
static const struct spa_node_events proxy_events = {
|
|
||||||
SPA_VERSION_NODE_EVENTS,
|
|
||||||
.result = on_node_result,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int reconfigure_mode(struct impl *this, enum spa_param_port_config_mode mode,
|
static int reconfigure_mode(struct impl *this, enum spa_param_port_config_mode mode,
|
||||||
|
|
@ -1020,6 +1005,7 @@ impl_node_port_enum_params(void *object, int seq,
|
||||||
uint8_t buffer[4096];
|
uint8_t buffer[4096];
|
||||||
struct spa_result_node_params result;
|
struct spa_result_node_params result;
|
||||||
uint32_t count = 0;
|
uint32_t count = 0;
|
||||||
|
int res;
|
||||||
|
|
||||||
spa_return_val_if_fail(this != NULL, -EINVAL);
|
spa_return_val_if_fail(this != NULL, -EINVAL);
|
||||||
spa_return_val_if_fail(num != 0, -EINVAL);
|
spa_return_val_if_fail(num != 0, -EINVAL);
|
||||||
|
|
@ -1061,8 +1047,12 @@ impl_node_port_enum_params(void *object, int seq,
|
||||||
else
|
else
|
||||||
target = this->fmt[direction];
|
target = this->fmt[direction];
|
||||||
|
|
||||||
return spa_node_port_enum_params(target, seq, direction, port_id,
|
res = spa_node_port_enum_params_sync(target,
|
||||||
id, start, num, filter);
|
direction, port_id,
|
||||||
|
id, &result.index,
|
||||||
|
NULL, ¶m, &b);
|
||||||
|
if (res != 1)
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1411,8 +1401,6 @@ impl_init(const struct spa_handle_factory *factory,
|
||||||
|
|
||||||
spa_node_add_listener(this->channelmix,
|
spa_node_add_listener(this->channelmix,
|
||||||
&this->listener[0], &channelmix_events, this);
|
&this->listener[0], &channelmix_events, this);
|
||||||
spa_node_add_listener(this->merger,
|
|
||||||
&this->listener[1], &proxy_events, this);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue