wpe: Fix build for version 2.44

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8203>
This commit is contained in:
Philippe Normand 2024-12-23 14:58:31 +01:00
parent 17e5491b60
commit d4bfbdcfb4
2 changed files with 29 additions and 1 deletions

View file

@ -45,6 +45,18 @@ G_MODULE_EXPORT void extension_initialize (WebKitWebExtension * extension);
static WebKitWebExtension *global_extension = NULL;
#ifndef WEBKIT_CHECK_VERSION
#define WEBKIT_MAJOR_VERSION (WPE_VERSION_MAJOR)
#define WEBKIT_MINOR_VERSION (WPE_VERSION_MINOR)
#define WEBKIT_MICRO_VERSION (WPE_VERSION_MICRO)
#define WEBKIT_CHECK_VERSION(major, minor, micro) \
(WEBKIT_MAJOR_VERSION > (major) || \
(WEBKIT_MAJOR_VERSION == (major) && WEBKIT_MINOR_VERSION > (minor)) || \
(WEBKIT_MAJOR_VERSION == (major) && WEBKIT_MINOR_VERSION == (minor) && \
WEBKIT_MICRO_VERSION >= (micro)))
#endif
#if !USE_WPE2 || WEBKIT_CHECK_VERSION(2, 46, 0)
static void
console_message_cb (WebKitWebPage * page,
WebKitConsoleMessage * console_message, gpointer data)
@ -55,13 +67,17 @@ console_message_cb (WebKitWebPage * page,
NULL);
g_free (message);
}
#endif
static void
web_page_created_callback (WebKitWebExtension * extension,
WebKitWebPage * web_page, gpointer data)
{
// WebKitConsoleMessage comes and goes.
#if !USE_WPE2 || WEBKIT_CHECK_VERSION(2, 46, 0)
g_signal_connect (web_page, "console-message-sent",
G_CALLBACK (console_message_cb), NULL);
#endif
}
void

View file

@ -1,7 +1,19 @@
# Some WPE versions (hello 2.38) don't export versioning macros for the WebProcess extension.
wpe_version = wpewebkit_dep.version().split('.')
wpe_version_major = wpe_version[0]
wpe_version_minor = wpe_version[1]
wpe_version_micro = wpe_version[2]
version_c_args = ['-DWPE_VERSION_MAJOR=' + wpe_version_major,
'-DWPE_VERSION_MINOR=' + wpe_version_minor,
'-DWPE_VERSION_MICRO=' + wpe_version_micro
]
library('gstwpeextension',
['gstwpeextension.c', 'gstwpeaudiosink.c', 'gstwpebusmsgforwarder.c'],
dependencies : [wpewebkit_dep, gst_dep, gstbase_dep, giounix_dep],
c_args : ['-DHAVE_CONFIG_H=1'] + gst_wpe_c_args,
c_args : ['-DHAVE_CONFIG_H=1'] + gst_wpe_c_args + version_c_args,
include_directories : [configinc],
install : true,
install_dir : wpe_extension_install_dir)