• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
2  * Use of this source code is governed by a BSD-style license that can be
3  * found in the LICENSE file.
4  */
5 
6 #ifndef CRAS_CONFIG_H_
7 #define CRAS_CONFIG_H_
8 
9 #include "cras_types.h"
10 
11 #define CRAS_MIN_BUFFER_TIME_IN_US 1000 /* 1 milliseconds */
12 #define CRAS_MAX_BUFFER_TIME_IN_S 10 /* 10 seconds */
13 
14 #define CRAS_SERVER_RT_THREAD_PRIORITY 12
15 #define CRAS_CLIENT_RT_THREAD_PRIORITY 10
16 #define CRAS_CLIENT_NICENESS_LEVEL -10
17 #define CRAS_SOCKET_FILE ".cras_socket"
18 #define CRAS_PLAYBACK_SOCKET_FILE ".cras_playback"
19 #define CRAS_CAPTURE_SOCKET_FILE ".cras_capture"
20 /* Socket file paths for VMs. */
21 #define CRAS_VMS_LEGACY_SOCKET_FILE "vms/.cras_socket"
22 #define CRAS_VMS_UNIFIED_SOCKET_FILE "vms/.cras_unified"
23 /* Socket file paths for pluginVM. */
24 #define CRAS_PLUGIN_PLAYBACK_SOCKET_FILE "vms/plugin/playback/.cras_socket"
25 #define CRAS_PLUGIN_UNIFIED_SOCKET_FILE "vms/plugin/unified/.cras_socket"
26 
27 /* Maximum socket_path size, which is equals to sizeof(sun_path) in sockaddr_un
28  * structure.
29  */
30 #define CRAS_MAX_SOCKET_PATH_SIZE 108
31 
32 /* CRAS_CONFIG_FILE_DIR is defined as $sysconfdir/cras by the configure
33    script. */
34 
35 /* Gets the path to save UDS socket files. */
36 const char *cras_config_get_system_socket_file_dir();
37 
38 /* Fills sock_path by given connection type.
39  *
40  * Args:
41  *    conn_type - server socket connection type.
42  *    sock_path - socket path to be filled.
43  *
44  * Returns:
45  *    0 for success, positive error code on error.
46  */
47 int cras_fill_socket_path(enum CRAS_CONNECTION_TYPE conn_type, char *sock_path);
48 
49 #endif /* CRAS_CONFIG_H_ */
50