Commit graph

43 commits

Author SHA1 Message Date
Wim Taymans
e40fbf8cc4 Add printf checks for proxy_error and resource_error
Add an error variant without checks.
2019-11-21 16:09:05 +01:00
Wim Taymans
9ffec214b8 fix includes 2019-10-25 15:01:02 +02:00
Wim Taymans
6e0c279bc1 improve properties on objects 2019-10-02 20:16:12 +02:00
Wim Taymans
8db4a797aa core: remove parent_id from the global event
Remove the parent_id from the global event. Remove the parent
and owner from the global object.

Use properties instead to mark parents and owners of objects.

Properties are easier to control for client exported objects and
usually a simple parent/child is not enough. For example, a client
exported node has the client as a parent but also the factory that
created the node.
2019-08-16 22:11:42 +02:00
Wim Taymans
c6a7b3eedb channelmix: implement per channel volume
Implement per channel volume on channelmix. Extend control on stream to
take an array of values when possible.

Remove name argument from pw_node_new and pw_device_new. We can pass
this as a property instead.

Improve properties on nodes to more closely match what pulseaudio does.
Don't let the monitor do too much with the udev properties but let the
session manager set the description and icon-names.

Remove some change_mask flags for things that don't change in
introspect. Use the flags to mark changes in -cli and -monitor.
2019-08-12 15:14:39 +02:00
Wim Taymans
53d3d5cb0c improve debug 2019-07-17 15:29:18 +02:00
Wim Taymans
01e56c45ac node-factory: destroy node when resource is destroyed 2019-07-12 09:54:32 +02:00
Wim Taymans
a212d2f9ed improve error handling some more 2019-06-20 11:04:34 +02:00
Wim Taymans
00ea15dc1f improve error handling 2019-06-19 16:22:22 +02:00
Wim Taymans
49ef8f9b5f spa: add keys for properties
Define and document property keys
2019-06-03 16:48:01 +02:00
Wim Taymans
a672a9ee67 modules: add usage to factories
Improve audio-dsp properties
Fix some keys
2019-05-31 16:41:07 +02:00
Wim Taymans
d4def56bcb spa: don't pass library around
Don't pass the library in the methods, we use the factory_name to
find the object. Make it possible to override the default library
with a property.
2019-05-31 16:06:14 +02:00
Wim Taymans
1d1f035e78 monitor: return factory_name in the object_info
Pass a factory_name in the object_info of monitor and device.
Restructure the factory name to mean something functionaly. With
the factory to library mapping this then means that the implementation
of certain factories can be configured in the config file.
2019-05-31 15:06:44 +02:00
Wim Taymans
3ad73f0532 keys: add keys.h with defines and docs
Add a keys.h file that lists and documents all keys available to
be used in properties.
2019-05-24 15:47:48 +02:00
Wim Taymans
ff946e3d4b interface: add an interface struct
The interface struct has the type,version and methods of the
interface.
Make spa interfaces extend from spa_interface and make a
separate structure for the methods.
Pass a generic void* as the first argument of methods, like
we don in PipeWire.
Bundle the methods + implementation in a versioned inteface
and use that to invoke methods. This way we can do version
checks on the methods.
Make resource and proxy interfaces that we can can call. We
can then make the core interfaces independent on proxy/resource and
hide them in the lower layers.
Add add_listener method to methods of core interfaces, just
like SPA.
2019-05-23 12:59:24 +02:00
Wim Taymans
fbf6acd271 list: use spa_list_consume some more
If we know the item is removed in each iteration, _consume can handle
deletion of any item while being iterated.
2019-05-23 09:56:02 +02:00
Wim Taymans
8ae5424359 resource: improve error handling
Make some more varargs error functions
Make pw_resource_error always just send the error to the resource id.
Make sure we send errors to the right destination.
Add proxy error event and emit it when the core finds an error for
the given proxy id.
The client error is supposed to be sent to all resources of a client
for the given global.
2019-02-14 16:53:42 +01:00
Wim Taymans
569cbb48a9 use SPA_EXPORT to export symbols 2019-02-06 13:24:41 +01:00
Wim Taymans
3dc6820e9e Don't use __ in defines or declarations, it's reserved
SPA_TYPE -> SPA_TYPE_INFO for type info strings
improve includes

Fixes #115
2019-01-14 13:00:00 +01:00
Wim Taymans
85f2e93c54 Relicense as MIT/X11
Remove some obsolete files
2018-11-05 17:48:52 +01:00
Wim Taymans
f46a83dcb7 resource: pass the resource id in the error 2018-10-03 19:24:53 +02:00
Wim Taymans
90c1a95eef More type cleanups
SPA_ID_* -> SPA_TYPE_*. We use 'type' for all registered types.
ID refers to either a registered type or an enum.
Improve introspection of object ids. Make 0 an invalid enum and
use it to look up the object id type.
Move some type-info files together.
Swap type and id of the object, we first specify the type and then
the id because the meaning of the id depends on the object type.
2018-08-27 15:03:11 +02:00
Wim Taymans
fca3e1d85d Remove dynamic types
Do not use dynamic types anymore. The reason is that it's difficult:

- to maintain a shared type database over a network.
- the extra overhead when translating between processes and for
  maintaining the translation tables.
- race conditions in translating in RT-threads, this is a problem
  because we want to make event streams.

We now have simple enums with types and extension points for all
types. This is also nicer to use in general.
We don't need the mapper anymore or pass strings around as types.
There is a parallel type info system to get more info about ids and
enums and their hierarchy. It can also be used for debugging.
2018-08-23 17:47:57 +02:00
Wim Taymans
46ad3155b5 module: implement properties 2018-06-01 11:23:02 +02:00
Wim Taymans
6450c64542 clean up listeners 2018-05-17 17:30:30 +02:00
David Svensson Fors
6365ea18d9 module-node-factory: remove destroyed node from node list 2018-03-01 17:43:19 +01:00
Wim Taymans
c593d868fb global: add properties
Add properties to global objects to make it easier to select what
nodes and objects to bind too. They can also be used to implement
permissions on the globals based on properties.
Add more error handling in _register.
Make more functions return a result code.
Make a separate pw_module_register, like all other objects.
2018-01-19 11:27:54 +01:00
Wim Taymans
21aad20f94 node-factory: activate elements 2018-01-16 16:50:53 +01:00
Wim Taymans
4d6ac37398 Use int instead of bool as result
Prefer to use an int return from a function instead of bool because
it can contain more info about failures.
2017-12-18 11:38:30 +01:00
Wim Taymans
157a8b6ddf factory: add events
Add events to the factory and use the destroy event to clean up.
2017-11-14 10:59:10 +01:00
Wim Taymans
6fb0f580ea Use errno for result errors
Make new enumeration for data transport status and use errno
style error numbers for errors.
2017-11-13 09:41:41 +01: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
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
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
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
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
db15225b51 Fix includes 2017-08-08 19:55:14 +02:00
Wim Taymans
0602d76b9e Cleanups
Only pass data to callbacks.
Rename some structs
Provide methods to access structs
2017-08-06 06:42:26 +02:00
Wim Taymans
b898eb46cd Make structure private
Make structs private. Expose methods for things we need.
Signals only work on exposed structures so make a new callback helper to
signal events.
2017-08-04 10:18:54 +02:00
Wim Taymans
a003d1a39f Add parent_id
Add parent_id to globals to make hierarchy of interfaces. We can use
this to group interfaces or to describe the owner.
2017-07-18 14:58:14 +02:00
Wim Taymans
1acba78234 API cleanups
Fix docs
Add some more versions to interfaces
Make types for the various proxy object + inline methods that does type
checking and create proxys etc.
Set owner client of client-nodes in the properties
Pass type to bind to in create-node
Don't place global id in the info structs
Improve registration of marshal functions
Pass more types around as ids
2017-07-18 10:06:40 +02:00
Wim Taymans
d1655196c3 move things around 2017-07-11 16:08:22 +02:00
Renamed from pipewire/modules/spa/module-node-factory.c (Browse further)