Commit graph

105 commits

Author SHA1 Message Date
Wim Taymans
ce6b75cf63 Small cleanups 2017-10-16 18:09:59 +02:00
Wim Taymans
9706c191b9 client-node: don't misuse ASYNC flag
When the client is explicitly going to send reuse_buffer messages,
set the consumed buffer to INVALID so it doesn't automatically get
reused.
ASYNC is for when the node emits events to signal input and output it
has nothing to do with reuse_buffer
Remove weird PROCESS_INPUT code.
2017-10-13 18:12:06 +02:00
David Svensson Fors
28bf6137d3 Support for "client-reuse" streams
Add a PW property "pipewire.client.reuse". If set, the client-node
doesn't immediately reuse a buffer after sending
PW_CLIENT_NODE_MESSAGE_PROCESS_INPUT to the client. Instead, it waits
for reuse-buffer from the client. The SPA_GRAPH_NODE_FLAG_ASYNC is
used for this, together with adapted logic in process_input().

In stream.c, if the property is set, the handling of incoming buffers
for PW_DIRECTION_INPUT streams is changed. Each buffer has to be
recycled, so we make sure new_buffer is emitted for each intermediate
buffer, if buffer_id in the IO area has moved past some buffers.

Change-Id: I137a12b702b857cc73369930d7029ecbd69d63ff
2017-10-13 17:47:29 +02:00
Wim Taymans
d96d40e30a Add set_active method on node
Require that nodes need to be activated before they are scheduled.
Make method to activate remote node.
Add method to pause/resume stream.
2017-10-13 16:18:42 +02:00
Wim Taymans
81e5708442 move type remap to native protocol 2017-09-28 17:01:01 +02:00
Wim Taymans
24d80e5c00 Add new pod parser and builder
Add a new pod builder and parser that is less verbose and
a little more powerful.
2017-09-28 17:00:51 +02:00
Wim Taymans
0d44a34b4c Release 0.1.5 2017-09-19 11:25:38 +02:00
Wim Taymans
3b0eec4bf8 Use PIPEWIRE_DAEMON env var to start a server
Check the PIPEWIRE_DAEMON environment variable and start a server
if it is set.
2017-09-18 21:48:02 +02:00
Wim Taymans
2f6c4544fe Small cleanups and additions 2017-09-18 21:47:44 +02:00
Wim Taymans
93a52f4837 Simplify node activation
Don't directly expose the state change methods. Only expose an activate
method for nodes that indicates if the node should be scheduled or not.
Let the link automatically negotiate two active nodes.
Make some defines for properties.
Use link property to make passive links. Passive links don't activate
the nodes.
Make sure the mainloop quits when quit is called before run.
2017-09-18 20:42:55 +02:00
Wim Taymans
82129a65b9 flatpak: use new way to check for flatpak 2017-09-18 13:25:15 +02:00
Wim Taymans
f64c28c091 Cleanups
Make separate _register function so that we can first configure the
object before making it publicly visible.
2017-09-18 11:54:25 +02:00
Wim Taymans
67d4dd8656 factory: add introspection 2017-09-18 09:35:00 +02:00
Wim Taymans
7f20e04803 node_factory -> factory
Rename the node-factory to a more generic object factory.
Add type and version to create objects from a factory
Start on factory introspection
2017-09-17 16:47:03 +02:00
Wim Taymans
3c1957fd9d remote: make extra nodes for scheduler
Add an extra input and output node for remote nodes. We link this
node to all remote inputs and outputs to make it easier to use
the scheduler.
Improve scheduler debug
2017-09-16 09:20:04 +02:00
Wim Taymans
d9bae8f38b introspect: add id to info again
The global is created first, with the global id in the info, it's
possible to easily link a new object to a global.
2017-09-15 14:57:43 +02:00
Wim Taymans
d26d7a8040 flatpak: fix resource override
Make sure we chain up to the same resource that we override, for this
keep a per resource info that we pass around.
2017-09-15 14:52:17 +02:00
Wim Taymans
2ca25e5bf4 Small cleanups
Improve debug
Fix core info event, pass the copied info around in remote.
2017-09-15 14:47:54 +02:00
Wim Taymans
26e9daf6b7 graph: provide in and out counters
Make it possible to have input and output counters to see when a
node can be scheduled.
2017-09-15 13:37:33 +02:00
Wim Taymans
78ebe2b76e Small cleanups
Use client properties to get the remote name to connect to.
Allow NULL values in properties and make sure they are copied
correctly.
2017-09-11 15:44:03 +02:00
Wim Taymans
dc85a79786 Add more generic export-spa example
Replace the v4l2 example with a more generic version that can add
any spa node to a remote graph
Make the dictionary items const
Add some info to nodes and factories. Add the node info to the node
properties. We can then set the media.class directly on the node,
instead of letting the monitor set it.
Debug node info in spa-inspect.
Do async operation on the audiotestsrc and videotestsrc differently.
2017-09-07 19:55:22 +02:00
Wim Taymans
21cd5a2918 Add example to play sine wave
Various build fixes and cleanups
Move port_add to private and make node ports based on implementation.
Improve pull based scheduling on remote nodes
2017-09-07 10:22:32 +02:00
Wim Taymans
ebea63ad0a client: set ucred properties 2017-09-04 20:25:44 +02:00
Wim Taymans
914fe5c2b7 jack: filter formats
filter jack formats in enum_formats
Fix some crashes and cleanups
2017-09-04 13:18:49 +02:00
PrasannaKumar Muralidharan
f6d480fdfd Fix memory issues reported by clang static analyzer (#7)
* Fix use after free in error path

Memory pointed by 'handle' is used in error path but it is freed before jumping to interface_failed. Remove the wrong free. Memory pointed by 'handle' gets freed in the error handling path.

* Free 'bus' when dbus_bus_get_private fails

If dbus_bus_get_private fails memory pointed by 'bus' is never freed. Free it.

* Free 'impl' if dbus_bus_get_private fails

When dbus_bus_get_private fails the memory pointed by 'impl' is not freed. Free it.
2017-09-04 11:09:45 +02:00
Marcos Paulo de Souza
b0c3936477 Fix clang warnings about comparing uint32 < 0 (#10)
* Fix clang warnings about comparing uint32 < 0

clangs complains about an uint32 compared to < 0:
warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]

So remove these comparisos and an uint32 never will be less than 0.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>

* module-jack.c: Differentiate error msg from protocol-native

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
2017-09-04 11:09:08 +02:00
Wim Taymans
6afcb4981f link: improve introspection 2017-08-27 17:58:25 +02:00
Wim Taymans
174d34ada6 fix a socket leak
Let the loop source free the sockets.
Free the write fd in the stream.
2017-08-27 13:14:34 +02:00
Wim Taymans
577f86be0d graph: use spa_node as implementation
Always use a spa_node as the graph implementation, implementing the
methods is just as easy.
Plug some mem leaks in remote
2017-08-27 12:12:14 +02:00
Wim Taymans
6953642ed5 small cleanups 2017-08-27 09:16:03 +02:00
Wim Taymans
28ae844de9 node: always use a spa_node as the implementation
Avoid duplicating API, remove implementations from port and node and
always use an spa_node as the implementation, it's just as easy to
implement a spa node. With the implementation always being a spa_node
we will be able to better implement the negotiation of the mixers.
2017-08-25 19:02:27 +02:00
Wim Taymans
b7b80683bc jack: work on mixing 2017-08-25 10:01:04 +02:00
Wim Taymans
b7e334e55d Release 0.1.4
Remove spec file
Fix systemd service file
Send error on link errors
Init socket to -1 so that we don't close anything on error
Wait for all proxy objects in device monitor
2017-08-23 13:22:39 +02:00
Wim Taymans
61e7218006 protocol: destroy clients
Destroy clients before destroying the protocol
2017-08-23 10:19:19 +02:00
Wim Taymans
c25834a692 Work on cleanup
Add signal handlers for daemon to shut down
Add destroy listeners for modules and do cleanup
Fix some leaks
Simplify port registration in new nodes
Hide some more data structures
Let the node implementation take care of the reuse_buffer signal because
then we can get to the graph nodes to find the destination port.
Destroy modules in core cleanup. Modules should undo everything they
have done.
Activate the link after we negotiated format and buffers.
2017-08-22 18:30:10 +02:00
Wim Taymans
12e2fae8ab jack: add midi format
Add midi format
Handle ore requests
Clean semaphore and socket names
2017-08-21 20:19:09 +02:00
Wim Taymans
1fc7c6de59 jack: only remove node when we added it before 2017-08-21 16:36:37 +02:00
Wim Taymans
fca6808419 jack: improve activate/deactivate
Add the nodes from the RT thread.
Handle non-realtime clients, we don't need to signal them
do some sort of latency callbacks
Don't do callbacks for clients without a handler.
2017-08-21 12:07:33 +02:00
Wim Taymans
bece3a013b Make scheduler more generic
Add some callbacks to trigger push and pull in a graph
Remove the scheduler, make some implementations of graph push/pull
functions.
Add some properties to jack clients and nodes
Fix the parent of the clients.
Notify link format changes
2017-08-20 18:33:07 +02:00
Wim Taymans
60866fc7cd jack: notify graph changes from main thread 2017-08-18 18:48:22 +02:00
Wim Taymans
29eb58f7a2 Add systemd socket activation files
Notify of jack graph changes
2017-08-17 18:59:03 +02:00
Wim Taymans
560e02ef11 jack: handle port disconnect 2017-08-17 09:45:36 +02:00
Wim Taymans
b7647e80d3 jack: work on cleanup 2017-08-16 17:11:37 +02:00
Wim Taymans
27f811d726 jack: move more stuff to nodes and ports
Improve cleanup and registration of jack clients
2017-08-16 12:43:06 +02:00
Wim Taymans
2cb1590859 cleanups 2017-08-16 12:39:13 +02:00
Wim Taymans
4731a0b4b8 More work on jack support 2017-08-15 11:02:42 +02:00
Wim Taymans
288d944579 autolink: fix crash 2017-08-11 20:23:40 +02:00
Wim Taymans
9ad1f911b2 Improve loop callbacks
Pass just one data item to the callbacks.
Add properties to port.
Add user data to link
Handle autolink with multiple ports
More work on jack support
2017-08-11 19:21:31 +02:00
Wim Taymans
db15225b51 Fix includes 2017-08-08 19:55:14 +02:00
Wim Taymans
eeda53dbef Fix leaks
Add some docs
Add properties to loop objects for future use
2017-08-08 18:24:15 +02:00