Commit Graph

18 Commits

Author SHA1 Message Date
George Kiagiadakis
af01155093 Merge branch 'master' into next-lua 2020-12-21 18:56:52 +02:00
George Kiagiadakis
e48cb30828 Fix compiler warnings that appear with the warning flags enabled
Fixes #20
2020-12-20 22:16:37 +02:00
George Kiagiadakis
ea0b96073f spa-pod: make the wrap functions public, remove private.h and sort out the rest 2020-11-16 11:01:18 +02:00
George Kiagiadakis
37134df7c8 iterator: make private stuff public, cleanup private.h further
There is no good reason to keep them private
2020-11-15 20:26:15 +02:00
George Kiagiadakis
2f3f5f8e66 lib: refactor WpProxy
This is an attempt to unclutter the API of WpProxy and
split functionality into smaller pieces, making it easier
to work with.

In this new class layout, we have the following classes:

- WpObject: base class for everything; handles activating
|           and deactivating "features"
|- WpProxy: base class for anything that wraps a pw_proxy;
 |          handles events from pw_proxy and nothing more
 |- WpGlobalProxy: handles integration with the registry

All the other classes derive from WpGlobalProxy. The reason
for separating WpGlobalProxy from WpProxy, though, is that
classes such as WpImplNode / WpSpaDevice can also derive from
WpProxy now, without interfacing with the registry.

All objects that come with an "info" structure and have properties
and/or params also implement the WpPipewireObject interface. This
provides the API to query properties and get/set params. Essentially,
this is implemented by all classes except WpMetadata (pw_metadata
does not have info)

This interface is implemented on each object separately, using
a private "mixin", which is a set of vfunc implementations and helper
functions (and macros) to facilitate the implementation of this interface.

A notable difference to the old WpProxy is that now features can be
deactivated, so it is possible to enable something and later disable
it again.

This commit disables modules, tests, tools, etc, to avoid growing the
patch more, while ensuring that the project compiles.
2020-11-13 19:54:48 +02:00
George Kiagiadakis
71d12fe12a debug: add doc comments 2020-06-03 21:40:01 +03:00
George Kiagiadakis
f7d816f5d2 debug: print proxy bound IDs on objects, if they are bound proxies 2020-06-03 21:28:14 +03:00
George Kiagiadakis
1f2e2b7fc4 debug: add mechanism to debug spa pods
-> wp_trace_boxed (WP_TYPE_SPA_POD, pod, "some message");
2020-05-25 18:54:41 +03:00
George Kiagiadakis
b807b666a0 debug: don't crash if an object is NULL in wp_*_object() and point it out in the log
by using G_TYPE_NONE (== 1), we can pass this in the log handler
to point out the fact that we expected something but it's null

As a bonus, a null object always gets printed in red because that's
the first color in object_colors
2020-05-20 18:27:09 +03:00
George Kiagiadakis
5c8a462a4a debug: use levels 1-5 in WIREPLUMBER_DEBUG
This makes WIREPLUMBER_DEBUG behave just like PIPEWIRE_DEBUG.
Same levels, same syntax, easier for users.

ERROR & CRITICAL are always printed, as they should; there is no point
in disabling them, since:
- ERRORs are always fatal and should never ever happen
- CRITICALs are assertion failures and indicate bugs that need to be fixed
2020-05-14 17:00:55 +03:00
George Kiagiadakis
a45d47f519 debug: shorten a bit the length of the messages
* use a short level name, like pipewire does
* color the timestamp to compensate for the loss of the visible level name
* use 18 chars for the category
2020-05-14 16:37:38 +03:00
George Kiagiadakis
bfe76bf1d1 debug: honor WIREPLUMBER_DEBUG and ignore PIPEWIRE_DEBUG in pw_log
And also provide a way to disable this integration at runtime to
get pipewire's log back, with WIREPLUMBER_NO_PW_LOG=1
2020-05-12 18:16:55 +03:00
George Kiagiadakis
17c1eb3fac debug: downgrade SPA error & warn -> GLib warn & msg
The GLib error level is fatal, but pipewire doesn't use it that way.
Also, the GLib critical level is meant only for programming errors
(assertions) and not for runtime errors. warn & msg levels really
fit well with the error & warn, as they are being used in pipewire
currently.
2020-05-12 18:16:55 +03:00
George Kiagiadakis
66a0bf6093 lib: implement a wp_init() function 2020-05-11 15:45:09 +03:00
George Kiagiadakis
738b88aaba debug: randomize object printout colors
This way we can more easily distinguish different objects when
looking at the log, although it's not perfect
2020-04-27 11:49:55 +03:00
George Kiagiadakis
78cdf4b8e6 debug: use the "default" domain to log messages without a domain
This allows filtering messages without a domain using WIREPLUMBER_DEBUG
2020-04-15 18:33:33 +03:00
George Kiagiadakis
ecbcabdc05 debug: add support for redirecting pipewire's log to the glib one 2020-04-14 14:59:55 +03:00
George Kiagiadakis
c80b87208b lib: add a debug logging system
This extends GLib's logging system, so it is compatible with
g_debug() and friends, but it uses a better logging format and
supports filtering debug domains with wildcards, like in gst.
2020-04-14 12:16:41 +03:00