Commit graph

29 commits

Author SHA1 Message Date
Pauli Virtanen
e784de3933 spa: use log topics everywhere
Use log topics properly everywhere, convert from "#define NAME".
2024-03-11 18:45:21 +02:00
Pauli Virtanen
eaea03c26c spa: export log topic enumerations 2024-01-04 10:02:55 +00:00
Wim Taymans
8eb1d8f2ac dbus: add some more debug 2023-07-20 10:15:30 +02:00
Barnabás Pőcze
934ab3036e treewide: use SPDX tags to specify copyright information
SPDX tags make the licensing information easy to understand and clear,
and they are machine parseable.

See https://spdx.dev for more information.
2023-02-16 10:54:48 +00:00
Wim Taymans
392b2f1f96 dbuf: use log topic 2021-10-03 12:27:20 +02:00
Wim Taymans
c6dc7e98fd dbus: protect against NULL data
Make sure we don't accidentally unref a NULL data.
2021-08-03 19:11:15 +02:00
Pauli Virtanen
2b515b5e50 dbus: keep a ref to DBusConnection if reconnecting is not handled
Several places in the code don't handle reconnecting DBus connections
yet. In those cases, a ref to the DBusConnection handle needs to be
kept, so that there's no use-after-free if it gets freed by spa_dbus
if the connection is broken.

Adjust spa_dbus so that others keeping additional refs is safe.
2021-06-26 16:11:40 +03:00
Stefano Ragni
243d534476 dbus: fix bus type reported in logs 2021-06-25 08:26:00 +00:00
Wim Taymans
751f9a9ea0 dbus: make sure we don't unref a NULL dbus connection
See #1213
2021-05-26 10:52:38 +02:00
Peter Hutterer
7697ed0757 treewide: replace strcmp() == 0 with spa_streq()
This change is only done in source files for now, header files will be done
separately.
2021-05-18 22:10:27 +10:00
Wim Taymans
d8208c5c2d dbus: move connect to dbus in connection_get()
This way we can reset the dbus connection when we got a disconnect
and signal the event. This can then be used by the client to
do a new connection_get().
2021-05-17 13:17:27 +02:00
Wim Taymans
2dcdabd2af dbus: add events to the dbus connection
Add events to the dbus connection and notify about destroy and
disconnect.
2021-05-17 11:54:43 +02:00
Wim Taymans
40fbabd9ed dbus: listen for disconnect signal
And log a warning when our connection is lost.

See #1099
2021-05-17 10:20:28 +02:00
Wim Taymans
ebe5fa7809 dbus: clean up sources and connections
Set source user data for all dbus sources and set a destroy notify
when removed.
Remove the dbus user data to remove the source user data.
Clean up remaining sources when destoying a connection
Clean up remaining connections when freeing the dbus plugins.

Fixes #1114
2021-05-01 09:33:06 +02:00
Wim Taymans
ca72738fee dbus: add some more debug in the plugin 2021-04-30 12:23:10 +02:00
Wim Taymans
a5b0553328 Fix some -Wenum-conversion errors
Make pw_direction and spa_direction the same
Explicitly cast some enums or use the right enums
2020-04-04 20:03:08 +02:00
Wim Taymans
f391353c7f Make interface types a string
This is more in line with wayland and it allows us to create new
interfaces in modules without having to add anything to the type
enum. It also removes some lookups to map type_id to readable
name in debug.
2019-12-19 13:36:04 +01:00
Wim Taymans
6720ded529 names: add standard factory name definitions
Define a set of standard factory names and document what they
contain. This makes it possible to change the implementation by
mapping the factory-name to a different shared library.
2019-06-21 13:31:34 +02:00
Wim Taymans
504d78cd18 improve error handling
Set errno for functions returning NULL if relevant.
Propagate errno and result codes better.
Handle more error cases.
2019-06-07 10:11:23 +02:00
Wim Taymans
db88e9f954 System: More work on making system functions pluggable
Move the epoll functions to the system functions and make the loop
use those. Use simple mask for events instead of enum.
Add the used system api in pw_loop.
Add System API to spa_support and use it where possible.
Pass the system API used in the realtime loops in spa_support as
well and use this in the realtime paths.
Improve bootstrapping, load only the log and cpu interfaces because
those can/need to be shared between instances. Let the core load
the other interfaces.
Add keys to configure the System and Loop implementations used in
pw_loop.
2019-06-06 15:31:53 +02:00
Wim Taymans
86dc0496a5 simply use INTERFACE_Loop for the main-loop 2019-06-06 15:20:43 +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
569cbb48a9 use SPA_EXPORT to export symbols 2019-02-06 13:24:41 +01:00
Wim Taymans
85f2e93c54 Relicense as MIT/X11
Remove some obsolete files
2018-11-05 17:48:52 +01: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
de36330917 handle: make method to get size 2018-04-09 10:06:17 +02:00
Wim Taymans
9d4b0d8358 dbus: move rtkit to module
Move the rtkit code to a module.
Make sure we don't need to include the dbus headers in the spa dbus
interface. This removes the dependency on dbus.
2018-02-08 10:02:17 +01:00
Wim Taymans
f7b6fea43d Add dbus support interface
Add an interface that can manager a dbus connection.
Make a dbus interface in the core that can create connections running
in the core main loop. Keep this as support for spa plugins.
2017-12-18 12:41:47 +01:00