diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index 2374781019..c30e6c9d15 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -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 GST_QUARK GstQuarkId diff --git a/gst/gst.c b/gst/gst.c index a67582fa62..9642ed7e3f 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -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: diff --git a/gst/gst.h b/gst/gst.h index 5c51d69cdb..07b1ec556c 100644 --- a/gst/gst.h +++ b/gst/gst.h @@ -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__ */ diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index 03ecb272e1..12cf80587e 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -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