}
/**
- * @brief Private function to fill in ".so list" with fullpath-filenames in a directory.
+ * @brief Private function to fill in ".so/.dylib list" with fullpath-filenames in a directory.
* @param[in] type conf type to scan.
* @param[in] dir Directory to be searched.
* @param[in/out] listF The fullpath list to be updated.
* @param[in/out] listB The basename list to be updated.
* @param[in/out] counter increased by the number of appended elements.
* @return True if successfully updated.
- * @todo This assumes .so for all sub plugins. Support Windows/Mac/iOS!
+ * @todo This assumes .so/.dylib for all sub plugins. Support Windows!
*/
static gboolean
_get_filenames (nnsconf_type_path type, const gchar * dir, GSList ** listF,
return FALSE;
while (NULL != (name = g_dir_read_name (gdir))) {
- /* check file prefix for given type, handle .so only. */
+ /* check file prefix for given type, currently handle .so and .dylib. */
if (g_str_has_prefix (name, subplugin_prefixes[type]) &&
- g_str_has_suffix (name, ".so")) {
+ g_str_has_suffix (name, NNSTREAMER_SO_FILE_EXTENSION)) {
fullpath = g_build_filename (dir, name, NULL);
if (_validate_file (type, fullpath)) {
nnsconf_loadconf (FALSE);
- filename = g_strconcat (subplugin_prefixes[type], subpluginname, ".so", NULL);
+ filename = g_strconcat (subplugin_prefixes[type], subpluginname,
+ NNSTREAMER_SO_FILE_EXTENSION, NULL);
ret = nnsconf_get_fullpath_from_file (filename, type);
g_free (filename);
#define NNSTREAMER_SYS_ROOT_PATH_PREFIX "/"
#endif /* G_OS_WIN32 */
+/**
+ * Hard-coded system-dependent file extension string of shared
+ * (dynamic loadable) object
+ */
+#ifdef __MACOS__
+#define NNSTREAMER_SO_FILE_EXTENSION ".dylib"
+#else
+#define NNSTREAMER_SO_FILE_EXTENSION ".so"
+#endif
+
/* Env-var names */
#define NNSTREAMER_ENVVAR_CONF_FILE "NNSTREAMER_CONF"
#define NNSTREAMER_ENVVAR_FILTERS "NNSTREAMER_FILTERS"