mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
audioadapter: handle port flags better
Save the convert and follower port flags and use them in buffer allocation.
This commit is contained in:
parent
1751575fc2
commit
7036fc76e0
1 changed files with 10 additions and 8 deletions
|
|
@ -58,7 +58,7 @@ struct impl {
|
||||||
struct spa_handle *hnd_convert;
|
struct spa_handle *hnd_convert;
|
||||||
struct spa_node *convert;
|
struct spa_node *convert;
|
||||||
struct spa_hook convert_listener;
|
struct spa_hook convert_listener;
|
||||||
uint64_t convert_flags;
|
uint64_t convert_port_flags;
|
||||||
|
|
||||||
uint32_t n_buffers;
|
uint32_t n_buffers;
|
||||||
struct spa_buffer **buffers;
|
struct spa_buffer **buffers;
|
||||||
|
|
@ -437,8 +437,8 @@ static int negotiate_buffers(struct impl *this)
|
||||||
|
|
||||||
spa_pod_fixate(param);
|
spa_pod_fixate(param);
|
||||||
|
|
||||||
follower_flags = this->follower_flags;
|
follower_flags = this->follower_port_flags;
|
||||||
conv_flags = this->convert_flags;
|
conv_flags = this->convert_port_flags;
|
||||||
|
|
||||||
follower_alloc = SPA_FLAG_IS_SET(follower_flags, SPA_PORT_FLAG_CAN_ALLOC_BUFFERS);
|
follower_alloc = SPA_FLAG_IS_SET(follower_flags, SPA_PORT_FLAG_CAN_ALLOC_BUFFERS);
|
||||||
conv_alloc = SPA_FLAG_IS_SET(conv_flags, SPA_PORT_FLAG_CAN_ALLOC_BUFFERS);
|
conv_alloc = SPA_FLAG_IS_SET(conv_flags, SPA_PORT_FLAG_CAN_ALLOC_BUFFERS);
|
||||||
|
|
@ -1092,6 +1092,8 @@ static void follower_convert_port_info(void *data,
|
||||||
this->direction == SPA_DIRECTION_INPUT ?
|
this->direction == SPA_DIRECTION_INPUT ?
|
||||||
"Input" : "Output", info, info->change_mask);
|
"Input" : "Output", info, info->change_mask);
|
||||||
|
|
||||||
|
this->convert_port_flags = info->flags;
|
||||||
|
|
||||||
if (info->change_mask & SPA_PORT_CHANGE_MASK_PARAMS) {
|
if (info->change_mask & SPA_PORT_CHANGE_MASK_PARAMS) {
|
||||||
for (i = 0; i < info->n_params; i++) {
|
for (i = 0; i < info->n_params; i++) {
|
||||||
uint32_t idx;
|
uint32_t idx;
|
||||||
|
|
@ -1152,7 +1154,10 @@ static void convert_port_info(void *data,
|
||||||
port_id--;
|
port_id--;
|
||||||
} else if (info) {
|
} else if (info) {
|
||||||
pi = *info;
|
pi = *info;
|
||||||
pi.flags = this->follower_port_flags;
|
pi.flags = this->follower_port_flags &
|
||||||
|
(SPA_PORT_FLAG_LIVE |
|
||||||
|
SPA_PORT_FLAG_PHYSICAL |
|
||||||
|
SPA_PORT_FLAG_TERMINAL);
|
||||||
info = π
|
info = π
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1273,10 +1278,7 @@ static void follower_port_info(void *data,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->follower_port_flags = info->flags &
|
this->follower_port_flags = info->flags;
|
||||||
(SPA_PORT_FLAG_LIVE |
|
|
||||||
SPA_PORT_FLAG_PHYSICAL |
|
|
||||||
SPA_PORT_FLAG_TERMINAL);
|
|
||||||
|
|
||||||
spa_log_debug(this->log, "%p: follower port info %s %p %08"PRIx64" recalc:%u", this,
|
spa_log_debug(this->log, "%p: follower port info %s %p %08"PRIx64" recalc:%u", this,
|
||||||
this->direction == SPA_DIRECTION_INPUT ?
|
this->direction == SPA_DIRECTION_INPUT ?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue