"Fossies" - the Fresh Open Source Software Archive

Member "pulseaudio-13.0/src/daemon/daemon-conf.h" (20 Nov 2018, 4871 Bytes) of package /linux/misc/pulseaudio-13.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "daemon-conf.h" see the Fossies "Dox" file reference documentation.

    1 #ifndef foodaemonconfhfoo
    2 #define foodaemonconfhfoo
    3 
    4 /***
    5   This file is part of PulseAudio.
    6 
    7   Copyright 2004-2006 Lennart Poettering
    8   Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
    9 
   10   PulseAudio is free software; you can redistribute it and/or modify
   11   it under the terms of the GNU Lesser General Public License as published
   12   by the Free Software Foundation; either version 2.1 of the License,
   13   or (at your option) any later version.
   14 
   15   PulseAudio is distributed in the hope that it will be useful, but
   16   WITHOUT ANY WARRANTY; without even the implied warranty of
   17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   18   General Public License for more details.
   19 
   20   You should have received a copy of the GNU Lesser General Public License
   21   along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
   22 ***/
   23 
   24 #include <pulse/sample.h>
   25 #include <pulse/channelmap.h>
   26 
   27 #include <pulsecore/log.h>
   28 #include <pulsecore/macro.h>
   29 #include <pulsecore/core.h>
   30 #include <pulsecore/core-util.h>
   31 
   32 #ifdef HAVE_SYS_RESOURCE_H
   33 #include <sys/resource.h>
   34 #endif
   35 
   36 /* The actual command to execute */
   37 typedef enum pa_daemon_conf_cmd {
   38     PA_CMD_DAEMON,  /* the default */
   39     PA_CMD_START,
   40     PA_CMD_HELP,
   41     PA_CMD_VERSION,
   42     PA_CMD_DUMP_CONF,
   43     PA_CMD_DUMP_MODULES,
   44     PA_CMD_KILL,
   45     PA_CMD_CHECK,
   46     PA_CMD_DUMP_RESAMPLE_METHODS,
   47     PA_CMD_CLEANUP_SHM
   48 } pa_daemon_conf_cmd_t;
   49 
   50 #ifdef HAVE_SYS_RESOURCE_H
   51 typedef struct pa_rlimit {
   52     rlim_t value;
   53     bool is_set;
   54 } pa_rlimit;
   55 #endif
   56 
   57 /* A structure containing configuration data for the PulseAudio server . */
   58 typedef struct pa_daemon_conf {
   59     pa_daemon_conf_cmd_t cmd;
   60     bool daemonize,
   61         fail,
   62         high_priority,
   63         realtime_scheduling,
   64         disallow_module_loading,
   65         use_pid_file,
   66         system_instance,
   67         no_cpu_limit,
   68         disable_shm,
   69         disable_memfd,
   70         avoid_resampling,
   71         disable_remixing,
   72         remixing_use_all_sink_channels,
   73         disable_lfe_remixing,
   74         load_default_script_file,
   75         disallow_exit,
   76         log_meta,
   77         log_time,
   78         flat_volumes,
   79         lock_memory,
   80         deferred_volume;
   81     pa_server_type_t local_server_type;
   82     int exit_idle_time,
   83         scache_idle_time,
   84         realtime_priority,
   85         nice_level,
   86         resample_method;
   87     char *script_commands, *dl_search_path, *default_script_file;
   88     pa_log_target *log_target;
   89     pa_log_level_t log_level;
   90     unsigned log_backtrace;
   91     char *config_file;
   92 
   93 #ifdef HAVE_SYS_RESOURCE_H
   94     pa_rlimit rlimit_fsize, rlimit_data, rlimit_stack, rlimit_core;
   95 #ifdef RLIMIT_RSS
   96     pa_rlimit rlimit_rss;
   97 #endif
   98 #ifdef RLIMIT_NOFILE
   99     pa_rlimit rlimit_nofile;
  100 #endif
  101 #ifdef RLIMIT_AS
  102     pa_rlimit rlimit_as;
  103 #endif
  104 #ifdef RLIMIT_NPROC
  105     pa_rlimit rlimit_nproc;
  106 #endif
  107 #ifdef RLIMIT_MEMLOCK
  108     pa_rlimit rlimit_memlock;
  109 #endif
  110 #ifdef RLIMIT_LOCKS
  111     pa_rlimit rlimit_locks;
  112 #endif
  113 #ifdef RLIMIT_SIGPENDING
  114     pa_rlimit rlimit_sigpending;
  115 #endif
  116 #ifdef RLIMIT_MSGQUEUE
  117     pa_rlimit rlimit_msgqueue;
  118 #endif
  119 #ifdef RLIMIT_NICE
  120     pa_rlimit rlimit_nice;
  121 #endif
  122 #ifdef RLIMIT_RTPRIO
  123     pa_rlimit rlimit_rtprio;
  124 #endif
  125 #ifdef RLIMIT_RTTIME
  126     pa_rlimit rlimit_rttime;
  127 #endif
  128 #endif
  129 
  130     unsigned default_n_fragments, default_fragment_size_msec;
  131     unsigned deferred_volume_safety_margin_usec;
  132     int deferred_volume_extra_delay_usec;
  133     unsigned lfe_crossover_freq;
  134     pa_sample_spec default_sample_spec;
  135     uint32_t alternate_sample_rate;
  136     pa_channel_map default_channel_map;
  137     size_t shm_size;
  138 } pa_daemon_conf;
  139 
  140 /* Allocate a new structure and fill it with sane defaults */
  141 pa_daemon_conf* pa_daemon_conf_new(void);
  142 void pa_daemon_conf_free(pa_daemon_conf*c);
  143 
  144 /* Load configuration data from the specified file overwriting the
  145  * current settings in *c. If filename is NULL load the default daemon
  146  * configuration file */
  147 int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename);
  148 
  149 /* Pretty print the current configuration data of the daemon. The
  150  * returned string has to be freed manually. The output of this
  151  * function may be parsed with pa_daemon_conf_load(). */
  152 char *pa_daemon_conf_dump(pa_daemon_conf *c);
  153 
  154 /* Load the configuration data from the process' environment
  155  * overwriting the current settings in *c. */
  156 int pa_daemon_conf_env(pa_daemon_conf *c);
  157 
  158 /* Set these configuration variables in the structure by passing a string */
  159 int pa_daemon_conf_set_log_target(pa_daemon_conf *c, const char *string);
  160 int pa_daemon_conf_set_log_level(pa_daemon_conf *c, const char *string);
  161 int pa_daemon_conf_set_resample_method(pa_daemon_conf *c, const char *string);
  162 int pa_daemon_conf_set_local_server_type(pa_daemon_conf *c, const char *string);
  163 
  164 const char *pa_daemon_conf_get_default_script_file(pa_daemon_conf *c);
  165 FILE *pa_daemon_conf_open_default_script_file(pa_daemon_conf *c);
  166 
  167 #endif