gst: API: gst_get_main_executable_path()

This is useful for plugins that need to inspect the
folder of the main executable in order to determine the
set of features they will expose, for example:

https://github.com/centricular/gstreamer-vst3

https://bugzilla.gnome.org/show_bug.cgi?id=788214
This commit is contained in:
Mathieu Duponchelle 2017-09-26 21:51:53 +02:00
parent 49e230ad1a
commit 895bb7bcd6
4 changed files with 26 additions and 0 deletions

View file

@ -31,6 +31,7 @@ gst_segtrap_set_enabled
gst_registry_fork_is_enabled
gst_registry_fork_set_enabled
gst_update_registry
gst_get_main_executable_path
<SUBSECTION Private>
GST_QUARK
GstQuarkId

View file

@ -368,6 +368,27 @@ find_executable_path (void)
}
#endif
/**
* gst_get_main_executable_path:
*
* This helper is mostly helpful for plugins that need to
* inspect the folder of the main executable to determine
* their set of features.
*
* When a plugin is initialized from the gst-plugin-scanner
* external process, the returned path will be the same as from the
* parent process.
*
* Returns: (transfer none): The path of the executable that
* initialized GStreamer, or %NULL if it could not be determined.
*
* Since: 1.14
*/
const gchar *
gst_get_main_executable_path (void)
{
return _gst_executable_path;
}
/**
* gst_init_check:

View file

@ -132,6 +132,9 @@ void gst_registry_fork_set_enabled (gboolean enabled);
GST_EXPORT
gboolean gst_update_registry (void);
GST_EXPORT
const gchar * gst_get_main_executable_path (void);
G_END_DECLS
#endif /* __GST_H__ */

View file

@ -691,6 +691,7 @@ EXPORTS
gst_int_range_get_type
gst_is_caps_features
gst_is_initialized
gst_get_main_executable_path
gst_iterator_copy
gst_iterator_filter
gst_iterator_find_custom