diff options
-rw-r--r-- | configure.cmake | 8 | ||||
-rw-r--r-- | src/core/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/core/api/configure.cmake | 10 | ||||
-rw-r--r-- | src/webenginequick/api/qquickwebenginescriptcollection.cpp | 20 |
4 files changed, 29 insertions, 13 deletions
diff --git a/configure.cmake b/configure.cmake index f37910d7c..32b152c02 100644 --- a/configure.cmake +++ b/configure.cmake @@ -25,6 +25,7 @@ qt_webengine_set_version(vpx 1.10.0) qt_webengine_set_version(libavutil 58.29.100) qt_webengine_set_version(libavcodec 60.31.102) qt_webengine_set_version(libavformat 60.16.100) +qt_webengine_set_version(openh264 2.4.1) qt_webengine_set_version(windows_sdk 26100) # we only care about minor number "10.0.26100.0" if(QT_CONFIGURE_RUNNING) @@ -93,6 +94,7 @@ if(PkgConfig_FOUND) pkg_check_modules(XKBFILE xkbfile) pkg_check_modules(XCBDRI3 xcb-dri3) pkg_check_modules(LIBUDEV libudev) + pkg_check_modules(OPENH264 openh264>=${QT_CONFIGURE_CHECK_openh264_version}) endif() if(Python3_EXECUTABLE) @@ -723,6 +725,11 @@ qt_feature("webengine-system-libudev" PRIVATE CONDITION UNIX AND LIBUDEV_FOUND ) +qt_feature("webengine-system-openh264" PRIVATE + LABEL "openh264" + CONDITION UNIX AND OPENH264_FOUND +) + qt_feature("webengine-ozone-x11" PRIVATE LABEL "Support X11 on qpa-xcb" CONDITION LINUX @@ -778,6 +785,7 @@ if(UNIX) qt_configure_add_summary_entry(ARGS "webengine-system-freetype") qt_configure_add_summary_entry(ARGS "webengine-system-libpci") qt_configure_add_summary_entry(ARGS "webengine-system-libudev") + qt_configure_add_summary_entry(ARGS "webengine-system-openh264") qt_configure_end_summary_section() endif() diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 23dc00dfa..ff8c958cb 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -535,6 +535,10 @@ foreach(arch ${archs}) CONDITION QT_FEATURE_webengine_system_gbm ) extend_gn_list(gnArgArg + ARGS rtc_system_openh264 + CONDITION QT_FEATURE_webengine_webrtc_system_openh264 + ) + extend_gn_list(gnArgArg ARGS use_vaapi CONDITION QT_FEATURE_webengine_vaapi ) diff --git a/src/core/api/configure.cmake b/src/core/api/configure.cmake index 4a556656e..79f44f9a2 100644 --- a/src/core/api/configure.cmake +++ b/src/core/api/configure.cmake @@ -84,6 +84,12 @@ qt_feature("webengine-system-gbm" PRIVATE AUTODETECT UNIX CONDITION GBM_FOUND ) +qt_feature("webengine-webrtc-system-openh264" PRIVATE + LABEL "Use system openh264 for webrtc" + CONDITION UNIX + AND QT_FEATURE_webengine_system_openh264 + AND QT_FEATURE_webengine_proprietary_codecs +) qt_feature("webengine-printing-and-pdf" PRIVATE LABEL "Printing and PDF" PURPOSE "Provides printing and output to PDF." @@ -224,6 +230,10 @@ qt_configure_add_summary_entry( ARGS "webengine-system-pulseaudio" CONDITION LINUX ) +qt_configure_add_summary_entry( + ARGS "webengine-webrtc-system-openh264" + CONDITION UNIX +) qt_configure_add_summary_entry(ARGS "webengine-v8-context-snapshot") qt_configure_add_summary_entry(ARGS "webenginedriver") qt_configure_end_summary_section() # end of "Qt WebEngineCore" section diff --git a/src/webenginequick/api/qquickwebenginescriptcollection.cpp b/src/webenginequick/api/qquickwebenginescriptcollection.cpp index 7a3e894a6..09a8d181e 100644 --- a/src/webenginequick/api/qquickwebenginescriptcollection.cpp +++ b/src/webenginequick/api/qquickwebenginescriptcollection.cpp @@ -3,12 +3,10 @@ #include "qquickwebenginescriptcollection_p.h" #include "qquickwebenginescriptcollection_p_p.h" -#include "qwebenginescriptcollection.h" +#include <QtWebEngineCore/qwebenginescriptcollection.h> #include <QtWebEngineCore/private/qwebenginescriptcollection_p.h> #include <QtQml/qqmlinfo.h> -#include <QtQml/private/qqmlengine_p.h> -#include <QtQml/private/qv4scopedvalue_p.h> -#include <QtQml/private/qv4arrayobject_p.h> +#include <QtQml/qqmlengine.h> /*! \qmltype WebEngineScriptCollection @@ -198,15 +196,11 @@ QJSValue QQuickWebEngineScriptCollection::collection() const } const QList<QWebEngineScript> &list = d->toList(); - QV4::ExecutionEngine *v4 = d->m_qmlEngine->handle(); - QV4::Scope scope(v4); - QV4::Scoped<QV4::ArrayObject> scriptArray(scope, v4->newArrayObject(list.size())); - int i = 0; - for (const auto &val : list) { - QV4::ScopedValue sv(scope, v4->fromVariant(QVariant::fromValue(val))); - scriptArray->put(i++, sv); - } - return QJSValuePrivate::fromReturnedValue(scriptArray.asReturnedValue()); + QJSValue scriptArray = d->m_qmlEngine->newArray(list.size()); + uint32_t i = 0; + for (const auto &val : list) + scriptArray.setProperty(i++, d->m_qmlEngine->toScriptValue(val)); + return scriptArray; } void QQuickWebEngineScriptCollection::setCollection(const QJSValue &scripts) |