if (((flags & GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX)) &&
g_str_has_suffix (entry, *filenames)) {
return TRUE;
+ } else if (((flags & GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX)) &&
+ g_str_has_prefix (entry, *filenames)) {
+ return TRUE;
/* else it's an exact match that's needed */
} else if (strcmp (entry, *filenames) == 0) {
return TRUE;
GstPluginDependencyFlags flags)
{
const gchar *empty_filenames[] = { "", NULL };
- gboolean recurse_into_dirs, partial_names;
+ gboolean recurse_into_dirs, partial_names = FALSE;
guint i, hash = 0;
/* to avoid special-casing below (FIXME?) */
filenames = empty_filenames;
recurse_into_dirs = ! !(flags & GST_PLUGIN_DEPENDENCY_FLAG_RECURSE);
- partial_names = ! !(flags & GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX);
+
+ if ((flags & GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX) ||
+ (flags & GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX))
+ partial_names = TRUE;
/* if we can construct the exact paths to check with the data we have, just
* stat them one by one; this is more efficient than opening the directory
* @GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX : interpret
* filename argument as filter suffix and check all matching files in
* the directory
+ * @GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX : interpret
+ * filename argument as filter prefix and check all matching files in
+ * the directory. Since 1.8.
*
* Flags used in connection with gst_plugin_add_dependency().
*/
GST_PLUGIN_DEPENDENCY_FLAG_NONE = 0,
GST_PLUGIN_DEPENDENCY_FLAG_RECURSE = (1 << 0),
GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_DEFAULT_ONLY = (1 << 1),
- GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX = (1 << 2)
+ GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX = (1 << 2),
+ GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX = (1 << 3)
} GstPluginDependencyFlags;
/**