mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
daemon-conf: Add conf file parsing
Support to parse configuration files. By default, the default conf file
is parsed ({sysconfdir}/pinos/pinos.conf), but that can be changed with
an environment variable (PINOS_CONFIG_FILE). The file can contain
commands and assignments (no assignment supported this far).
Support for command module-load is added.
This commit is contained in:
parent
d654a1bcd6
commit
7d8e2d53f7
14 changed files with 729 additions and 59 deletions
|
|
@ -25,11 +25,14 @@
|
|||
#include <server/module.h>
|
||||
#include <spa/include/spa/memory.h>
|
||||
|
||||
#include "daemon-config.h"
|
||||
|
||||
gint
|
||||
main (gint argc, gchar *argv[])
|
||||
{
|
||||
PinosDaemon *daemon;
|
||||
GMainLoop *loop;
|
||||
PinosDaemonConfig *config;
|
||||
PinosProperties *props;
|
||||
GError *err = NULL;
|
||||
|
||||
|
|
@ -38,16 +41,18 @@ main (gint argc, gchar *argv[])
|
|||
|
||||
loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
props = pinos_properties_new ("test", "test", NULL);
|
||||
daemon = pinos_daemon_new (props);
|
||||
|
||||
if (pinos_module_load (daemon, "module-gst", &err) == NULL) {
|
||||
g_error ("could not load module-gst: %s", err->message);
|
||||
/* parse configuration */
|
||||
config = pinos_daemon_config_new ();
|
||||
if (!pinos_daemon_config_load (config, &err)) {
|
||||
g_error ("failed to parse config: %s", err->message);
|
||||
g_clear_error (&err);
|
||||
}
|
||||
|
||||
pinos_spa_alsa_sink_new (daemon, "alsa-sink", NULL);
|
||||
pinos_spa_v4l2_source_new (daemon, "v4l2-source", NULL);
|
||||
props = pinos_properties_new ("test", "test", NULL);
|
||||
daemon = pinos_daemon_new (props);
|
||||
|
||||
pinos_daemon_config_run_commands (config, daemon);
|
||||
|
||||
pinos_daemon_start (daemon);
|
||||
|
||||
g_main_loop_run (loop);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue