wpe: Install WebExtension in pkglibdir

The uninstalled WebExtension takes precedence over the installed one, so that
audio support works in local developer builds as well.

Fixes #975

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1602>
This commit is contained in:
Philippe Normand 2022-01-29 10:24:36 +00:00 committed by GStreamer Marge Bot
parent f1449ac116
commit 8e4cce6cd3
5 changed files with 10 additions and 6 deletions

View file

@ -183,7 +183,10 @@ gpointer WPEContextThread::s_viewThread(gpointer data)
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

View file

@ -33,7 +33,7 @@ GST_DEBUG_CATEGORY (wpe_video_src_debug);
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;
}

View file

@ -21,4 +21,4 @@
#include <gst/gst.h>
const gchar *gst_wpe_get_extension_path (void);
const gchar *gst_wpe_get_uninstalled_extension_path (void);

View file

@ -16,11 +16,13 @@ if not wpe_dep.found() or not wpe_fdo_dep.found() or not egl_dep.found() or not
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)

View file

@ -4,5 +4,4 @@ library('gstwpeextension',
c_args : ['-DHAVE_CONFIG_H=1'],
include_directories : [configinc],
install : true,
install_dir : plugins_install_dir / 'wpe-extension')
install_dir : wpe_extension_install_dir)