static void
initialize_web_extensions (WebKitWebContext *context)
{
- webkit_web_context_set_web_extensions_directory (context, gst_wpe_get_extension_path ());
+ const gchar *local_path = gst_wpe_get_uninstalled_extension_path ();
+ const gchar *path = g_file_test (local_path, G_FILE_TEST_IS_DIR) ? local_path : G_STRINGIFY (WPE_EXTENSION_INSTALL_DIR);
+ GST_INFO ("Loading WebExtension from %s", path);
+ webkit_web_context_set_web_extensions_directory (context, path);
}
static void
GST_DEBUG_CATEGORY (wpe_view_debug);
GST_DEBUG_CATEGORY (wpe_src_debug);
-const gchar *gst_wpe_get_extension_path (void)
+const gchar *gst_wpe_get_uninstalled_extension_path (void)
{
return extension_path;
}
subdir_done()
endif
+wpe_extension_install_dir = get_option('prefix') / get_option('libdir') / meson.project_name() / 'wpe-extension'
+
giounix_dep = dependency('gio-unix-2.0', required: false)
gstwpe = library('gstwpe',
['WPEThreadedView.cpp', 'gstwpe.cpp', 'gstwpevideosrc.cpp', 'gstwpesrcbin.cpp'],
dependencies : [egl_dep, wpe_dep, wpe_fdo_dep, gstallocators_dep, gstaudio_dep, gstvideo_dep, gstbase_dep, gstgl_dep, xkbcommon_dep, wl_server_dep, giounix_dep],
- cpp_args : gst_plugins_bad_args + ['-DHAVE_CONFIG_H=1'],
+ cpp_args : gst_plugins_bad_args + ['-DHAVE_CONFIG_H=1', '-DWPE_EXTENSION_INSTALL_DIR=' + wpe_extension_install_dir],
include_directories : [configinc],
install : true,
install_dir : plugins_install_dir)
c_args : ['-DHAVE_CONFIG_H=1'],
include_directories : [configinc],
install : true,
- install_dir : plugins_install_dir / 'wpe-extension')
-
+ install_dir : wpe_extension_install_dir)