Skip to content
Merged
122 changes: 52 additions & 70 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
INSTALL_LIBS: libgl1-mesa-dev libxkbcommon-x11-0 libpcre2-16-0 qt5-default
QMAKE_COMMAND: qmake
- os: ubuntu-22.04
INSTALL_LIBS: qt6-base-dev
QMAKE_COMMAND: qmake6
os: [ubuntu-22.04, ubuntu-24.04]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -26,31 +20,28 @@ jobs:
- name: Install Linux packages
run: |
sudo apt-get update
sudo apt-get install ${{matrix.INSTALL_LIBS}}
sudo apt-get install qt6-base-dev
- name: Build
run: |
cd $GITHUB_WORKSPACE
mkdir build
cd build
${{matrix.QMAKE_COMMAND}} CONFIG+=UNITTESTS ..
qmake6 CONFIG+=UNITTESTS ..
make -j$(nproc)
- name: Run Unittests
run: $GITHUB_WORKSPACE/build/YUViewUnitTest/YUViewUnitTest
build-mac-native:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-13
- os: macos-14
os: [macos-13, macos-15]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: git fetch --prune --unshallow
- name: Install packages
run: |
brew install qt
run: brew install qt
- name: Build
run: |
cd $GITHUB_WORKSPACE
Expand All @@ -60,110 +51,94 @@ jobs:
make -j $(sysctl -n hw.logicalcpu)
- name: Run Unittests
run: $GITHUB_WORKSPACE/build/YUViewUnitTest/YUViewUnitTest
build-unix:
build-linux-mac:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
QT_FILE: qtBase_6.7.2_ubuntu20.zip
LIBDE265_REMOTE: libde265.so
LIBDE265_LOCAL: libde265-internals.so
ARTIFACT_NAME: YUView.Ubuntu20.AppImage
CPU_COUNT_COMMAND: nproc
- os: macos-13
QT_FILE: qtBase_6.7.2_mac13.zip
LIBDE265_REMOTE: libde265.dylib
LIBDE265_LOCAL: libde265-internals.dylib
ARTIFACT_NAME: YUView-Mac13-Monterey.zip
CPU_COUNT_COMMAND: sysctl -n hw.logicalcpu
- os: macos-14
QT_FILE: qtBase_6.7.2_mac14.zip
LIBDE265_REMOTE: libde265.dylib
LIBDE265_LOCAL: libde265-internals.dylib
ARTIFACT_NAME: YUView-Mac14-Sonoma.zip
CPU_COUNT_COMMAND: sysctl -n hw.logicalcpu
os: [ubuntu-22.04, macos-13, macos-15]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: git fetch --prune --unshallow
- name: Set artifact name
id: artifacts
shell: bash
run: |
echo "qt=qtBase-6-9-0-${{ matrix.os }}" >> "$GITHUB_OUTPUT"
echo "outputZip=YUView-${{ matrix.os }}.zip" >> "$GITHUB_OUTPUT"
- name: Install Qt base
run: |
cd ../../
mkdir -p YUViewQt/YUViewQt
cd YUViewQt/YUViewQt
curl -L https://github.com/ChristianFeldmann/YUViewQt/releases/download/QtBase-6.7.2/${{matrix.QT_FILE}} -o Qt.zip
curl -L https://github.com/ChristianFeldmann/YUViewQt/releases/download/QtBase-6.9.0/${{steps.artifacts.outputs.qt}}.zip -o Qt.zip
unzip -qa Qt.zip
echo "$GITHUB_WORKSPACE/../../YUViewQt/YUViewQt/Qt/bin" >> $GITHUB_PATH
shell: bash
- name: Install Linuxdeployqt
if: runner.os == 'Linux'
run: |
curl -L https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage -o linuxdeployqt-6-x86_64.AppImage
chmod a+x linuxdeployqt-6-x86_64.AppImage
if: matrix.os == 'ubuntu-20.04'
- name: Install Linux packages
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install libgl1-mesa-dev libxkbcommon-x11-0 libpcre2-16-0 '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libatspi2.0-dev libfuse2
if: matrix.os == 'ubuntu-20.04'
- name: Install libde265
run: |
curl -L https://github.com/ChristianFeldmann/libde265/releases/download/v1.1/${{matrix.LIBDE265_REMOTE}} -o ${{matrix.LIBDE265_LOCAL}}
curl -L https://raw.githubusercontent.com/ChristianFeldmann/libde265/master/COPYING -o libde265License.txt
- name: Download libde265 (Linux)
if: runner.os == 'Linux'
run: curl -L https://github.com/ChristianFeldmann/libde265/releases/download/v1.1/libde265.so -o libde265-internals.so
- name: Download libde265 (Mac)
if: runner.os == 'macOS'
run: curl -L https://github.com/ChristianFeldmann/libde265/releases/download/v1.1/libde265.dylib -o libde265-internals.dylib
- name: Download libde265 license file
run: curl -L https://raw.githubusercontent.com/ChristianFeldmann/libde265/master/COPYING -o libde265License.txt
shell: bash
- name: Build
- name: Build (Qmake + Make)
run: |
cd $GITHUB_WORKSPACE
export PATH=$GITHUB_WORKSPACE/../../YUViewQt/YUViewQt/Qt/bin:$PATH
mkdir build
cd build
qmake CONFIG+=UNITTESTS ..
make -j $(${{matrix.CPU_COUNT_COMMAND}})
make -j 4
- name: Run Unittests
run: $GITHUB_WORKSPACE/build/YUViewUnitTest/YUViewUnitTest
- name: Build App (Mac)
if: runner.os == 'macOS'
run: |
macdeployqt build/YUViewApp/YUView.app -always-overwrite -verbose=2
cp ${{matrix.LIBDE265_LOCAL}} build/YUViewApp/YUView.app/Contents/MacOS/.
cp libde265-internals.dylib build/YUViewApp/YUView.app/Contents/MacOS/.
cd build/YUViewApp
# Zip
zip -r ${{matrix.ARTIFACT_NAME}} YUView.app/
zip -r ${{steps.artifacts.outputs.outputZip}} YUView.app/
mkdir $GITHUB_WORKSPACE/artifacts
cp ${{matrix.ARTIFACT_NAME}} $GITHUB_WORKSPACE/artifacts/
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
cp ${{steps.artifacts.outputs.outputZip}} $GITHUB_WORKSPACE/artifacts/
- name: Build Appimage (Linux)
if: runner.os == 'Linux'
run: |
cd build
make INSTALL_ROOT=appdir install
$GITHUB_WORKSPACE/linuxdeployqt-6-x86_64.AppImage YUViewApp/appdir/usr/local/share/applications/de.rwth_aachen.ient.YUView.desktop -appimage -bundle-non-qt-libs -verbose=2
mv YUView-*.AppImage YUView.AppImage
mkdir $GITHUB_WORKSPACE/artifacts
cp YUView.AppImage $GITHUB_WORKSPACE/artifacts/
if: matrix.os == 'ubuntu-20.04'
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{matrix.ARTIFACT_NAME}}
name: ${{steps.artifacts.outputs.outputZip}}
path: artifacts
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: artifacts/${{matrix.ARTIFACT_NAME}}
files: artifacts/${{steps.artifacts.outputs.outputZip}}
build-windows:
runs-on: ${{ matrix.os }}
runs-on: windows-2022
strategy:
matrix:
include:
- os: windows-2019
auto_update: true
ARTIFACT_NAME: YUView-Win2019.zip
QT_FILE: qtBase_6.7.2_win2019.zip
- os: windows-2019
auto_update: false
ARTIFACT_NAME: YUView-Win2019-noautoupdate.zip
QT_FILE: qtBase_6.7.2_win2019.zip
autoUpdate: [true, false]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -175,7 +150,7 @@ jobs:
cd ../../
mkdir -p YUViewQt/YUViewQt
cd YUViewQt/YUViewQt
curl -L https://github.com/ChristianFeldmann/YUViewQt/releases/download/QtBase-6.7.2/${{matrix.QT_FILE}} -o Qt.zip
curl -L https://github.com/ChristianFeldmann/YUViewQt/releases/download/QtBase-6.9.0/qtBase-6-9-0-windows-2022.zip -o Qt.zip
7z x Qt.zip
echo "${{ github.workspace }}\..\..\YUViewQt\YUViewQt\Qt\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install libde265
Expand All @@ -189,13 +164,13 @@ jobs:
run: |
mkdir openSSL
cd openSSL
curl -L https://github.com/ChristianFeldmann/YUViewQt/releases/download/openSSL1.1.1w/openSSL_1_1_1w_win2019.zip -o openSSL.zip
curl -L https://github.com/ChristianFeldmann/YUViewQt/releases/download/openSSL3.5.0/openSSL-3-5-0-windows-2022.zip -o openSSL.zip
7z x openSSL.zip
cd ..
- name: Activate auto update
if: matrix.autoUpdate == true
run: sed -i -- "s/#define UPDATE_FEATURE_ENABLE 0/#define UPDATE_FEATURE_ENABLE 1/g" YUViewLib/src/common/Typedef.h
shell: bash
if: matrix.auto_update == true
- name: Build
run: |
echo "Creating Build dir and entering it"
Expand Down Expand Up @@ -225,35 +200,42 @@ jobs:
mkdir artifacts
7z a artifacts/YUView-Win.zip ./deploy/*
- name: Wix Windows
if: matrix.autoUpdate == true
run: |
cd ${{ github.workspace }}/deployment/wix
cp 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Redist\MSVC\v142\MergeModules\Microsoft_VC142_CRT_x64.msm' .
cp 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\v143\MergeModules\Microsoft_VC143_CRT_x64.msm' .
& "C:\Program Files (x86)\WiX Toolset v3.14\bin\heat.exe" dir ../../deploy -gg -dr APPLICATIONFOLDER -srd -sreg -cg YUViewComponents -out harvestedDirectory.wxs
& "C:\Program Files (x86)\WiX Toolset v3.14\bin\candle.exe" -dConfiguration=Release -dOutDir=bin/Release/ '-dTargetExt=.msi' '-dTargetFileName=YUViewSetup.msi' -dTargetName=YUViewSetup -out obj/Release/ -arch x64 -ext "C:\Program Files (x86)\WiX Toolset v3.14\bin\WixUIExtension.dll" YUView.wxs
& "C:\Program Files (x86)\WiX Toolset v3.14\bin\candle.exe" -dConfiguration=Release -dOutDir=bin/Release/ '-dTargetExt=.msi' '-dTargetFileName=YUViewSetup.msi' -dTargetName=YUViewSetup -out obj/Release/ -arch x64 harvestedDirectory.wxs
& "C:\Program Files (x86)\WiX Toolset v3.14\bin\light.exe" -b ../../deploy -out bin/Release/YUViewSetup.msi -pdbout bin/Release/YUViewSetup.wixpdb -cultures:null -ext "C:\Program Files (x86)\WiX Toolset v3.14\bin\WixUIExtension.dll" -contentsfile obj/Release/YUViewSetup.wixproj.BindContentsFileListnull.txt -outputsfile obj/Release/YUViewSetup.wixproj.BindOutputsFileListnull.txt -builtoutputsfile obj/Release/YUViewSetup.wixproj.BindBuiltOutputsFileListnull.txt obj/Release/YUView.wixobj obj/Release/harvestedDirectory.wixobj
cd ${{ github.workspace }}
cp deployment/wix/bin/Release/YUViewSetup.msi ./
if: matrix.auto_update == true
- name: Upload Artifact
- name: Upload Artifact (Autoupdate)
if: matrix.autoUpdate == true
uses: actions/upload-artifact@v4
with:
name: YUView-windows-2022-autoupdate.zip
path: artifacts
- name: Upload Artifact (Autoupdate disabled)
if: matrix.autoUpdate == false
uses: actions/upload-artifact@v4
with:
name: ${{matrix.ARTIFACT_NAME}}
name: YUView-windows-2022.zip
path: artifacts
- name: Upload Windows installer Artifact
if: matrix.autoUpdate == true
uses: actions/upload-artifact@v4
with:
name: YUViewSetup.msi
name: YYUView-windows-2022.msi
path: ./YUViewSetup.msi
if: matrix.auto_update == true
- name: Release Zip
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: artifacts/YUView-Win.zip
- name: Release Installer
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') && matrix.auto_update == true
if: startsWith(github.ref, 'refs/tags/') && matrix.autoUpdate == true
with:
files: YUViewSetup.msi

Expand Down
2 changes: 1 addition & 1 deletion YUViewLib/src/ui/Mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#include <handler/UpdateHandler.h>
#include <ui/SeparateWindow.h>
#include <video/VideoCache.h>
#include <video/caching/VideoCache.h>

#include "ui_mainwindow.h"

Expand Down
2 changes: 1 addition & 1 deletion YUViewLib/src/ui/views/SplitViewWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <playlistitem/playlistItem.h>
#include <ui/PlaybackController.h>
#include <video/FrameHandler.h>
#include <video/VideoCache.h>
#include <video/caching/VideoCache.h>

#include <QActionGroup>
#include <QBackingStore>
Expand Down
2 changes: 1 addition & 1 deletion YUViewLib/src/ui/widgets/VideoCacheInfoWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <QWidget>

#include "PlaylistTreeWidget.h"
#include <video/VideoCache.h>
#include <video/caching/VideoCache.h>

namespace VideoCacheStatusWidgetNamespace
{
Expand Down
92 changes: 92 additions & 0 deletions YUViewLib/src/video/caching/LoadingThread.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/* This file is part of YUView - The YUV player with advanced analytics toolset
* <https://github.com/IENT/YUView>
* Copyright (C) 2015 Institut für Nachrichtentechnik, RWTH Aachen University, GERMANY
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*
* You must obey the GNU General Public License in all respects for all
* of the code used other than OpenSSL. If you modify file(s) with this
* exception, you may extend this exception to your version of the
* file(s), but you are not obligated to do so. If you do not wish to do
* so, delete this exception statement from your version. If you delete
* this exception statement from all source files in the program, then
* also delete it here.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include <QThread>

#include "LoadingWorker.h"

namespace video
{

#define LOADINGTHREAD_DEBUG_LOADING 0
#if LOADINGTHREAD_DEBUG_LOADING && !NDEBUG
#define DEBUG_THREAD qDebug
#else
#define DEBUG_THREAD(fmt, ...) ((void)0)
#endif

class LoadingThread : public QThread
{
Q_OBJECT
public:
LoadingThread(QObject *parent) : QThread(parent)
{
// Create a new worker and move it to this thread
this->threadWorker.reset(new LoadingWorker(nullptr));
this->threadWorker->moveToThread(this);
}
~LoadingThread() {}

void quitWhenDone()
{
this->quitting = true;
if (this->threadWorker->isWorking())
{
// We must wait until the worker is done.
DEBUG_THREAD("loadingThread::quitWhenDone waiting for worker to finish...");
connect(worker(),
&LoadingWorker::loadingFinished,
this,
[=]
{
DEBUG_THREAD("loadingThread::quitWhenDone worker done -> quit");
quit();
});
}
else
{
DEBUG_THREAD("loadingThread::quitWhenDone quit now");
quit();
}
}

LoadingWorker *worker() { return this->threadWorker.get(); }
bool isQuitting() { return this->quitting; }

private:
std::unique_ptr<LoadingWorker> threadWorker{};
bool quitting{}; // Are er quitting the job? If yes, do not push new jobs to it.
};

} // namespace video
Loading