Commit graph

531 commits

Author SHA1 Message Date
George Kiagiadakis
801ac7aa1a wplua: add a wplua_checkclosure() helper function 2021-06-10 14:53:08 +03:00
George Kiagiadakis
7355215cf1 pipewire-object: change params-changed signal to take a string param name
To be consistent with the rest of the API where strings are used
to identify param types
2021-06-09 13:29:34 +03:00
George Kiagiadakis
f9767d19a6 lib: add struct paddings to be able to maintain ABI compatibility
Aim for 8 pointers on each struct, wich exceptions:
- 12 pointers for already crowded/important ones
- 4 pointers for empty ones that are used for proxies; we are
  unlikely to add any virtual methods on these classes ever
2021-06-08 17:38:14 +03:00
Julian Bouzas
83e50396ee pw-object-mixin: ignore set param on already destroyed objects 2021-06-08 09:08:13 -04:00
Julian Bouzas
21e73141c6 proxy: destroy pw_proxy if bind_error is called 2021-06-08 09:08:13 -04:00
Julian Bouzas
7d28027f9b wplua: fix memleak when converting GVariant to Lua 2021-06-07 11:33:21 -04:00
Julian Bouzas
fc8cc09654 global-proxy: fix leak when getting global properties 2021-06-07 11:33:21 -04:00
Julian Bouzas
a12c41aca1 spa-pod: check if pod is valid before _parser_can_collect
Spotted with clang-tidy, avoids possible segfault if pod is NULL.
2021-06-07 11:33:21 -04:00
George Kiagiadakis
ac5c2ebbba object-interest: remove unused _copy() method
object-interest is now ref-counted, so we can use _ref()
2021-06-07 17:56:32 +03:00
George Kiagiadakis
450deabb40 object-manager: small doc fix 2021-06-07 17:47:42 +03:00
George Kiagiadakis
1ca67abc66 object-manager: support declaring interest on all properties of globals
Until now, object manager could only match pw global properties on
pw global objects, because this is the only available properties set
at the time the registry creates the global.

With this change, the object manager will now bind the proxy
if the type and the pw global properties have matched and will wait
until the proxy is available with all of its properties and tries
the check again.
2021-06-07 17:47:42 +03:00
George Kiagiadakis
997bdb65cd object-interest: enrich _matches_full() to be able to check all constraints 2021-06-07 17:47:42 +03:00
George Kiagiadakis
38f7483793 state: remove support for groups and propagate save errors
There is no real use for groups in our API. Just use the name of
the file as the default group and be done with it...
Storing multiple groups with this API is problematic because it
forces flushing the file to disk multiple times, one for each group,
and it's just more performant if we use a prefix in the keys
to implement some form of logical separation.

This commit also makes the GKeyFile a temporary object. As we
always load the file from the file system in _load()
and we always replace its contents with a new dictionary in _save(),
there is no point in keeping the keyfile's internal data structures
stored in memory.

Save errors are now also propagated to adhere to the programming
practices of GObject
2021-06-04 18:36:19 +03:00
George Kiagiadakis
4948f6f2f6 state: don't stat() before creating the dir or removing the state file
there is no point
2021-06-04 18:36:19 +03:00
Julian Bouzas
cde38daabf pipewire-object: fix memory leaks when getting properties 2021-06-03 14:53:00 -04:00
Julian Bouzas
214c7a444a endpoint: free media_class when disposing WpImplEndpoint 2021-06-03 14:53:00 -04:00
Julian Bouzas
3fbcf05c9b pipewire-object: take ownership of param argument
The wp_pipewire_object_set_param API must take ownership of the param argument
as described by the documentation.
2021-06-03 14:53:00 -04:00
Julian Bouzas
d28f1241cc object: advance pending transitions if activation fails 2021-06-03 09:38:19 -04:00
Jason Francis
1b5df6096a docs: include wp.h in gir sources 2021-06-02 17:38:34 +00:00
Jason Francis
ed8346e77d docs: Add brief descriptions to all functions
This ensures all of these functions are picked up by g-ir-scanner.
2021-06-02 17:38:34 +00:00
Julian Bouzas
4a1ee67303 global-proxy: make sure registry is valid before requesting destroy
Avoids segfault when requesting destroy if core is disconnected
2021-06-02 16:42:15 +00:00
George Kiagiadakis
9db0e741cd lua: allow the Log api to debug boxed objects (useful for pods) 2021-06-02 19:38:51 +03:00
Julian Bouzas
8698d4f43a object: use weakref when advancing current transition
Fixes reference count leak when activating an object and transition fails
2021-06-01 13:46:52 -04:00
Julian Bouzas
efb0f83d1f object: use destroy notify to keep self alive while advancing transitions 2021-06-01 13:43:25 -04:00
George Kiagiadakis
c3ee52506b docs: fix gobject-introspection data generation
Let g-ir-scanner parse the original headers for the C signatures
and just add the gtk-doc comments in the generated wp-gtkdoc.h file

Also cleanup a bit gen-api-gtkdoc.py and make it omit printing most of the
whitespace clutter that it used to print inside the gtk-doc comments
2021-05-25 14:19:53 +03:00
George Kiagiadakis
b812e912d2 docs: fix C API documentation to work nicely with doxygen & sphinx 2021-05-25 14:19:53 +03:00
George Kiagiadakis
93c2e7d686 meson: refactor docs + gi build system
* Use custom_target() instead of configured shell scripts
* Do not copy all the .rst files in the build directory
* Setup dependencies between targets
* Tidy up dependencies lookup
* Remove unused files
* Upgrade Doxyfile to the latest version and cleanup used options
2021-05-25 14:19:53 +03:00
Raghavendra
2e5b13f970 docs: build gobject introspection from xml files generated by Doxygen 2021-05-25 14:19:53 +03:00
Raghavendra
d692f06f0d docs: api: Replace hotdoc specific commands with Doxygen specific commands 2021-05-25 14:19:53 +03:00
Julian Bouzas
3e6edcb02e pipewire-object-mixin: fix memleak in GList 2021-05-24 12:59:11 -04:00
George Kiagiadakis
4e3ca5dc15 wplua: ref closure before invalidating it
invalidation may destroy the closure and this will trigger
_wplua_closure_finalize(), which will remove the closure from the
array while the original code is also trying to do the same

if we destroy the closure after it has been removed from the
array, _wplua_closure_finalize() will not remove anything and
will continue happily
2021-05-22 10:52:35 +03:00
George Kiagiadakis
f0d33cb873 endpoint: remove wp_endpoint_create_link()
Not used and not useful with the current design.
May be reverted in the future, if necessary.
2021-05-21 19:57:31 +03:00
George Kiagiadakis
ac9e1e89c4 wp: remove WpSession and WpEndpointLink
We have ended up not using them, so let's not carry them
in the ABI of 0.4

We can always revert that, but let's first decide how
these objects should be used
2021-05-21 19:57:31 +03:00
Julian Bouzas
188a10e0e7 pipewire-object-mixin: make sure enum params task is only triggered once
Always remove the task from the list before returning to make sure it will
always be triggered once.
2021-05-19 10:26:17 -04:00
Julian Bouzas
7e23f313b3 proxy: don't accept NULL pw_proxy in set_pw_proxy API 2021-05-18 10:01:13 -04:00
Julian Bouzas
8fdd99d956 global-proxy: delay object creation until bound feature is requested
Allows handling errors if creation fails
2021-05-18 09:24:33 -04:00
George Kiagiadakis
63239bdfda proxy: relax proxy error warning messages
These are also printed by libpipewire on the DEBUG level
and they are really not that harmful, so we don't need to spam
users with "failed" messages and alarm them
2021-05-13 08:52:22 -04:00
George Kiagiadakis
7ff2bbc0eb pw-object-mixin: watch for proxy errors during enum_params 2021-05-13 08:52:22 -04:00
George Kiagiadakis
0b558eca74 proxy: add a "bind" watch, to watch for proxy errors while binding/exporting
Add a unit test for this. Create a link with invalid nodes and expect
the activation transition to error out.
2021-05-13 08:52:22 -04:00
George Kiagiadakis
7cf67a821a proxy: add error signal 2021-05-13 08:52:22 -04:00
Julian Bouzas
58db9e1fad global-proxy: destroy the global when proxy is destroyed 2021-05-12 14:04:34 -04:00
Julian Bouzas
d8ed6e4376 global-proxy: inherit from WpProxy when declaring class 2021-05-12 13:33:08 -04:00
Julian Bouzas
419af5a228 spa-pod: respect the SPA size for long and int APIs
Fixes some issues for 32bit architectures
2021-05-12 11:53:31 -04:00
Julian Bouzas
51964d30cf si-interfaces: add WpSiAdapter interface to set and get session item fortmat 2021-05-12 10:36:31 -04:00
Julian Bouzas
a37b4bf20d session-item: add _get_property API 2021-05-12 10:36:31 -04:00
Julian Bouzas
d68636f9b3 si-interfaces: rename WpSiPortInfo to WpSiLinkable 2021-05-11 10:56:44 -04:00
Julian Bouzas
e4d8f2a2df session-item: remove undefined API 2021-05-06 13:41:42 -04:00
George Kiagiadakis
a93dbf0845 wp: remove WpSessionBin
This is no longer used and likely not very useful now that we have
a simpler design.
We can re-add it in the future if necessary, but let's keep it out
of the 0.4 release.
2021-05-06 16:04:39 +03:00
George Kiagiadakis
257d5cba47 wp: rename debug.{h,c} to log.{h,c}
Also rename the intermediate lua api table WpDebug -> WpLog

Keeps things more consistent with the function names (wp_log*),
with the lua api (Log.*) and with pipewire using log.{h,c} as well.
After all, these functions are for logging...
2021-05-06 15:50:07 +03:00
George Kiagiadakis
86ffac19e5 wpipc: place sockets in the same runtime directory as pipewire 2021-05-06 14:15:24 +03:00