From: Philippe Normand Date: Sat, 29 Jan 2022 10:24:36 +0000 (+0000) Subject: wpe: Install WebExtension in pkglibdir X-Git-Tag: 1.20.0~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8e4cce6cd3d9601ac4955ccbfbaef60ec61254f3;p=platform%2Fupstream%2Fgstreamer.git 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: --- diff --git a/subprojects/gst-plugins-bad/ext/wpe/WPEThreadedView.cpp b/subprojects/gst-plugins-bad/ext/wpe/WPEThreadedView.cpp index d3c85b5..d3fefc0 100644 --- a/subprojects/gst-plugins-bad/ext/wpe/WPEThreadedView.cpp +++ b/subprojects/gst-plugins-bad/ext/wpe/WPEThreadedView.cpp @@ -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 diff --git a/subprojects/gst-plugins-bad/ext/wpe/gstwpe.cpp b/subprojects/gst-plugins-bad/ext/wpe/gstwpe.cpp index ceca61e..1872811 100644 --- a/subprojects/gst-plugins-bad/ext/wpe/gstwpe.cpp +++ b/subprojects/gst-plugins-bad/ext/wpe/gstwpe.cpp @@ -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; } diff --git a/subprojects/gst-plugins-bad/ext/wpe/gstwpe.h b/subprojects/gst-plugins-bad/ext/wpe/gstwpe.h index da0d2c9..6d628da 100644 --- a/subprojects/gst-plugins-bad/ext/wpe/gstwpe.h +++ b/subprojects/gst-plugins-bad/ext/wpe/gstwpe.h @@ -21,4 +21,4 @@ #include -const gchar *gst_wpe_get_extension_path (void); +const gchar *gst_wpe_get_uninstalled_extension_path (void); diff --git a/subprojects/gst-plugins-bad/ext/wpe/meson.build b/subprojects/gst-plugins-bad/ext/wpe/meson.build index 580b8f4..fb6048e 100644 --- a/subprojects/gst-plugins-bad/ext/wpe/meson.build +++ b/subprojects/gst-plugins-bad/ext/wpe/meson.build @@ -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) diff --git a/subprojects/gst-plugins-bad/ext/wpe/wpe-extension/meson.build b/subprojects/gst-plugins-bad/ext/wpe/wpe-extension/meson.build index 7bf98d6..e1ef972 100644 --- a/subprojects/gst-plugins-bad/ext/wpe/wpe-extension/meson.build +++ b/subprojects/gst-plugins-bad/ext/wpe/wpe-extension/meson.build @@ -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)