1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-10-06 09:17:07 +02:00

Fix hardcoded video path

We now use one from this git repo. Video is cc0 by
https://mantissa.xyz/pages/vj.html
This commit is contained in:
Elias Steurer 2021-09-04 14:41:49 +02:00
parent 41f02cc2d9
commit c8c7232f48
5 changed files with 31 additions and 6 deletions

View File

@ -60,6 +60,7 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE)
add_compile_definitions(COMPILE_INFO="${BUILD_DATE} + ${GIT_COMMIT_HASH}")
add_compile_definitions(SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
if(UNIX AND NOT APPLE)
# Fixes QWebEngine linker errors on Ubuntu 20.04
@ -83,6 +84,7 @@ if(WIN32)
add_subdirectory(ScreenPlaySysInfo)
endif()
message(STATUS "[DEFINE] SOURCE_DIR = ${SOURCE_DIR}")
message(STATUS "[DEFINE] BUILD_DATE = ${BUILD_DATE}")
message(STATUS "[DEFINE] GIT_COMMIT_HASH = ${GIT_COMMIT_HASH}")
message(STATUS "[PROJECT] CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}")

View File

@ -172,6 +172,21 @@ if(APPLE)
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/ffprobe
${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/)
# tst_ScreenPlay needs ffmpeg in the base path
if(${TESTS_ENABLED})
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/ffmpeg
${CMAKE_BINARY_DIR}/bin/)
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/../Common/ffmpeg/ffprobe
${CMAKE_BINARY_DIR}/bin/)
endif()
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD

Binary file not shown.

View File

@ -153,9 +153,13 @@ void Settings::setupWidgetAndWindowPaths()
#ifdef Q_OS_OSX
workingDir.cdUp();
workingDir.cdUp();
workingDir.cdUp();
// ScreenPlayTest is not bundled in an .app so the working directory
// the the same as the executable.
if (QFileInfo(QCoreApplication::applicationFilePath()).fileName() != "tst_ScreenPlay") {
workingDir.cdUp();
workingDir.cdUp();
workingDir.cdUp();
}
m_globalVariables->setWidgetExecutablePath(QUrl::fromUserInput(workingDir.path() + "/ScreenPlayWidget.app/Contents/MacOS/ScreenPlayWidget").toLocalFile());
m_globalVariables->setWallpaperExecutablePath(QUrl::fromUserInput(workingDir.path() + "/ScreenPlayWallpaper.app/Contents/MacOS/ScreenPlayWallpaper").toLocalFile());
@ -164,11 +168,11 @@ void Settings::setupWidgetAndWindowPaths()
if (!QFileInfo::exists(m_globalVariables->widgetExecutablePath().toString())) {
qInfo() << "widgetExecutablePath:" << m_globalVariables->widgetExecutablePath().toString();
qFatal("widget executable not found!");
qCritical("widget executable not found!");
}
if (!QFileInfo::exists(m_globalVariables->wallpaperExecutablePath().toString())) {
qInfo() << "wallpaperExecutablePath:" << m_globalVariables->wallpaperExecutablePath().toString();
qFatal("wallpaper executable not found!");
qCritical("wallpaper executable not found!");
}
}

View File

@ -55,6 +55,7 @@ private slots:
Q_INIT_RESOURCE(ScreenPlayQML);
Q_INIT_RESOURCE(ScreenPlayAssets);
app.init();
m_window = qobject_cast<QQuickWindow*>(app.mainWindowEngine()->rootObjects().first());
QVERIFY(m_window);
@ -130,10 +131,13 @@ void ScreenPlayTest::import_convert_video()
auto* createWallpaperInit = m_window->findChild<QQuickItem*>("createWallpaperInit");
QVERIFY(createWallpaperInit);
const QString originalVideoPath = QString(SOURCE_DIR) + "/ScreenPlay/assets/tests/video_import.mp4";
qInfo() << originalVideoPath;
QVERIFY(QMetaObject::invokeMethod(createWallpaperInit,
QString("startConvert").toLatin1().constData(),
Qt::ConnectionType::AutoConnection,
Q_ARG(QVariant, "file:///D:/Video Loop/bbb.mp4"),
Q_ARG(QVariant, originalVideoPath),
Q_ARG(QVariant, 1))); // VideoCodec::VP9
QTest::qWait(1000);