Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop/qt6.8 #564

Merged
merged 7 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 28 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,65 +1,84 @@
cmake_minimum_required(VERSION 3.0)
# 设置CMake的最低版本要求为3.0
cmake_minimum_required(VERSION 3.5)

# 定义项目名称为deepin-movie-reborn
project(deepin-movie-reborn)


# 定义选项,用于控制是否启用dxcb平台插件的集成,默认关闭
option(USE_DXCB "integration with dxcb platform plugin" OFF)
# 定义选项,用于控制是否开启调试输出,默认关闭
option(DMR_DEBUG "turn on debug output" off)
# 定义选项,用于控制是否开启dman portal支持,默认关闭
option(DTK_DMAN_PORTAL "turn on dman portal support" off)

# 执行命令获取当前系统的架构信息,存储在变量MACH中
execute_process(COMMAND uname -m OUTPUT_VARIABLE MACH
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)

# 如果构建类型是Debug,则开启调试输出
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(DMR_DEBUG on)
endif()

# 如果使用GNU编译器,设置C++标准为C++11
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()

# 设置C++标准为C++17
set(CMAKE_CXX_STANDARD 17)

# 导出编译命令到compile_commands.json文件
set(CMAKE_EXPORT_COMPILE_COMMANDS on)

# 查找PkgConfig包管理工具
find_package(PkgConfig REQUIRED)
find_package(Qt5Core)

pkg_check_modules(MPRIS REQUIRED IMPORTED_TARGET mpris-qt5)
# 使用PkgConfig查找mpris-qt5库
#pkg_check_modules(MPRIS REQUIRED IMPORTED_TARGET mpris-qt5)
pkg_check_modules(MPRIS REQUIRED IMPORTED_TARGET mpris-qt6)

# test deepin fork mpris-qt5
# 测试是否使用deepin fork的mpris-qt5
try_compile(USE_FORK_MPRIS
${CMAKE_CURRENT_BINARY_DIR}/try_compile
SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/tests/mpris_test.cc
LINK_LIBRARIES
PkgConfig::MPRIS
Qt5::Core
OUTPUT_VARIABLE TRY_COMPILE_OUTPUT
)

message(STATUS "use deepin fork mpris-qt5: ${USE_FORK_MPRIS}")
# 输出是否使用deepin fork的mpris-qt5
#message(STATUS "use deepin fork mpris-qt5: ${USE_FORK_MPRIS}")

# 如果使用deepin fork的mpris-qt5,添加编译定义
if(USE_FORK_MPRIS)
add_definitions(-DUSE_FORK_MPRIS)
endif()

# Find includes in corresponding build directories
# 在相应的构建目录中查找包含文件
set(CMAKE_INCLUDE_CURRENT_DIR ON)

# 包含项目的二进制目录和源代码目录
include_directories(${PROJECT_BINARY_DIR})
include_directories(${PROJECT_SOURCE_DIR})

# 包含GNU安装目录模块
include(GNUInstallDirs)
# 如果安装前缀未初始化为默认值,则设置安装前缀为/usr
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX /usr)
endif()

# 配置文件,将config.h.in转换为config.h
configure_file(${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h @ONLY)

# 添加src子目录
add_subdirectory(src)
# 添加examples/test子目录
add_subdirectory(examples/test)

# 如果构建类型是Debug,添加tests子目录
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_subdirectory(tests)
# add_subdirectory(tests)
endif()
2 changes: 1 addition & 1 deletion arm64/linglong.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: "1"
package:
id: org.deepin.movie
name: "deepin-movie"
version: 5.15.10.1
version: 5.15.13.1
kind: app
description: |
movie for deepin os.
Expand Down
19 changes: 19 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
deepin-movie-reborn (5.15.13) unstable; urgency=medium

* fix: Fixed the issue that OpenGL could not be played

-- renbin <renbin@uniontech.com> Fri, 17 Jan 2025 15:56:54 +0800

deepin-movie-reborn (5.15.12) unstable; urgency=medium

* chore: New version 5.15.12.

-- xiepengfei <xiepengfei@uniontech.com> Fri, 10 Jan 2025 18:16:49 +0800

deepin-movie-reborn (5.15.11) unstable; urgency=medium

* qt6.8 version
* Update version to 5.15.11

-- Liu zheng <liuzheng@uniontech.com> Fri, 10 Jan 2025 08:59:01 +0800

deepin-movie-reborn (5.15.10) unstable; urgency=medium

* Update version to 5.15.10
Expand Down
54 changes: 40 additions & 14 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,57 @@ Source: deepin-movie-reborn
Section: libdevel
Priority: extra
Maintainer: Deepin Packages Builder <packages@deepin.com>
Build-Depends: debhelper, cmake, pkg-config, qttools5-dev-tools,
libqt5svg5-dev, qtmultimedia5-dev, qttools5-dev,
libqt5x11extras5-dev, libdtkcore5-bin, libdtkwidget-dev,
libqt5sql5-sqlite,
libmpv-dev, libxcb1-dev, libxcb-util0-dev,
libffmpegthumbnailer-dev,
libxcb-shape0-dev,libxcb-ewmh-dev, xcb-proto,
x11proto-record-dev, libxtst-dev,
libavcodec-dev, libavformat-dev,libavutil-dev,
libpulse-dev, libdvdnav-dev, libgsettings-qt-dev,
libmpris-qt5-dev, libdbusextended-qt5-dev, libva-dev,
libgstreamer-plugins-base1.0-dev, libgstreamer1.0-dev
Build-Depends:
debhelper,
cmake,
pkg-config,
libmpv-dev,
libxcb1-dev,
libxcb-util0-dev,
libffmpegthumbnailer-dev,
libxcb-shape0-dev,
libxcb-ewmh-dev,
xcb-proto,
x11proto-record-dev,
libxtst-dev,
libavcodec-dev,
libavformat-dev,
libavutil-dev,
libpulse-dev,
libdvdnav-dev,
libgsettings-qt-dev,
libva-dev,
libgstreamer-plugins-base1.0-dev,
libgstreamer1.0-dev,
# qt6
qt6-base-dev,
qt6-base-dev-tools,
qt6-base-private-dev,
qt6-l10n-tools,
qt6-svg-dev,
qt6-tools-dev-tools,
qt6-tools-dev,
qt6-multimedia-dev,
libqt6sql6-sqlite,
libmpris-qt6-dev,
libqt6opengl6-dev,
# dtk
libdtk6gui-dev,
libdtk6widget-dev,
libdtk6core-dev
Standards-Version: 3.9.8
Homepage: https://www.deepin.org/

Package: deepin-movie
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, va-driver-all, libavcodec58(>= 7:4.0) | libavcodec60(>= 7:6.0), libavformat58(>= 7:4.1) | libavformat60(>= 7:6.0), libavutil56(>= 7:4.0) | libavutil58(>= 7:6.0), libffmpegthumbnailer4v5, libmpv1(>= 0.29) | libmpv2(>= 0.36), libpulse0(>= 0.99.1), libqt5concurrent5, libmpris-qt5-1, libgstreamer-plugins-base1.0-0 (>= 1.0.0), libgstreamer1.0-0 (>= 1.4.0)
Depends: ${shlibs:Depends}, ${misc:Depends}, va-driver-all, libavcodec58(>= 7:4.0) | libavcodec60(>= 7:6.0), libavformat58(>= 7:4.1) | libavformat60(>= 7:6.0), libavutil56(>= 7:4.0) | libavutil58(>= 7:6.0), libffmpegthumbnailer4v5, libmpv1(>= 0.29) | libmpv2(>= 0.36), libpulse0(>= 0.99.1), libgstreamer-plugins-base1.0-0 (>= 1.0.0), libgstreamer1.0-0 (>= 1.4.0)
Recommends: libgpuinfo, uos-reporter, deepin-event-log
Description: movie player
Movie is a full-featured video player, supporting playing local and streaming media in multiple video formats.

Package: libdmr
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libavcodec58(>= 7:4.0) | libavcodec60(>= 7:6.0), libavformat58(>= 7:4.1) | libavformat60(>= 7:6.0), libavutil56(>= 7:4.0) | libavutil58(>= 7:6.0), libffmpegthumbnailer4v5, libmpv1(>= 0.29) | libmpv2(>= 0.36), libpulse0(>= 0.99.1), libqt5concurrent5, libmpris-qt5-1, libgstreamer-plugins-base1.0-0 (>= 1.0.0), libgstreamer1.0-0 (>= 1.4.0)
Depends: ${shlibs:Depends}, ${misc:Depends}, libavcodec58(>= 7:4.0) | libavcodec60(>= 7:6.0), libavformat58(>= 7:4.1) | libavformat60(>= 7:6.0), libavutil56(>= 7:4.0) | libavutil58(>= 7:6.0), libffmpegthumbnailer4v5, libmpv1(>= 0.29) | libmpv2(>= 0.36), libpulse0(>= 0.99.1), libgstreamer-plugins-base1.0-0 (>= 1.0.0), libgstreamer1.0-0 (>= 1.4.0)
Multi-Arch: same
Description: movie player widget library
deepin movie player widget library
Expand Down
13 changes: 10 additions & 3 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
#!/usr/bin/make -f
include /usr/share/dpkg/default.mk
export QT_SELECT=5
export QT_SELECT=6
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
dh $@ --parallel
dh $@ --parallel --with-compat=10

override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DAPP_VERSION=$(DEB_VERSION_UPSTREAM) -DVERSION=$(DEB_VERSION_UPSTREAM) LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH)
-DAPP_VERSION=$(DEB_VERSION_UPSTREAM) \
-DVERSION=$(DEB_VERSION_UPSTREAM) \
-DLIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
-DQT_VERSION=6

override_dh_install:
dh_install --exclude=usr/share/dsg/configs/org.deepin.movie \
--exclude=usr/lib/uos-ai-assistant/functions

55 changes: 38 additions & 17 deletions examples/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,52 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -fpermissive -Wno-error")

include_directories(${CMAKE_INCLUDE_CURRENT_DIR})

find_package(Qt5Widgets)
find_package(Qt5Concurrent)
find_package(Qt5Network)
find_package(Qt5X11Extras)
find_package(Qt5Sql)
find_package(Qt5DBus)
find_package(Qt5Svg)

pkg_check_modules(Dtk REQUIRED IMPORTED_TARGET dtkwidget)
pkg_check_modules(Gst REQUIRED IMPORTED_TARGET libffmpegthumbnailer gstreamer-1.0 glib-2.0)
#qt5
# find_package(Qt5Widgets)
# find_package(Qt5Concurrent)
# find_package(Qt5Network)
# find_package(Qt5X11Extras)
# find_package(Qt5Sql)
# find_package(Qt5DBus)
# find_package(Qt5Svg)

#qt6
find_package(Qt6Widgets)
find_package(Qt6Concurrent)
find_package(Qt6Network)
find_package(Qt6Sql)
find_package(Qt6DBus)
find_package(Qt6Svg)

pkg_check_modules(Dtk REQUIRED IMPORTED_TARGET dtk6widget)
pkg_check_modules(Gst REQUIRED IMPORTED_TARGET gstreamer-1.0 glib-2.0)
include_directories(${Gst_INCLUDE_DIRS})

# 定义 source 文件
FILE (GLOB SRCS
*.cpp
)
../../src/libdmr/sysutils.cpp
)

add_executable(${CMD_NAME} ${SRCS})

target_link_libraries(${CMD_NAME} PkgConfig::Dtk Qt5::Widgets Qt5::Concurrent
Qt5::Network Qt5::X11Extras Qt5::Sql Qt5::DBus PkgConfig::Gst GL)
target_include_directories(${CMD_NAME} PUBLIC
if (Qt6_FOUND)
# Qt6 environment
target_link_libraries(${CMD_NAME} PkgConfig::Dtk Qt6::Widgets Qt6::Concurrent
Qt6::Network Qt6::Sql Qt6::DBus PkgConfig::Gst GL)
else()
# Qt5 environment
target_link_libraries(${CMD_NAME} PkgConfig::Dtk Qt5::Widgets Qt5::Concurrent
Qt5::Network Qt5::X11Extras Qt5::Sql Qt5::DBus PkgConfig::Gst GL)
endif()

target_include_directories(${CMD_NAME} PUBLIC
${PROJECT_SOURCE_DIR}/../../src/libdmr
${PROJECT_SOURCE_DIR}
)

target_link_libraries(${CMD_NAME} Qt5::Widgets dmr)
/usr/include/glib-2.0 /usr/include/gstreamer-1.0)

if (Qt6_FOUND)
target_link_libraries(${CMD_NAME} Qt6::Widgets dmr)
else()
target_link_libraries(${CMD_NAME} Qt5::Widgets dmr)
endif()
6 changes: 3 additions & 3 deletions examples/test/dmr_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int main(int argc, char *argv[])
thread->start();
bool is = false;
//获取视频信息 demo
dmr::MovieInfo mi = playModel->getMovieInfo(QUrl("file:///usr/share/dde-introduction/demo.mp4"),&is);
dmr::MovieInfo mi = playModel->getMovieInfo(QUrl("file:///home/tsl/Videos/123.mp4"),&is);
if (is) {
qInfo() << "# 文件类型:"<< mi.fileType
<< "# 文件大小:"<< mi.sizeStr()
Expand All @@ -44,10 +44,10 @@ int main(int argc, char *argv[])
<< "# 声道数:"<< mi.channels << "声道"
<< "# 采样数:"<< mi.sampling << "hz";
//获取预览图 demo
QImage img = playModel->getMovieCover(QUrl("file:///usr/share/dde-introduction/demo.mp4"));
QImage img = playModel->getMovieCover(QUrl("file:///home/tsl/Videos/123.mp4"));
img.save(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/Desktop/test.png");

QImage img1 = playModel->getMovieCover(QUrl("file:///usr/share/dde-introduction/demo.mp4"));
QImage img1 = playModel->getMovieCover(QUrl("file:///home/tsl/Videos/123.mp4"));
img1.save(QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/Desktop/test1.png");
}
playModel->deleteLater();
Expand Down
6 changes: 3 additions & 3 deletions examples/test/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Window::Window(QWidget *parent) : QWidget (parent)

auto l = new QVBoxLayout(this);

//if (dmr::CompositingManager::get().composited()) {
//dmr::CompositingManager::get().overrideCompositeMode(false);
//}
if (dmr::CompositingManager::get().composited()) {
dmr::CompositingManager::get().overrideCompositeMode(false);
}

player = new dmr::PlayerWidget;
l->addWidget(player);
Expand Down
5 changes: 4 additions & 1 deletion examples/test/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@

#include <player_widget.h>
#include <player_engine.h>
#include <playlist_model.h>

Check warning on line 10 in examples/test/window.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <playlist_model.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <compositing_manager.h>

Check warning on line 11 in examples/test/window.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <compositing_manager.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QWidget>

Check warning on line 12 in examples/test/window.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QWidget> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QVBoxLayout>

Check warning on line 13 in examples/test/window.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QVBoxLayout> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QHBoxLayout>

Check warning on line 14 in examples/test/window.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QHBoxLayout> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QPushButton>

Check warning on line 15 in examples/test/window.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QPushButton> not found. Please note: Cppcheck does not need standard library headers to get proper results.

class Window: public QWidget {
Q_OBJECT
public:
Window(QWidget *parent = 0);
explicit Window(QWidget *parent = nullptr);
void play(const QUrl& url);

private:
Expand Down
2 changes: 1 addition & 1 deletion linglong.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: "1"
package:
id: org.deepin.movie
name: "deepin-movie"
version: 5.15.10.1
version: 5.15.13.1
kind: app
description: |
movie for deepin os.
Expand Down
2 changes: 1 addition & 1 deletion loong64/linglong.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: "1"
package:
id: org.deepin.movie
name: "deepin-movie"
version: 5.15.10.1
version: 5.15.13.1
kind: app
description: |
movie for deepin os.
Expand Down
Loading
Loading