Commit Graph

41 Commits

Author SHA1 Message Date
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
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
aa93ecf793 spa-pod: add the ability to specify Id properties as strings
Use the unused 'K' format letter in the varargs builder & parser methods
2021-01-15 16:30:02 +02:00
George Kiagiadakis
3762388831 spa-type: refactor
* Use a more complete API to introspect SPA types
* Avoid the need for the Tables enumeration; the tables
  are now registered with a string
* Avoid the need for initialization, work directly on spa_types
  and other static data
* Allow working with Object pods that are not Params;
  the PARAMS table was previously hardcoded in the pod implementation
* Add a different dynamic type registration system, closer to
  how spa type works. The only regression is that we can no longer
  register additional custom object fields (custom SPA_PROP_* for example),
  but this feature can be re-added later
2021-01-15 16:30:01 +02:00
George Kiagiadakis
bd65517b7d pw-object-mixin: refactor, implement param caching and features for impl objects
Now the WpPipewireObject interface is directly implemented by the mixin
and there is another interface that users of the mixin must implement
in order for the mixin to work proprely.

A lot of manual stuff that proxy classes had to do before are now
in the mixin. Also most of the data that would normally reside in Private
structures is now in the mixin data structure (stored as qdata on the object).
This is achieving the best amount of code reuse so far.

For impl objects (WpImpl*) there are also default implementations of the
standard pipewire object methods and the INFO & PARAM_* features are
more coherently enabled during the whole lifetime of these objects.
2020-11-25 22:44:29 +02:00
George Kiagiadakis
ccdc354445 modules: port modules and their tests to the new proxy APIs
Disable m-session-settings for now, as it needs further work
2020-11-15 20:26:15 +02:00
Julian Bouzas
236f6f8fc5 m-si-adapter: use the adapter's name as stream name 2020-10-05 11:35:24 -04:00
Julian Bouzas
b2438f2cef m-si-adapter: set the configured flag when configuration was successful 2020-10-05 11:35:24 -04:00
George Kiagiadakis
d50e32fc47 si-adapter/simple-node-endpoint: propagate node.autoconnect as endpoint.autoconnect 2020-06-16 17:39:25 +03:00
George Kiagiadakis
5f9212c344 si-adapter: use the clock rate defined in pipewire.conf 2020-06-15 19:09:04 +03:00
George Kiagiadakis
651701a471 endpoint: use the node.name as the endpoint name and add endpoint.description
endpoint.description is now the user-friendly string
we want the endpoint name to be machine-friendly because it's
the identifier that we store in m-session-settings
2020-06-02 17:46:35 +03:00
George Kiagiadakis
8a94937b2a proxy: refactor how PARAM_Props/PropInfo are handled
+ rename FEATURE_CONTROLS to FEATURE_PROPS
+ add accessor for the standard spa_param_info (info->params)
+ hide the low-level params API that nobody uses
2020-05-25 18:54:41 +03:00
Julian Bouzas
5af66bb547 modules: copy node target property in adapter and simple-node-endpoint 2020-05-21 09:47:56 -04:00
Julian Bouzas
ee4e40ba1e modules: add 'monitor' context when getting ports in adapter and simple-node-endpoint 2020-05-21 09:47:56 -04:00
Julian Bouzas
d5f167b7db modules: fix small direction issue when getting the ports in adapter and simple-node-endpoint 2020-05-21 09:47:56 -04:00
Julian Bouzas
1acdb2a89b si-adapter: use a different g_autoptr for port_format 2020-05-19 10:18:51 -04:00
Julian Bouzas
4b7bc92e4b modules: remove pipewire module and move algorithms to module-si-adapter 2020-05-12 09:47:35 -04:00
Julian Bouzas
104e90c98c modules: si-adapter: fix segfault when setting priority property 2020-05-11 12:03:43 +03:00
George Kiagiadakis
6537332984 si-adapter: add a config option to specify the preferred number of channels
This is mostly useful when using the adapter with audiotestsrc,
which supports an infinite number of channels. By specifying
a preference, we can limit it to the number of channels that we want.
2020-05-11 11:40:55 +03:00
George Kiagiadakis
e8e6c1d8bc algorithms: allow specifying a preferred number of channels in the format choosing algorithm 2020-05-11 11:40:55 +03:00
George Kiagiadakis
9e2aa612d8 si-adapter: return the correct stream parent when the adapter is nested 2020-05-11 11:40:55 +03:00
George Kiagiadakis
9df3bb715c modules/si-*: cleanup included headers 2020-05-04 11:24:14 +03:00
George Kiagiadakis
3cecc18807 adapter: remove spa_pod_fixate fallback
This won't work with WpSpaPod, obviously...
2020-05-04 10:36:24 +03:00
George Kiagiadakis
e265d8e5a0 adapter: implement WpSiPortInfo and use node FEATURE_PORTS instead of ports_om 2020-05-04 10:12:35 +03:00
George Kiagiadakis
1ac66d4f62 adapter: fix indentation 2020-05-04 09:45:22 +03:00
George Kiagiadakis
9612d35ca4 si-interfaces: drop the multi-endpoint interface
It's not well-defined; we'll come back to that later
2020-05-04 09:35:22 +03:00
George Kiagiadakis
c95ee22702 Revert "modules: si-adapter: set/unser WP_SI_FLAG_CONFIGURED when adapter is configured/reset"
This reverts commit 4e8ae293f5.
2020-05-03 20:10:31 +03:00
Julian Bouzas
791e9170aa si-interfaces: transfer full when returning from _get_stream_parent_endpoint 2020-05-03 19:54:31 +03:00
Julian Bouzas
4e8ae293f5 modules: si-adapter: set/unser WP_SI_FLAG_CONFIGURED when adapter is configured/reset 2020-05-03 19:54:31 +03:00
George Kiagiadakis
d61b7904f9 modules: fix small issues in the session items 2020-04-23 15:22:32 +03:00
Julian Bouzas
cfbcb5eca3 proxy: use WpSpaPod instead of struct spa_pod in public API 2020-04-21 16:11:05 -04:00
George Kiagiadakis
49b63b6045 session-item: refactor export to use a process similar to activate
+ expose the export transition in the session item class
+ make the export-related flags immutable
+ add an export error flag
+ update and improve documentation
2020-04-16 17:38:31 +03:00
George Kiagiadakis
441a778b2e session-item: introduce a rollback() virtual method
+ replace calling execute_step(..., STEP_ERROR) with rollback
+ implement deactivate internally using rollback

This unifies deactivation steps, which are common between deactivate()
and calling execute_step() with WP_TRANSITION_STEP_ERROR at the
end of a failed activation transition.
2020-04-16 13:18:21 +03:00
George Kiagiadakis
6b51e5842c tests: add session-item unit test 2020-04-16 11:55:23 +03:00
George Kiagiadakis
f713cbee11 session-item: decouple reset from deactivate and export from activate
* It should be possible to activate/deactivate while an item
  is exported (if the item supports it, but that's a subclass matter)
* It should be possible to deactivate without resetting configuration
2020-04-09 19:24:42 +03:00
George Kiagiadakis
1f1c690b42 properties: remove _copy_keys and add update/add methods similar to the ones in pw_properties 2020-03-31 16:11:08 +03:00
George Kiagiadakis
306f75d321 session-item: implement and use _get_associated_proxy() API 2020-03-31 16:11:08 +03:00
George Kiagiadakis
79a39e98c9 transition: call execute_step() with _STEP_ERROR in error conditions
This allows the implementation to rollback changes, cancel jobs, etc
2020-03-31 16:11:08 +03:00
George Kiagiadakis
405e8ba0d5 session-item / endpoint: implement exporting a WpSiEndpoint
* introduces API to export session items
* introduces small changes in the WpSiEndpoint & WpSiStream
  interfaces to make it nicer to work with
* ports WpImplEndpoint to use PW_TYPE_INTERFACE_Endpoint
  to export. Depends on:
  https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/246
  (was merged after 0.3.2)
2020-03-29 15:18:20 +03:00
George Kiagiadakis
0c455a0c11 si-adapter: port to use WpSiFactory 2020-03-29 15:02:59 +03:00
George Kiagiadakis
51f7897aa1 modules: implement the "adapter" session item, as a reference 2020-03-29 15:02:59 +03:00