Skip to content
  • George Kiagiadakis's avatar
    conf: refactor configuration loading · 60382df6
    George Kiagiadakis authored
    Changes:
    
    - Configuration files are no longer located by libpipewire,
      which allows us to control the paths that are being looked up.
      This is a requirement for installations where pipewire and
      wireplumber are built using different prefixes, in which case
      the configuration files of wireplumber end up being installed in
      a place that libpipewire doesn't look into...
    
    - The location of conf files is now again $prefix/share/wireplumber,
      /etc/wireplumber and $XDG_CONFIG_HOME/wireplumber, instead of using
      the pipewire directories. Also, since the previous commits, we now
      also support $XDG_CONFIG_DIRS/wireplumber (typically /etc/xdg/wireplumber)
      and $XDG_DATA_DIRS/wireplumber for system-wide configuration.
    
    - Since libpipewire doesn't expose the parser, we now also do the
      parsing of sections ourselves. This has the advantage that we can
      optimize it a bit for our use case.
    
    - The WpConf API has changed to not be a singleton and it is a
      property of WpCore instead. The configuration is now expected
      to be opened before the core is created, which allows the caller
      to identify configuration errors in advance. By not being a singleton,
      we can also reuse the WpConf API to open other SPA-JSON files.
    
    - WpConf also now has a lazy loading mechanism. The configuration
      files are mmap'ed and the various sections are located in advance,
      but not parsed until they are actually requested. Also, the sections
      are not copied in memory, unlike what happens in libpipewire. They
      are only copied when merging is needed.
    
    - WpCore now disables loading of a configuration file in pw_context,
      if a WpConf is provided. This is to have complete control here.
      The 'context.spa-libs' and 'context.modules' sections are still
      loaded, but we load them in WpConf and pass them down to pw_context
      for parsing. If a WpConf is not provided, pw_context is left to load
      the default configuration file (client.conf normally).
    60382df6
Loading