package=native_qt
-$(package)_version=6.5.2
+$(package)_version=6.5.3
$(package)_download_path=https://download.qt.io/official_releases/qt/6.5/$($(package)_version)/submodules
$(package)_suffix=everywhere-src-$($(package)_version).tar.xz
$(package)_file_name=qtbase-$($(package)_suffix)
-$(package)_sha256_hash=3db4c729b4d80a9d8fda8dd77128406353baff4755ca619177eda4cddae71269
+$(package)_sha256_hash=df2f4a230be4ea04f9798f2c19ab1413a3b8ec6a80bef359f50284235307b546
$(package)_qt_libs=corelib network widgets gui plugins testlib
$(package)_patches = dont_hardcode_pwd.patch
$(package)_patches += fast_fixed_dtoa_no_optimize.patch
$(package)_patches += root_CMakeLists.txt
$(package)_qttools_file_name=qttools-$($(package)_suffix)
-$(package)_qttools_sha256_hash=551ffb22751d8fd4d88e9ebd55b9131f4ca55341ee497fdbbba4da8d10d94341
+$(package)_qttools_sha256_hash=fc91d32b3f696725bbb48b0df240c25b606bbee3bd22627cfcbee876a6405e37
$(package)_qtsvg_file_name=qtsvg-$($(package)_suffix)
-$(package)_qtsvg_sha256_hash=48b4cc1093af2e0ab3bea30f60651bddd877a2335d16e7207879a2e9e81963a3
+$(package)_qtsvg_sha256_hash=fc41c47b69ca1f80473cd4b11996394155781105345392961d064d04f95d5bef
$(package)_qtmultimedia_file_name=qtmultimedia-$($(package)_suffix)
-$(package)_qtmultimedia_sha256_hash=948f00aa679e92839a2a71bd07245a92cc849af486607417ee4c334b2b998975
+$(package)_qtmultimedia_sha256_hash=ed64f3d2bb98c20cd12df19dbf84dc0233d9fcb2078fea812adf42eef9a0ff27
$(package)_qtshadertools_file_name=qtshadertools-$($(package)_suffix)
-$(package)_qtshadertools_sha256_hash=ca3fb0db8576c59b9c38bb4b271cc6e10aebeb54e2121f429f4ee80671fc0a3d
+$(package)_qtshadertools_sha256_hash=201b7b3a409f048e78c5defb90a70af423166313ad4386f8e6b83990ae0f3573
$(package)_extra_sources += $($(package)_qttools_file_name)
$(package)_extra_sources += $($(package)_qtsvg_file_name)
package=qt
-$(package)_version=6.5.2
+$(package)_version=6.5.3
$(package)_download_path=https://download.qt.io/official_releases/qt/6.5/$($(package)_version)/submodules
$(package)_suffix=everywhere-src-$($(package)_version).tar.xz
$(package)_file_name=qtbase-$($(package)_suffix)
-$(package)_sha256_hash=3db4c729b4d80a9d8fda8dd77128406353baff4755ca619177eda4cddae71269
+$(package)_sha256_hash=df2f4a230be4ea04f9798f2c19ab1413a3b8ec6a80bef359f50284235307b546
$(package)_darwin_dependencies=native_cctools native_qt openssl
$(package)_mingw32_dependencies=openssl native_qt
$(package)_linux_dependencies=openssl native_qt freetype fontconfig libxcb libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm libxcb_util_cursor dbus
-$(package)_patches += dont_hardcode_pwd.patch
$(package)_patches += fast_fixed_dtoa_no_optimize.patch
$(package)_patches += guix_cross_lib_path.patch
$(package)_patches += qtbase-moc-ignore-gcc-macro.patch
#$(package)_patches += fix-static-fontconfig-static-linking.patch
$(package)_qttools_file_name=qttools-$($(package)_suffix)
-$(package)_qttools_sha256_hash=551ffb22751d8fd4d88e9ebd55b9131f4ca55341ee497fdbbba4da8d10d94341
+$(package)_qttools_sha256_hash=fc91d32b3f696725bbb48b0df240c25b606bbee3bd22627cfcbee876a6405e37
$(package)_qtsvg_file_name=qtsvg-$($(package)_suffix)
-$(package)_qtsvg_sha256_hash=48b4cc1093af2e0ab3bea30f60651bddd877a2335d16e7207879a2e9e81963a3
+$(package)_qtsvg_sha256_hash=fc41c47b69ca1f80473cd4b11996394155781105345392961d064d04f95d5bef
$(package)_qtwebsockets_file_name=qtwebsockets-$($(package)_suffix)
-$(package)_qtwebsockets_sha256_hash=204bd7b0dffb54c934abc6cf0eb5e3016f11b3c9721a67b4875a6b21bb8b5c76
+$(package)_qtwebsockets_sha256_hash=04e2ae17594d56cf2930c99dbd2a97eb88ff514b445c17ff7b86e8978fc7a7c3
$(package)_qtmultimedia_file_name=qtmultimedia-$($(package)_suffix)
-$(package)_qtmultimedia_sha256_hash=948f00aa679e92839a2a71bd07245a92cc849af486607417ee4c334b2b998975
+$(package)_qtmultimedia_sha256_hash=ed64f3d2bb98c20cd12df19dbf84dc0233d9fcb2078fea812adf42eef9a0ff27
$(package)_qtshadertools_file_name=qtshadertools-$($(package)_suffix)
-$(package)_qtshadertools_sha256_hash=ca3fb0db8576c59b9c38bb4b271cc6e10aebeb54e2121f429f4ee80671fc0a3d
+$(package)_qtshadertools_sha256_hash=201b7b3a409f048e78c5defb90a70af423166313ad4386f8e6b83990ae0f3573
$(package)_extra_sources += $($(package)_qttools_file_name)
$(package)_extra_sources += $($(package)_qtsvg_file_name)
define $(package)_preprocess_cmds
cp $($(package)_patch_dir)/root_CMakeLists.txt CMakeLists.txt && \
- patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \
patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \
patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
patch -p1 -i $($(package)_patch_dir)/fast_fixed_dtoa_no_optimize.patch && \
+#endif
diff --git a/src/plugins/multimedia/v4l2/qffmpegmediaintegration.cpp b/src/plugins/multimedia/v4l2/qffmpegmediaintegration.cpp
new file mode 100644
-index 000000000..c07c0ebc7
+index 000000000..44d81e489
--- /dev/null
+++ b/src/plugins/multimedia/v4l2/qffmpegmediaintegration.cpp
-@@ -0,0 +1,130 @@
+@@ -0,0 +1,123 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+
+QFFmpegMediaIntegration::QFFmpegMediaIntegration()
+{
-+ m_formatsInfo = new QFFmpegMediaFormatInfo();
-+
+#if QT_CONFIG(linux_v4l)
+ m_videoDevices = std::make_unique<QV4L2CameraDevices>(this);
+#endif
+#endif
+}
+
-+QFFmpegMediaIntegration::~QFFmpegMediaIntegration()
-+{
-+ delete m_formatsInfo;
-+}
-+
-+QPlatformMediaFormatInfo *QFFmpegMediaIntegration::formatInfo()
++QPlatformMediaFormatInfo *QFFmpegMediaIntegration::createFormatInfo()
+{
-+ return m_formatsInfo;
++ return new QFFmpegMediaFormatInfo();
+}
+
+QMaybe<QPlatformMediaCaptureSession *> QFFmpegMediaIntegration::createCaptureSession()
+#include "qffmpegmediaintegration.moc"
diff --git a/src/plugins/multimedia/v4l2/qffmpegmediaintegration_p.h b/src/plugins/multimedia/v4l2/qffmpegmediaintegration_p.h
new file mode 100644
-index 000000000..8b44da741
+index 000000000..905c3efd5
--- /dev/null
+++ b/src/plugins/multimedia/v4l2/qffmpegmediaintegration_p.h
-@@ -0,0 +1,43 @@
+@@ -0,0 +1,45 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+{
+public:
+ QFFmpegMediaIntegration();
-+ ~QFFmpegMediaIntegration();
+
-+ static QFFmpegMediaIntegration *instance() { return static_cast<QFFmpegMediaIntegration *>(QPlatformMediaIntegration::instance()); }
-+ QPlatformMediaFormatInfo *formatInfo() override;
++ static QFFmpegMediaIntegration *instance()
++ {
++ return static_cast<QFFmpegMediaIntegration *>(QPlatformMediaIntegration::instance());
++ }
+
+ QMaybe<QPlatformMediaCaptureSession *> createCaptureSession() override;
+ QMaybe<QPlatformCamera *> createCamera(QCamera *) override;
+ QMaybe<QPlatformImageCapture *> createImageCapture(QImageCapture *) override;
+ QMaybe<QPlatformVideoSink *> createVideoSink(QVideoSink *sink) override;
+
-+ QFFmpegMediaFormatInfo *m_formatsInfo = nullptr;
++protected:
++ QPlatformMediaFormatInfo *createFormatInfo() override;
+};
+
+QT_END_NAMESPACE
+#endif
diff --git a/src/plugins/multimedia/v4l2/qv4l2camera.cpp b/src/plugins/multimedia/v4l2/qv4l2camera.cpp
new file mode 100644
-index 000000000..0f7a8c91a
+index 000000000..b635a7fce
--- /dev/null
+++ b/src/plugins/multimedia/v4l2/qv4l2camera.cpp
-@@ -0,0 +1,940 @@
+@@ -0,0 +1,949 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+
+QT_BEGIN_NAMESPACE
+
-+Q_LOGGING_CATEGORY(qLV4L2Camera, "qt.multimedia.ffmpeg.v4l2camera");
++static Q_LOGGING_CATEGORY(qLV4L2Camera, "qt.multimedia.ffmpeg.v4l2camera");
++
++static bool areCamerasEqual(QList<QCameraDevice> a, QList<QCameraDevice> b) {
++ auto areCamerasDataEqual = [](const QCameraDevice& a, const QCameraDevice& b) {
++ Q_ASSERT(QCameraDevicePrivate::handle(a));
++ Q_ASSERT(QCameraDevicePrivate::handle(b));
++ return *QCameraDevicePrivate::handle(a) == *QCameraDevicePrivate::handle(b);
++ };
++
++ return std::equal(a.cbegin(), a.cend(), b.cbegin(), b.cend(), areCamerasDataEqual);
++}
+
+QV4L2CameraDevices::QV4L2CameraDevices(QPlatformMediaIntegration *integration)
+ : QPlatformVideoDevices(integration)
+{
-+ deviceWatcher.addPath(QLatin1String("/dev"));
-+ connect(&deviceWatcher, &QFileSystemWatcher::directoryChanged, this, &QV4L2CameraDevices::checkCameras);
++ m_deviceWatcher.addPath(QLatin1String("/dev"));
++ connect(&m_deviceWatcher, &QFileSystemWatcher::directoryChanged, this, &QV4L2CameraDevices::checkCameras);
+ doCheckCameras();
+}
+
+QList<QCameraDevice> QV4L2CameraDevices::videoDevices() const
+{
-+ return cameras;
++ return m_cameras;
+}
+
+void QV4L2CameraDevices::checkCameras()
+{
-+ doCheckCameras();
-+ videoInputsChanged();
++ if (doCheckCameras())
++ emit videoInputsChanged();
+}
+
-+const struct {
++static const struct {
+ QVideoFrameFormat::PixelFormat fmt;
+ uint32_t v4l2Format;
+} formatMap[] = {
+}
+
+
-+void QV4L2CameraDevices::doCheckCameras()
++bool QV4L2CameraDevices::doCheckCameras()
+{
-+ cameras.clear();
++ QList<QCameraDevice> newCameras;
+
+ QDir dir(QLatin1String("/dev"));
+ const auto devices = dir.entryList(QDir::System);
+ continue;
+
+ QByteArray file = QFile::encodeName(dir.filePath(device));
-+ int fd = open(file.constData(), O_RDONLY);
++ const int fd = open(file.constData(), O_RDONLY);
+ if (fd < 0)
+ continue;
+
-+ QCameraDevicePrivate *camera = nullptr;
++ auto fileCloseGuard = qScopeGuard([fd](){ close(fd); });
++
+ v4l2_fmtdesc formatDesc = {};
+
+ struct v4l2_capability cap;
+ if (ioctl(fd, VIDIOC_QUERYCAP, &cap) < 0)
-+ goto fail;
++ continue;
+
+ if (cap.device_caps & V4L2_CAP_META_CAPTURE)
-+ goto fail;
++ continue;
+ if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE))
-+ goto fail;
++ continue;
+ if (!(cap.capabilities & V4L2_CAP_STREAMING))
-+ goto fail;
++ continue;
++
++ auto camera = std::make_unique<QCameraDevicePrivate>();
+
-+ camera = new QCameraDevicePrivate;
+ camera->id = file;
+ camera->description = QString::fromUtf8((const char *)cap.card);
+// qCDebug(qLV4L2Camera) << "found camera" << camera->id << camera->description;
+ frameSize.pixel_format = formatDesc.pixelformat;
+
+ while (!ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &frameSize)) {
++ ++frameSize.index;
+ if (frameSize.type != V4L2_FRMSIZE_TYPE_DISCRETE)
+ continue;
+
+ frameInterval.height = frameSize.discrete.height;
+
+ while (!ioctl(fd, VIDIOC_ENUM_FRAMEINTERVALS, &frameInterval)) {
++ ++frameInterval.index;
+ if (frameInterval.type != V4L2_FRMIVAL_TYPE_DISCRETE)
+ continue;
-+ ++frameInterval.index;
+ float rate = float(frameInterval.discrete.denominator)/float(frameInterval.discrete.numerator);
+ if (rate > max)
+ max = rate;
+ }
+
+// qCDebug(qLV4L2Camera) << " " << resolution << min << max;
-+ ++frameSize.index;
+
+ if (min <= max) {
-+ QCameraFormatPrivate *fmt = new QCameraFormatPrivate;
++ auto fmt = std::make_unique<QCameraFormatPrivate>();
+ fmt->pixelFormat = pixelFmt;
+ fmt->resolution = resolution;
+ fmt->minFrameRate = min;
+ fmt->maxFrameRate = max;
-+ camera->videoFormats.append(fmt->create());
++ camera->videoFormats.append(fmt.release()->create());
+ camera->photoResolutions.append(resolution);
+ }
+ }
+ }
+
+ // first camera is default
-+ camera->isDefault = first;
-+ first = false;
++ camera->isDefault = std::exchange(first, false);
+
-+ cameras.append(camera->create());
++ newCameras.append(camera.release()->create());
++ }
+
-+ close(fd);
-+ continue;
++ if (areCamerasEqual(m_cameras, newCameras))
++ return false;
+
-+ fail:
-+ if (camera)
-+ delete camera;
-+ close(fd);
-+ }
++ m_cameras = std::move(newCameras);
++ return true;
+}
+
+class QV4L2VideoBuffer : public QAbstractVideoBuffer
+QT_END_NAMESPACE
diff --git a/src/plugins/multimedia/v4l2/qv4l2camera_p.h b/src/plugins/multimedia/v4l2/qv4l2camera_p.h
new file mode 100644
-index 000000000..714b4c1db
+index 000000000..f5df691c3
--- /dev/null
+++ b/src/plugins/multimedia/v4l2/qv4l2camera_p.h
-@@ -0,0 +1,160 @@
+@@ -0,0 +1,159 @@
+// Copyright (C) 2021 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+
+QT_BEGIN_NAMESPACE
+
-+class QV4L2CameraDevices : public QObject,
-+ public QPlatformVideoDevices
++class QV4L2CameraDevices : public QPlatformVideoDevices
+{
+ Q_OBJECT
+public:
+ void checkCameras();
+
+private:
-+ void doCheckCameras();
++ bool doCheckCameras();
+
-+ QList<QCameraDevice> cameras;
-+ QFileSystemWatcher deviceWatcher;
++ QList<QCameraDevice> m_cameras;
++ QFileSystemWatcher m_deviceWatcher;
+};
+
+struct QV4L2CameraBuffers