1 /* Simple Plugin API
2  *
3  * Copyright © 2019 Wim Taymans
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 
25 #ifndef SPA_UTILS_KEYS_H
26 #define SPA_UTILS_KEYS_H
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 /** \defgroup spa_keys  Key Names
33  * Key names used by SPA plugins
34  */
35 
36 /**
37  * \addtogroup spa_keys
38  * \{
39  */
40 
41 /** for objects */
42 #define SPA_KEY_OBJECT_PATH		"object.path"			/**< a unique path to
43 									  *  identity the object */
44 
45 #define SPA_KEY_MEDIA_CLASS		"media.class"			/**< Media class
46 									  *  Ex. "Audio/Device",
47 									  *  "Video/Source",... */
48 #define SPA_KEY_MEDIA_ROLE		"media.role"			/**< Role: Movie, Music, Camera,
49 									  *  Screen, Communication, Game,
50 									  *  Notification, DSP, Production,
51 									  *  Accessibility, Test */
52 /** keys for udev api */
53 #define SPA_KEY_API_UDEV		"api.udev"			/**< key for the udev api */
54 #define SPA_KEY_API_UDEV_MATCH		"api.udev.match"		/**< udev subsystem match */
55 
56 /** keys for alsa api */
57 #define SPA_KEY_API_ALSA		"api.alsa"			/**< key for the alsa api */
58 #define SPA_KEY_API_ALSA_PATH		"api.alsa.path"			/**< alsa device path as can be
59 									  *  used in snd_pcm_open() and
60 									  *  snd_ctl_open(). */
61 #define SPA_KEY_API_ALSA_CARD		"api.alsa.card"			/**< alsa card number */
62 #define SPA_KEY_API_ALSA_USE_UCM	"api.alsa.use-ucm"		/**< if UCM should be used */
63 #define SPA_KEY_API_ALSA_IGNORE_DB	"api.alsa.ignore-dB"		/**< if decibel info should be ignored */
64 #define SPA_KEY_API_ALSA_OPEN_UCM	"api.alsa.open.ucm"		/**< if UCM should be opened card */
65 
66 /** info from alsa card_info */
67 #define SPA_KEY_API_ALSA_CARD_ID	"api.alsa.card.id"		/**< id from card_info */
68 #define SPA_KEY_API_ALSA_CARD_COMPONENTS	\
69 					"api.alsa.card.components"	/**< components from card_info */
70 #define SPA_KEY_API_ALSA_CARD_DRIVER	"api.alsa.card.driver"		/**< driver from card_info */
71 #define SPA_KEY_API_ALSA_CARD_NAME	"api.alsa.card.name"		/**< name from card_info */
72 #define SPA_KEY_API_ALSA_CARD_LONGNAME	"api.alsa.card.longname"	/**< longname from card_info */
73 #define SPA_KEY_API_ALSA_CARD_MIXERNAME	"api.alsa.card.mixername"	/**< mixername from card_info */
74 
75 /** info from alsa pcm_info */
76 #define SPA_KEY_API_ALSA_PCM_ID		"api.alsa.pcm.id"		/**< id from pcm_info */
77 #define SPA_KEY_API_ALSA_PCM_CARD	"api.alsa.pcm.card"		/**< card from pcm_info */
78 #define SPA_KEY_API_ALSA_PCM_NAME	"api.alsa.pcm.name"		/**< name from pcm_info */
79 #define SPA_KEY_API_ALSA_PCM_SUBNAME	"api.alsa.pcm.subname"		/**< subdevice_name from pcm_info */
80 #define SPA_KEY_API_ALSA_PCM_STREAM	"api.alsa.pcm.stream"		/**< stream type from pcm_info */
81 #define SPA_KEY_API_ALSA_PCM_CLASS	"api.alsa.pcm.class"		/**< class from pcm_info as string */
82 #define SPA_KEY_API_ALSA_PCM_DEVICE	"api.alsa.pcm.device"		/**< device from pcm_info */
83 #define SPA_KEY_API_ALSA_PCM_SUBDEVICE	"api.alsa.pcm.subdevice"	/**< subdevice from pcm_info */
84 #define SPA_KEY_API_ALSA_PCM_SUBCLASS	"api.alsa.pcm.subclass"		/**< subclass from pcm_info as string */
85 #define SPA_KEY_API_ALSA_PCM_SYNC_ID	"api.alsa.pcm.sync-id"		/**< sync id */
86 
87 /** keys for v4l2 api */
88 #define SPA_KEY_API_V4L2		"api.v4l2"			/**< key for the v4l2 api */
89 #define SPA_KEY_API_V4L2_PATH		"api.v4l2.path"			/**< v4l2 device path as can be
90 									  *  used in open() */
91 
92 /** keys for libcamera api */
93 #define SPA_KEY_API_LIBCAMERA		"api.libcamera"			/**< key for the libcamera api */
94 #define SPA_KEY_API_LIBCAMERA_PATH	"api.libcamera.path"	/**< libcamera device path as can be
95 									  *  used in open() */
96 
97 /** info from libcamera_capability */
98 #define SPA_KEY_API_LIBCAMERA_CAP_DRIVER	"api.libcamera.cap.driver"	/**< driver from capbility */
99 #define SPA_KEY_API_LIBCAMERA_CAP_CARD	"api.libcamera.cap.card"		/**< caps from capability */
100 #define SPA_KEY_API_LIBCAMERA_CAP_BUS_INFO	"api.libcamera.cap.bus_info"/**< bus_info from capability */
101 #define SPA_KEY_API_LIBCAMERA_CAP_VERSION	"api.libcamera.cap.version"	/**< version from capability as %u.%u.%u */
102 #define SPA_KEY_API_LIBCAMERA_CAP_CAPABILITIES	\
103 					"api.libcamera.cap.capabilities"	/**< capabilities from capability */
104 #define SPA_KEY_API_LIBCAMERA_CAP_DEVICE_CAPS	\
105 					"api.libcamera.cap.device-caps"	/**< device_caps from capability */
106 /** info from v4l2_capability */
107 #define SPA_KEY_API_V4L2_CAP_DRIVER	"api.v4l2.cap.driver"		/**< driver from capbility */
108 #define SPA_KEY_API_V4L2_CAP_CARD	"api.v4l2.cap.card"		/**< caps from capability */
109 #define SPA_KEY_API_V4L2_CAP_BUS_INFO	"api.v4l2.cap.bus_info"		/**< bus_info from capability */
110 #define SPA_KEY_API_V4L2_CAP_VERSION	"api.v4l2.cap.version"		/**< version from capability as %u.%u.%u */
111 #define SPA_KEY_API_V4L2_CAP_CAPABILITIES	\
112 					"api.v4l2.cap.capabilities"	/**< capabilities from capability */
113 #define SPA_KEY_API_V4L2_CAP_DEVICE_CAPS	\
114 					"api.v4l2.cap.device-caps"	/**< device_caps from capability */
115 
116 
117 /** keys for bluez5 api */
118 #define SPA_KEY_API_BLUEZ5		"api.bluez5"			/**< key for the bluez5 api */
119 #define SPA_KEY_API_BLUEZ5_PATH		"api.bluez5.path"		/**< a bluez5 path */
120 #define SPA_KEY_API_BLUEZ5_DEVICE	"api.bluez5.device"		/**< an internal bluez5 device */
121 #define SPA_KEY_API_BLUEZ5_CONNECTION	"api.bluez5.connection"		/**< bluez5 device connection status */
122 #define SPA_KEY_API_BLUEZ5_TRANSPORT	"api.bluez5.transport"		/**< an internal bluez5 transport */
123 #define SPA_KEY_API_BLUEZ5_PROFILE	"api.bluez5.profile"		/**< a bluetooth profile */
124 #define SPA_KEY_API_BLUEZ5_ADDRESS	"api.bluez5.address"		/**< a bluetooth address */
125 #define SPA_KEY_API_BLUEZ5_CODEC	"api.bluez5.codec"		/**< a bluetooth codec */
126 #define SPA_KEY_API_BLUEZ5_CLASS	"api.bluez5.class"		/**< a bluetooth class */
127 #define SPA_KEY_API_BLUEZ5_ICON		"api.bluez5.icon"		/**< a bluetooth icon */
128 
129 /** keys for jack api */
130 #define SPA_KEY_API_JACK		"api.jack"			/**< key for the JACK api */
131 #define SPA_KEY_API_JACK_SERVER		"api.jack.server"		/**< a jack server name */
132 #define SPA_KEY_API_JACK_CLIENT		"api.jack.client"		/**< an internal jack client */
133 
134 /**
135  * \}
136  */
137 
138 #ifdef __cplusplus
139 }  /* extern "C" */
140 #endif
141 
142 #endif /* SPA_UTILS_KEYS_H */
143