Julian Bouzas
17873c3ace
object-interest: add support for session item properties
2021-03-18 14:30:11 -04:00
Julian Bouzas
3aef916d51
session-item: add _register and _remove API
...
Allows using object managers to listen for registered items
2021-03-18 14:30:11 -04:00
Julian Bouzas
120aab04ae
session-item: refactor and inherit from WpObject
...
This adds WP_SESSION_ITEM_FEATURE_ACTIVE and WP_SESSION_ITEM_FEATURE_EXPORTED
features, so _activate and _export APIs have been removed. Modules and unit
tests have also been updated.
2021-03-18 14:30:05 -04:00
Julian Bouzas
5a11510e21
session-bin: remove unused wp_session_bin_new API
2021-03-18 12:10:37 -04:00
Julian Bouzas
5a1dfc02d2
lib: make WpImplEndpoint and WpImplEndpointLink public
2021-03-18 12:10:37 -04:00
Julian Bouzas
12b2c00d0b
lib: remove WpEndpointStream API
...
Add all that goes with it.
2021-03-18 12:10:37 -04:00
George Kiagiadakis
9609a79903
wp_init: set PIPEWIRE_DEBUG
...
It is inevitable to avoid setting PIPEWIRE_DEBUG, because the
log.level from client.conf will kick in and change the pipewire log
level when the pw_context is created. PIPEWIRE_DEBUG is the only
way to override.
2021-03-16 17:45:30 +02:00
George Kiagiadakis
faff5c644c
spa-device: do not assert if the activation transition fails
2021-03-16 16:15:32 +02:00
Julian Bouzas
5e69a82d4b
object: add wp_object_activate_closure API
2021-03-13 20:10:30 -05:00
George Kiagiadakis
5a0a4532d7
lib: remove WpConfiguration
...
it's not used anymore
2021-03-04 19:11:53 +02:00
George Kiagiadakis
7eed2acd76
lib: documentation fixes
2021-03-04 19:10:10 +02:00
George Kiagiadakis
941b0324e5
object-interest: remove type checks
...
They are not strictly necessary and just make our life harder
2021-03-02 18:25:34 +02:00
George Kiagiadakis
9f50117fa7
lib: remove module.{c,h}
2021-02-25 17:12:04 +02:00
George Kiagiadakis
e2d6e5b992
lua: enable loading scripts with a shebang
...
* skip the shebang before loading the file in the interpreter,
as # is not a valid lua comment
* allow loading scripts with a relative path in interactive mode
2021-02-18 13:47:34 +02:00
George Kiagiadakis
7c1fc1c567
wplua: table_to_properties: use luaL_tolstring to do string conversions
...
The advantage is that luaL_tolstring behaves the same as the native lua
tostring() function, while lua_tostring() does not. In particular, boolean
values are converted properly to "true" and "false" now, while they were
not converted with lua_tostring()
Add a unit test too
2021-02-16 16:53:22 +02:00
Raghavendra
c791ed3a62
m-lua-scripting: add WpPipewireObject api
2021-02-16 20:15:13 +05:30
George Kiagiadakis
e92351b23b
wplua: gvariant_to_lua: convert dictionary keys to integers if possible
...
When we convert from a lua table to a GVariant dictionary, it is not
possible to maintain the hybrid string & integer keys approach that Lua
has for tables, so we convert all keys to strings and a table becomes a{sv}
When we convert back from a{sv} to a table, it is desirable to get back
the integer keys wherever possible.
The use case is to pass "arrays" (i.e. tables with integer keys) from
the configuration files to the lua scripts, without losing the properties
of the "array"
2021-02-15 18:50:56 +02:00
George Kiagiadakis
b3ff7347cd
wplua: improve GVariant array conversion
...
* index array items from 1
* handle any kind of value, not just GVariant basic types
* unit test
2021-02-15 14:43:18 +02:00
George Kiagiadakis
dacf19d9c7
wplua: improve gvariant <-> lua conversion functions
...
* Add more generic lua -> gvariant conversion
* Cleanup the gvariant -> lua function and rename it
2021-02-15 14:43:18 +02:00
George Kiagiadakis
413ff73bab
wplua: remove VARDICT handling in gvariant->lua conversion
...
G_VARIANT_TYPE_DICTIONARY also catches the VARDICT case
2021-02-15 14:43:18 +02:00
George Kiagiadakis
47b6417bbe
object-interest: allow matching against WpProperties objects
2021-02-13 11:55:00 +02:00
Julian Bouzas
cbe90a5c75
wplua: handle more GVariant cases
2021-02-12 14:28:38 -05:00
Julian Bouzas
dc2ad1f25d
rename all foo_iterate APIs to foo_new_iterator
...
Avoids confusion with LUA iterate API
2021-02-05 11:33:23 -05:00
George Kiagiadakis
7b37b31af9
wplua: fix enum <-> lua conversion
...
Sometimes the GEnumClass is not instantiated, so _peek() doesn't work
We need to acquire a strong ref to make sure it is
2021-02-05 12:00:24 +02:00
George Kiagiadakis
ce66025846
node: change send_command() to take a string
...
Use the spa type system to locate the enumeration value that corresponds
to that string and send that
2021-02-05 11:05:26 +02:00
Julian Bouzas
a634bf88fd
wplua: fix vtables lookup in boxed __index function
2021-02-05 08:47:27 +00:00
George Kiagiadakis
096a9b4c15
proxy: add a method to query the interface type
2021-02-04 16:51:25 +02:00
George Kiagiadakis
e0f1c8710f
daemon: add a mode to execute lua scripts from the command line
...
This can be useful for quick testing of scripts, or to build small
utilities that do something in pipewire utilizing our lua API
2021-02-04 16:44:56 +02:00
George Kiagiadakis
1c0f0b8684
wplua: pass SANDBOX_CONFIG as a script argument
...
avoids keeping it forever as a global
2021-02-03 17:16:51 +02:00
George Kiagiadakis
460ff6591d
wplua: allow exchanging arguments and results with scripts
2021-02-03 17:16:51 +02:00
George Kiagiadakis
81d6f055a0
wplua: add GVariant dictionary conversion functions
2021-02-03 17:16:51 +02:00
George Kiagiadakis
a67116b0b9
wptoml: remove, it's not used anymore
...
and drop cpptoml dependency as well
2021-02-03 17:16:51 +02:00
George Kiagiadakis
29559b4065
wp: add wp_get_data_dir()
2021-02-03 17:16:51 +02:00
George Kiagiadakis
9fa17e04b4
object-interest: add a NOT_EQUALS verb
2021-02-03 17:16:51 +02:00
George Kiagiadakis
5647f0bf9e
wplua: allow loading relative paths from wplua_load_path()
...
convert them to absolute before creating the URI
2021-02-03 17:16:51 +02:00
George Kiagiadakis
84f1b4b484
wplua: add g_autoptr support to lua_State
2021-02-03 17:16:51 +02:00
George Kiagiadakis
94d527e187
wplua: add flags to modify the sandbox behavior
...
with ISOLATE_ENV, it isolates the global environment between scripts
just like it did before; without it, it uses a common environment
with MINIMAL_STD, it restricts even further the available library
functions; useful for configuration files that don't need to do
actual scripting, just to define some tables
2021-02-03 17:16:51 +02:00
George Kiagiadakis
cb228637d6
wp: export functions to get the module & config dirs
2021-02-03 17:16:51 +02:00
George Kiagiadakis
0d072874a1
lib: introduce WpComponentLoader and remove WpModule
...
The component loader is a more generic and extensible mechanism
of loading components; modules are one type of component...
The idea is to make scripts and config files also be components,
loaded by plugins that inherit WpComponentLoader
2021-02-03 17:16:51 +02:00
George Kiagiadakis
f61e292959
plugin: inherit from WpObject
...
* use the activate/deactivate system from WpObject,
which allows async activation and error reporting
* drop 'module' property, use 'core' from WpObject
2021-02-03 17:16:51 +02:00
George Kiagiadakis
4a15ad05f3
spa-device: add an "object-removed" signal
...
This is useful for monitors to destroy the associated device reservation
object. And it may be useful for other things in the future...
2021-01-26 16:42:29 +02:00
George Kiagiadakis
bf71b73ae2
plugin: add a method to find plugins easily
...
Similar to wp_si_factory_find()
2021-01-26 16:28:22 +02:00
Julian Bouzas
7c0739af50
session-item: add export API with closure
2021-01-22 09:55:52 -05:00
Julian Bouzas
73c6e65a74
session-item: add activate API with closure
2021-01-22 09:55:52 -05:00
Julian Bouzas
b7b3ce212b
object-interest: add _ref and _unref APIs
2021-01-21 07:46:59 -05:00
George Kiagiadakis
674e53c221
spa-device: handle DeviceEvent and configure node props
...
Depends on DeviceEvent type-info, available on pipewire master as of today
2021-01-21 09:42:07 +02:00
George Kiagiadakis
e9c38f365e
plugin: debug activation & deactivation
2021-01-21 09:42:07 +02:00
George Kiagiadakis
997e2c7539
wplua: object: unset GValues used when calling action signals
2021-01-21 09:42:07 +02:00
George Kiagiadakis
c678cbed2c
impl-node: derive from WpProxy
2021-01-21 09:42:07 +02:00
George Kiagiadakis
18229e8265
spa-device: derive from WpProxy and manage child objects internally
...
port module-monitor to follow the changes
2021-01-21 09:42:07 +02:00