From e21005045af9c7f422ca39f25818b5fe52bb7d6c Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Tue, 6 Jan 2026 11:30:37 +0100 Subject: [PATCH] Remove QtMultimedia dependency --- Linphone/CMakeLists.txt | 2 +- Linphone/tool/CMakeLists.txt | 2 +- Linphone/tool/providers/ThumbnailProvider.cpp | 13 ++-- Linphone/tool/providers/ThumbnailProvider.hpp | 4 +- .../Display/Chat/ChatMessageContent.qml | 6 +- .../view/Control/Display/Chat/FileView.qml | 45 ++++++----- .../Control/Display/Chat/VideoFileView.qml | 77 +++++++++---------- README.md | 4 +- 8 files changed, 76 insertions(+), 77 deletions(-) diff --git a/Linphone/CMakeLists.txt b/Linphone/CMakeLists.txt index 632c0e337..776fd415a 100644 --- a/Linphone/CMakeLists.txt +++ b/Linphone/CMakeLists.txt @@ -22,7 +22,7 @@ set(APP_TARGETS ${LinphoneCxx_TARGET} ${LibLinphone_TARGET})#Liblinphone set(QT_DEFAULT_MAJOR_VERSION 6) -set(QT_PACKAGES Quick Qml Widgets Svg Multimedia Test NetworkAuth Concurrent)# Search Core at first for initialize Qt scripts for next find_packages. +set(QT_PACKAGES Quick Qml Widgets Svg Test NetworkAuth Concurrent)# Search Core at first for initialize Qt scripts for next find_packages. if (UNIX AND NOT APPLE) list(APPEND QT_PACKAGES DBus) endif() diff --git a/Linphone/tool/CMakeLists.txt b/Linphone/tool/CMakeLists.txt index 0235157dc..fc9d2ab87 100644 --- a/Linphone/tool/CMakeLists.txt +++ b/Linphone/tool/CMakeLists.txt @@ -15,7 +15,7 @@ list(APPEND _LINPHONEAPP_SOURCES tool/providers/ImageProvider.cpp tool/providers/ScreenProvider.cpp tool/providers/ThumbnailProvider.cpp - tool/providers/VideoFrameGrabber.cpp + # tool/providers/VideoFrameGrabber.cpp tool/native/DesktopTools.hpp diff --git a/Linphone/tool/providers/ThumbnailProvider.cpp b/Linphone/tool/providers/ThumbnailProvider.cpp index def19a9bd..79af4c960 100644 --- a/Linphone/tool/providers/ThumbnailProvider.cpp +++ b/Linphone/tool/providers/ThumbnailProvider.cpp @@ -36,7 +36,7 @@ const QString ThumbnailProvider::ProviderId = "thumbnail"; ThumbnailAsyncImageResponse::ThumbnailAsyncImageResponse(const QString &id, const QSize &requestedSize) { mPath = id; - connect(&mListener, &VideoFrameGrabberListener::imageGrabbed, this, &ThumbnailAsyncImageResponse::imageGrabbed); + // connect(&mListener, &VideoFrameGrabberListener::imageGrabbed, this, &ThumbnailAsyncImageResponse::imageGrabbed); if (QFileInfo(mPath).isFile()) { bool removeExportedFile = SettingsModel::getInstance()->getVfsEncrypted(); @@ -53,11 +53,12 @@ ThumbnailAsyncImageResponse::ThumbnailAsyncImageResponse(const QString &id, cons if (!format.isEmpty()) { originalImage = QImage(mPath, format); } else if (Utils::isVideo(mPath)) { - VideoFrameGrabber *grabber = new VideoFrameGrabber(removeExportedFile); - removeExportedFile = false; - connect(grabber, &VideoFrameGrabber::grabFinished, &mListener, - &VideoFrameGrabberListener::imageGrabbed); - grabber->requestFrame(mPath); + originalImage = QImage(mPath); + // VideoFrameGrabber *grabber = new VideoFrameGrabber(removeExportedFile); + // removeExportedFile = false; + // connect(grabber, &VideoFrameGrabber::grabFinished, &mListener, + // &VideoFrameGrabberListener::imageGrabbed); + // grabber->requestFrame(mPath); } } if (removeExportedFile) QFile(mPath).remove(); diff --git a/Linphone/tool/providers/ThumbnailProvider.hpp b/Linphone/tool/providers/ThumbnailProvider.hpp index 9314030b8..b935f3dfa 100644 --- a/Linphone/tool/providers/ThumbnailProvider.hpp +++ b/Linphone/tool/providers/ThumbnailProvider.hpp @@ -23,7 +23,7 @@ #include -#include "VideoFrameGrabber.hpp" +// #include "VideoFrameGrabber.hpp" #include "tool/AbstractObject.hpp" // Thumbnails are created asynchronously with QQuickAsyncImageProvider and not QQuickImageProvider. @@ -43,7 +43,7 @@ public: QImage mImage; QString mPath; - VideoFrameGrabberListener mListener; + // VideoFrameGrabberListener mListener; private: DECLARE_ABSTRACT_OBJECT diff --git a/Linphone/view/Control/Display/Chat/ChatMessageContent.qml b/Linphone/view/Control/Display/Chat/ChatMessageContent.qml index f3b04670b..024ed8890 100644 --- a/Linphone/view/Control/Display/Chat/ChatMessageContent.qml +++ b/Linphone/view/Control/Display/Chat/ChatMessageContent.qml @@ -109,10 +109,10 @@ ColumnLayout { Layout.fillWidth: true width: Math.min(Utils.getSizeWithScreenRatio(285), mainItem.maxWidth) height: Math.min(Utils.getSizeWithScreenRatio(285), mainItem.maxWidth) - Layout.preferredWidth: videoOutput.contentRect.width - Layout.preferredHeight: videoOutput.contentRect.height + Layout.preferredWidth: width + Layout.preferredHeight: height Layout.alignment: Qt.AlignHCenter - fillMode: VideoOutput.PreserveAspectFit + // fillMode: VideoOutput.PreserveAspectFit } // FILES diff --git a/Linphone/view/Control/Display/Chat/FileView.qml b/Linphone/view/Control/Display/Chat/FileView.qml index 494dad6c2..188d14326 100644 --- a/Linphone/view/Control/Display/Chat/FileView.qml +++ b/Linphone/view/Control/Display/Chat/FileView.qml @@ -1,7 +1,6 @@ import QtQuick import QtQuick.Controls as Control import QtQuick.Layouts -import QtMultimedia import Linphone import UtilsCpp @@ -107,35 +106,35 @@ Item { visible: mainItem.isVideo color: DefaultStyle.grey_1000 anchors.fill: parent - Video { - id: videoThumbnail - anchors.fill: parent - position: 100 - source: mainItem.isVideo ? "file:///" + mainItem.filePath : "" - fillMode: playbackState === MediaPlayer.PlayingState ? VideoOutput.PreserveAspectFit : VideoOutput.PreserveAspectCrop + // Video { + // id: videoThumbnail + // anchors.fill: parent + // position: 100 + // source: mainItem.isVideo ? "file:///" + mainItem.filePath : "" + // fillMode: playbackState === MediaPlayer.PlayingState ? VideoOutput.PreserveAspectFit : VideoOutput.PreserveAspectCrop EffectImage { anchors.centerIn: parent - visible: videoThumbnail.playbackState !== MediaPlayer.PlayingState + // visible: videoThumbnail.playbackState !== MediaPlayer.PlayingState width: Utils.getSizeWithScreenRatio(24) height: Utils.getSizeWithScreenRatio(24) imageSource: AppIcons.playFill colorizationColor: DefaultStyle.main2_0 } - Text { - z: parent.z + 1 - property int timeDisplayed: videoThumbnail.playbackState === MediaPlayer.PlayingState ? videoThumbnail.position : videoThumbnail.duration - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.bottomMargin: Utils.getSizeWithScreenRatio(6) - anchors.leftMargin: Utils.getSizeWithScreenRatio(6) - text: UtilsCpp.formatDuration(timeDisplayed) - color: DefaultStyle.grey_0 - font { - pixelSize: Typography.d1.pixelSize - weight: Typography.d1.weight - } - } - } + // Text { + // z: parent.z + 1 + // property int timeDisplayed: videoThumbnail.playbackState === MediaPlayer.PlayingState ? videoThumbnail.position : videoThumbnail.duration + // anchors.bottom: parent.bottom + // anchors.left: parent.left + // anchors.bottomMargin: Utils.getSizeWithScreenRatio(6) + // anchors.leftMargin: Utils.getSizeWithScreenRatio(6) + // text: UtilsCpp.formatDuration(timeDisplayed) + // color: DefaultStyle.grey_0 + // font { + // pixelSize: Typography.d1.pixelSize + // weight: Typography.d1.weight + // } + // } + // } } } } diff --git a/Linphone/view/Control/Display/Chat/VideoFileView.qml b/Linphone/view/Control/Display/Chat/VideoFileView.qml index e24208377..6f48eb739 100644 --- a/Linphone/view/Control/Display/Chat/VideoFileView.qml +++ b/Linphone/view/Control/Display/Chat/VideoFileView.qml @@ -1,56 +1,55 @@ import QtQuick import QtQuick.Controls as Control import QtQuick.Layouts -import QtMultimedia +// import QtMultimedia import Linphone import UtilsCpp import 'qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js' as Utils // ============================================================================= - Rectangle { id: mainItem color: DefaultStyle.grey_1000 property ChatMessageContentGui contentGui property string filePath: contentGui && contentGui.core.filePath - property var fillMode: playbackState === MediaPlayer.PlayingState ? VideoOutput.PreserveAspectFit : VideoOutput.PreserveAspectCrop - property alias videoOutput: output - property string source: mediaPlayer.source + // property var fillMode: playbackState === MediaPlayer.PlayingState ? VideoOutput.PreserveAspectFit : VideoOutput.PreserveAspectCrop + // property alias videoOutput: output + // property string source: mediaPlayer.source - MediaPlayer { - id: mediaPlayer - source: UtilsCpp.isVideo(mainItem.filePath) ? "file:///" + mainItem.filePath : "" - position: 100 - videoOutput: output - } - VideoOutput { - id: output - fillMode: mainItem.fillMode - endOfStreamPolicy: VideoOutput.KeepLastFrame - width: mainItem.width - height: mainItem.height - Component.onCompleted: { - // We need to start the video so the content rect of the - // video output is updated - mediaPlayer.play() - mediaPlayer.pause() - } - Text { - z: parent.z + 1 - property int timeDisplayed: mediaPlayer.playbackState === MediaPlayer.PlayingState ? mediaPlayer.position : mediaPlayer.duration - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.bottomMargin: Utils.getSizeWithScreenRatio(6) - anchors.leftMargin: Utils.getSizeWithScreenRatio(6) - text: UtilsCpp.formatDuration(timeDisplayed) - color: DefaultStyle.grey_0 - font { - pixelSize: Typography.d1.pixelSize - weight: Typography.d1.weight - } - } - } + // MediaPlayer { + // id: mediaPlayer + // source: UtilsCpp.isVideo(mainItem.filePath) ? "file:///" + mainItem.filePath : "" + // position: 100 + // videoOutput: output + // } + // VideoOutput { + // id: output + // fillMode: mainItem.fillMode + // endOfStreamPolicy: VideoOutput.KeepLastFrame + // width: mainItem.width + // height: mainItem.height + // Component.onCompleted: { + // // We need to start the video so the content rect of the + // // video output is updated + // mediaPlayer.play() + // mediaPlayer.pause() + // } + // Text { + // z: parent.z + 1 + // property int timeDisplayed: mediaPlayer.playbackState === MediaPlayer.PlayingState ? mediaPlayer.position : mediaPlayer.duration + // anchors.bottom: parent.bottom + // anchors.left: parent.left + // anchors.bottomMargin: Utils.getSizeWithScreenRatio(6) + // anchors.leftMargin: Utils.getSizeWithScreenRatio(6) + // text: UtilsCpp.formatDuration(timeDisplayed) + // color: DefaultStyle.grey_0 + // font { + // pixelSize: Typography.d1.pixelSize + // weight: Typography.d1.weight + // } + // } + // } MouseArea { propagateComposedEvents: false enabled: mainItem.visible @@ -71,7 +70,7 @@ Rectangle { } EffectImage { anchors.centerIn: parent - visible: mediaPlayer.playbackState !== MediaPlayer.PlayingState + // visible: mediaPlayer.playbackState !== MediaPlayer.PlayingState width: Utils.getSizeWithScreenRatio(24) height: Utils.getSizeWithScreenRatio(24) imageSource: AppIcons.playFill diff --git a/README.md b/README.md index 296e930b9..5ae1e7225 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ For Desktop : you will need QT6 (_6.10.0 or newer_). `C++17` support is required - Using the [official QT installer](https://www.qt.io/download-thank-you) - Using an alternative installer like [aqtinstall](https://github.com/miurahr/aqtinstall) -The following QT optional modules are required: qtmultimedia qtnetworkauth qtshadertools . +The following QT optional modules are required: qtnetworkauth qtshadertools . If you wan't to build with Crash handler, you need to install the following tools: - clang @@ -266,7 +266,7 @@ For Fedora (42), the required packages are: - qt6-qtbase-devel - qt6-qttools-devel - qt6-qtsvg-devel - - qt6-qtmultimedia-devel + - qt6-qtnetworkauth-devel - qt6-qtquick3d-devel - qt6-qtlanguageserver-devel