Commit graph

2117 commits

Author SHA1 Message Date
Wim Taymans
7a05a35f8e v4l2: don't error when we finish the enumeration 2019-03-11 20:59:43 +01:00
Wim Taymans
25292e5078 pulse: update submodule 2019-03-11 18:06:24 +01:00
Wim Taymans
d3d7b7e39f client-node: ignore io on the node itself
We only handle the io on the mixer ports, the internal io from the
port to the node is done on the client side.
2019-03-11 16:43:43 +01:00
Wim Taymans
61ad5ee518 fix some small memory leaks 2019-03-11 15:50:52 +01:00
Wim Taymans
4faa28fd96 gst: handle clock reset
The clock time is reset to 0 after a new format is negotiated. Make sure
the time reported by the gstreamer clock is increasing in this case.
2019-03-11 15:09:28 +01:00
Wim Taymans
8591d85710 node: remove our listener on the node in destroy 2019-03-11 12:36:26 +01:00
Wim Taymans
3281737199 link: keep per link buffer negotiation state
Keep buffers cached on output ports.
Complete the link to PAUSED when we have negotiated buffers on
input and output.
2019-03-11 12:35:04 +01:00
Wim Taymans
317493a2dc stream: also recycle buffers 2019-03-08 17:16:44 +01:00
Wim Taymans
fd373ce4d2 submodule update 2019-03-08 17:02:06 +01:00
Wim Taymans
6c643a0ad0 link: first set all buffers, then complete the state 2019-03-08 15:45:23 +01:00
Wim Taymans
45c00ebb54 node: recalc quantum of the driver when a node is destroyed 2019-03-08 11:55:52 +01:00
Wim Taymans
3e359646d7 client-stream: first destroy the node
When the client-stream is destroyed, let us first destroy the node
of the stream and then the internal client-node.
2019-03-08 11:55:01 +01:00
Wim Taymans
7cdc13b281 node: improve driver changes
Reimplement driver changes without corrupting our lists.

Keep track of unfinished graph and dump state of nodes.
2019-03-08 11:37:52 +01:00
Wim Taymans
964be84e1c list: check for empty list before insert
We can't insert an empty list.
2019-03-08 11:34:28 +01:00
Wim Taymans
47fc2020c0 link: select io right after mix init 2019-03-07 23:19:40 +01:00
Wim Taymans
1d3ce5a9d9 stream: prepare output before signaling ready
Just prepare the output on the port and signal ready. When the graph
completes we will be signaled again to recycle the buffer and
prepare more output if we can.

Improve the bookkeeping a little when activating nodes.

Fix race with moving nodes between drivers.
2019-03-07 23:01:32 +01:00
Wim Taymans
94ce6d528c client-stream: handle driver
When we have a client driver node, it will have prepared the io
areas for us before sending the ready signal. We then need to run
the converters before signaling ready.
2019-03-07 18:37:12 +01:00
Wim Taymans
ae3178abfe node: the exported node and never finish the graph
That graph is always started and finished on the server, even when
the driver is remote.
2019-03-07 18:36:23 +01:00
Wim Taymans
264383cdd4 remote-node: first run the tee and then signal ready
We first need to run the tee so that all the io areas are ready before
we can start the driver on the daemon.
2019-03-07 18:34:39 +01:00
Wim Taymans
e31f1fcdca remote-node: handle add/remove of activation 2019-03-07 18:34:15 +01:00
Wim Taymans
84bb897886 stream: first prepare output io, then call the ready callback
It is assumed that the output io area is ready when the ready
callback is called so that the next elements in the graph can be
triggered immediately. When the graph finishes, the node that
triggered the ready (the driver) is scheduled to recycle and complete
the graph.
2019-03-07 18:31:37 +01:00
Wim Taymans
b357b7a7da scheduling: don't use the graph helpers.
Simplify the scheduling by using simple lists and removing the
subgraphs etc..

Make the driver node trigger all nodes it manages and when they
complete, trigger the driver node to finish the graph.
2019-03-06 20:33:55 +01:00
Wim Taymans
f0eb59bc75 port: allocate only from output ports
We don't need to use the mix_id to allocate, the allocation is
always shared between all output mixer ports
2019-03-06 10:30:27 +01:00
Wim Taymans
dcbe94c55a port: simplify states
Remove the mix states, we can get rid of them when:

The format is the same for all mixer ports. Set the existing
format on new mixer ports. When the first format is set, the port
becomes READY. When all mixer ports are cleared the port goes back
to CONFIGURE.

Only output ports allocate and manage buffers, input ports share
the buffers of the peer output port on the link.
2019-03-06 09:53:41 +01:00
Wim Taymans
412c7f4cee client-node: send own activation to client for stats 2019-03-06 09:52:40 +01:00
Wim Taymans
5ee287d79b client-node: improve cleanup 2019-03-06 09:52:07 +01:00
Wim Taymans
3777d9612e v4l2: only emit port info once 2019-03-06 09:43:24 +01:00
Wim Taymans
1d907412e5 stream: keep track of param ids and emit changes 2019-03-04 17:56:02 +01:00
Wim Taymans
936dcbea2e remote-node: handle driver nodes 2019-03-04 17:55:43 +01:00
Wim Taymans
f42e214c2d client-node: also send param idss 2019-03-04 17:54:17 +01:00
Wim Taymans
7281a2b2cf export-sink: update port params 2019-03-04 15:17:46 +01:00
Wim Taymans
b238c8c2f6 node: first reset graph, then run nodes 2019-03-04 13:34:36 +01:00
Wim Taymans
582bc70b3c device: use right method 2019-03-04 13:33:57 +01:00
Wim Taymans
ed988788fd client-node: pass spa_node_info along
Pass the complete spa_node_info to update node information. Remove
the redundant max/min port info.
Update the remote node based on port and node update events.
2019-03-04 12:30:45 +01:00
Wim Taymans
a9b58618b2 remote: fix ping event 2019-03-01 15:04:45 +01:00
Wim Taymans
236d346a3f global: remove unused event 2019-03-01 15:03:57 +01:00
Wim Taymans
09c4683ef1 interfaces: make events return void
Events are dispatched with hooks and have no return value.

Make it possible to get the last resource and proxy sender value
for where we need it.
2019-03-01 14:04:05 +01:00
Wim Taymans
0390969228 node: make add_listener method
Make struct spa_node_events for events emited from the main thread
and keep the spa_node_callbacks for the data thread callbacks.

The add_listener method installs the events and it's possible to
install multiple handles. Adding a listener first emits the info
and port_info events when installed, similar to how the PipeWire
proxy bind works.

This removes the need for the spa_pending_queue and makes it easier
to implement the _sync versions.

Add some helpers to make it easier for plugins to emit all the info
to new listeners.

Use the listeners for devices as well.
2019-03-01 12:00:42 +01:00
Wim Taymans
61ce4e77f6 type-info: add missing type for EnumProfile 2019-03-01 11:50:59 +01:00
Wim Taymans
499dd3ff22 node: add port and node params
Add a new struct spa_param_info that lists the available params on
a node/port and if they are readable/writable/updated. We can use
this to replace and improve the PARAM_List and also to notify
property change and updates.

Update elements and code to deal with this new param stuff. Add
port and node info to most elements and signal changes.

Use async enum_params in -inspect and use the param info to know
which ones to enumerate.

Use the port info to know what parameters to update in the
remote-node.
2019-02-27 16:43:01 +01:00
Wim Taymans
3d25adc598 monitor: add missing file 2019-02-25 20:26:13 +01:00
Wim Taymans
aab2b5594f utils: don't remove pending after first callback
Let the caller remove the pending result when finished.
Use non _sync verions to enum_params in node/port/device.
Set result.id in alsa and v4l2 correctly.
2019-02-25 20:19:33 +01:00
Wim Taymans
245a0d5634 global: pass bind function to _new
Make the bind function a callback instead of an event. We can then
get a return value and use that to clean up the pending proxy and
generate an error.
2019-02-25 17:16:40 +01:00
Wim Taymans
f2ff6f393b more async improvements
Make the sequence number an int.

Keep track of the last received seq number and pass it in error
replies.

Pass seq in for_each methods.
2019-02-25 16:25:27 +01:00
Wim Taymans
d2c18c7b1a Improve async handling
Don't use special callback in node to receive the results. Instead,
use a generic result callback to receive the result. This makes things
a bit more symetric and generic again because then you can choose how
to match the result to the request and you have a generic way to handle
both the sync and async case. We can then also remove the wait method.
This also makes the remote interface and spa interface to objects very
similar.

Make a helper object to receive and dispatch results. Use this in the
helper for enum_params.

Make device use the same result callbacks.
2019-02-25 12:29:57 +01:00
Wim Taymans
98463b689b node: improve pending results
Make a special function for pending results to make it clear that it
is different from normal results. Don't pass result code to result
function, it is not useful because since the callback is called, all
must be fine.

The spa_pending is removed from the list right before the callback
and can thus be freed in the callback. Pass the spa_pending in
the pending callback so that extra data can be added that way.

Reuse spa_pending objects in link and nodes instead of allocating. We
always only have one pending operation and we can cancel any pending
previous operation by removing the pending.
2019-02-21 12:14:25 +01:00
Wim Taymans
a3ca2df0fe link: handle the right port in the callback 2019-02-21 10:30:40 +01:00
Wim Taymans
7b12212eeb node: improve async handling
Remove the done and error callbacks. The error callback is in an
error message. The done callback is replace with spa_pending.

Make enum_params take a callback and data for the results. This allows
us to push the results one after another to the app and avoids ownership
issues of the passed data. We can then extend this to handle the async
case by doing a _wait call with a spa_pending+callback+data that will
be called when the _enum_params returns and async result.
Add a sync method.

All methods can now return SPA_RESULT_IS_ASYNC return values and you
can use spa_node_wait() to register a callback when they complete
with optional extra parameters. This makes it easier to sync and
handle the reply.

Make helper methods to simulate the sync enum_params behaviour for
sync nodes.

Let the transport generate the sequence number for pw_resource_sync()
and pw_proxy_sync(). That way we don't need to keep track of numbers
ourselves and we can match the reply to the request easily.
2019-02-21 09:40:12 +01:00
Wim Taymans
b743518f78 node: add props to add_port 2019-02-18 13:22:46 +01:00
Wim Taymans
eea062ee53 interfaces: improve remote API
Add return values to events and method callbacks. This makes it
possible to pass any error or async return value.
Add sync/done/error in both directions so that both proxy and resource
and perform/reply sync and produce errors.
Return a SPA_ASYNC from remote method calls (and events), keep the
sequence number in the connection.
With the core sync/done we can remove the client-node done method and
it's internal sequence number along with the seq number in method calls.
We can also use the method/event async return value to perform a sync
with as the unique sequence number for this method.
Add sync method and done/error event to proxy and resource.
2019-02-18 12:31:36 +01:00