mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
Work on sink
Remove _remove from properties, we can do the same with set of a NULL value. Add signals to the stream API to manage the buffers. Wrap those buffers in a GstBuffer in the pinossrc and pinossink elements and pool them in a bufferpool. Remove SPA_EVENT_TYPE_PULL_INPUT, we can do the same with NEED_INPUT and by using a ringbuffer. Do more complete allocation of buffers in the link. Use the buffer allocator if none of the nodes can allocate. Follow the node state to trigger negotiation and allocation. Remove offset and size when refering to buffers, we want to always deal with the complete buffer and use a ringbuffer for ranges or change the offset/size in the buffer data when needed. Serialize port_info structures as part of the port_update Print both the enum number and the name when debuging properties or formats.
This commit is contained in:
parent
a03352353f
commit
ca7d08c406
45 changed files with 1614 additions and 570 deletions
|
|
@ -180,8 +180,6 @@ on_received_buffer (PinosPort *port, uint32_t buffer_id, GError **error, gpointe
|
|||
info[0].port_id = port->id;
|
||||
info[0].buffer_id = buffer_id;
|
||||
info[0].flags = SPA_INPUT_FLAG_NONE;
|
||||
info[0].offset = 0;
|
||||
info[0].size = -1;
|
||||
|
||||
if ((res = spa_node_port_push_input (node->node, 1, info)) < 0)
|
||||
g_warning ("client-node %p: error pushing buffer: %d, %d", node, res, info[0].status);
|
||||
|
|
@ -296,6 +294,8 @@ on_node_event (SpaNode *node, SpaEvent *event, void *user_data)
|
|||
{
|
||||
SpaEventStateChange *sc = event->data;
|
||||
|
||||
pinos_node_update_node_state (PINOS_NODE (this), sc->state);
|
||||
|
||||
switch (sc->state) {
|
||||
case SPA_NODE_STATE_CONFIGURE:
|
||||
{
|
||||
|
|
@ -329,6 +329,24 @@ on_node_event (SpaNode *node, SpaEvent *event, void *user_data)
|
|||
stop_thread (this);
|
||||
break;
|
||||
}
|
||||
case SPA_EVENT_TYPE_HAVE_OUTPUT:
|
||||
{
|
||||
PinosPort *port;
|
||||
SpaOutputInfo info[1] = { 0, };
|
||||
SpaResult res;
|
||||
GError *error = NULL;
|
||||
|
||||
if ((res = spa_node_port_pull_output (node, 1, info)) < 0)
|
||||
g_debug ("client-node %p: got pull error %d, %d", this, res, info[0].status);
|
||||
|
||||
port = pinos_node_find_port (PINOS_NODE (this), info[0].port_id);
|
||||
|
||||
if (!pinos_port_send_buffer (port, info[0].buffer_id, &error)) {
|
||||
g_debug ("send failed: %s", error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPA_EVENT_TYPE_REUSE_BUFFER:
|
||||
{
|
||||
PinosPort *port;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue