mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
Add port direction again
simplify port numbering again by using 0->max_ports for bot input ports and output ports. This means we need to tall what direction the port is. Add port_info serialize functions Copy metadata and data when we are not sharing buffers. Make pinossink work again.
This commit is contained in:
parent
b208e8b690
commit
d828073bb8
26 changed files with 1104 additions and 648 deletions
|
|
@ -223,7 +223,7 @@ negotiate_formats (AppData *data)
|
|||
SpaPropValue value;
|
||||
void *state = NULL;
|
||||
|
||||
if ((res = spa_node_port_enum_formats (data->sink, 0, &format, NULL, &state)) < 0)
|
||||
if ((res = spa_node_port_enum_formats (data->sink, SPA_DIRECTION_INPUT, 0, &format, NULL, &state)) < 0)
|
||||
return res;
|
||||
|
||||
props = &format->props;
|
||||
|
|
@ -244,30 +244,30 @@ negotiate_formats (AppData *data)
|
|||
if ((res = spa_props_set_value (props, spa_props_index_for_id (props, SPA_PROP_ID_AUDIO_CHANNELS), &value)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_set_format (data->sink, 0, false, format)) < 0)
|
||||
if ((res = spa_node_port_set_format (data->sink, SPA_DIRECTION_INPUT, 0, false, format)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_set_format (data->mix, 128, false, format)) < 0)
|
||||
if ((res = spa_node_port_set_format (data->mix, SPA_DIRECTION_OUTPUT, 0, false, format)) < 0)
|
||||
return res;
|
||||
|
||||
data->mix_ports[0] = 0;
|
||||
if ((res = spa_node_add_port (data->mix, 0)) < 0)
|
||||
if ((res = spa_node_add_port (data->mix, SPA_DIRECTION_INPUT, 0)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_set_format (data->mix, data->mix_ports[0], false, format)) < 0)
|
||||
if ((res = spa_node_port_set_format (data->mix, SPA_DIRECTION_INPUT, data->mix_ports[0], false, format)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_set_format (data->source1, 0, false, format)) < 0)
|
||||
if ((res = spa_node_port_set_format (data->source1, SPA_DIRECTION_OUTPUT, 0, false, format)) < 0)
|
||||
return res;
|
||||
|
||||
data->mix_ports[1] = 1;
|
||||
if ((res = spa_node_add_port (data->mix, 1)) < 0)
|
||||
if ((res = spa_node_add_port (data->mix, SPA_DIRECTION_INPUT, 1)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_set_format (data->mix, data->mix_ports[1], false, format)) < 0)
|
||||
if ((res = spa_node_port_set_format (data->mix, SPA_DIRECTION_INPUT, data->mix_ports[1], false, format)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_set_format (data->source2, 0, false, format)) < 0)
|
||||
if ((res = spa_node_port_set_format (data->source2, SPA_DIRECTION_OUTPUT, 0, false, format)) < 0)
|
||||
return res;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ alloc_buffers (AppData *data)
|
|||
}
|
||||
data->n_buffers = MAX_BUFFERS;
|
||||
|
||||
spa_node_port_use_buffers (data->source, 0, data->bp, MAX_BUFFERS);
|
||||
spa_node_port_use_buffers (data->source, SPA_DIRECTION_OUTPUT, 0, data->bp, MAX_BUFFERS);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -320,10 +320,10 @@ negotiate_formats (AppData *data)
|
|||
f.framerate.denom = 1;
|
||||
#endif
|
||||
|
||||
if ((res = spa_node_port_set_format (data->source, 0, false, &f.fmt)) < 0)
|
||||
if ((res = spa_node_port_set_format (data->source, SPA_DIRECTION_OUTPUT, 0, false, &f.fmt)) < 0)
|
||||
return res;
|
||||
|
||||
if ((res = spa_node_port_get_info (data->source, 0, &info)) < 0)
|
||||
if ((res = spa_node_port_get_info (data->source, SPA_DIRECTION_OUTPUT, 0, &info)) < 0)
|
||||
return res;
|
||||
|
||||
spa_debug_port_info (info);
|
||||
|
|
@ -342,7 +342,7 @@ negotiate_formats (AppData *data)
|
|||
return -1;
|
||||
}
|
||||
n_buffers = MAX_BUFFERS;
|
||||
if ((res = spa_node_port_alloc_buffers (data->source, 0, NULL, 0, data->bp, &n_buffers)) < 0) {
|
||||
if ((res = spa_node_port_alloc_buffers (data->source, SPA_DIRECTION_OUTPUT, 0, NULL, 0, data->bp, &n_buffers)) < 0) {
|
||||
printf ("can't allocate buffers: %s\n", SDL_GetError ());
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue