Skip to content

pw: Improve loop types

Tom Wagner requested to merge ryuukyu/pipewire-rs:loop-fixes into main

Makes multiple improvements to the pipewire loop types Loop, MainLoop, ThreadLoop:

  • Make each Inner type an implementation detail. Those structs are no longer public, and all functionality has been moved to the outer types This also included changing and renaming the AsLoop trait.
  • Remove long deref chains (outer type -> inner type -> LoopRef) Deref should only be used for the "smart pointer"-like outer types to dereference to their ref type. loop_() methods have been added instead to get the &LoopRef.
  • new and with_properties constructors have been merged into one constructor using an Option. Properties are not used rarely enough to warrant a seperate constructor.
  • Conversion functions from/to raw pointers have been added and changed to fit the crate convention
  • Missing crate::init() calls added to avoid UB when using uninitialized library
  • General code style improvements

Merge request reports