Skip to content

Add binding for pw_core_create_object

Tom Wagner requested to merge ryuukyu/pipewire-rs:object-creation into master

This MR adds bindings for pw_core_create_object, so that we can create new objects on the remote pipewire graph.
It's not 100% ready yet since the example fails CI (I suspect it's the hardcoded factory name), but I also wanted to discuss some Proxy/ProxyT things already.

Converting from the proxy to the requested type is a bit awkward.
We just decided we would not implement downcast for now, but the Core::create_object and Registry::bind functions do exactly that at the moment, so maybe we should just move it into a downcast function.
If we do make a downcast function, should both functions do the downcast or should we leave that to the user?

Another minor annoyance during downcasting is that ProxyT::type_() returns an enum ObjectType while Proxy::get_type() returns the type as a &str.
Should Proxy::get_type() also return an ObjectType? Maybe we should then move that enum out of the registry module, since registry is not the only module needing it.

Thoughts?

Edited by Tom Wagner

Merge request reports