File indexing completed on 2025-01-05 03:57:26

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2017-05-25
0007  * Description : a tool to generate video slideshow from images.
0008  *
0009  * SPDX-FileCopyrightText: 2017-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_VIDSLIDE_THREAD_H
0016 #define DIGIKAM_VIDSLIDE_THREAD_H
0017 
0018 // Local includes
0019 
0020 #include "vidslidesettings.h"
0021 #include "vidslidetask.h"
0022 #include "actionthreadbase.h"
0023 #include "digikam_export.h"
0024 #include "ffmpeglauncher.h"
0025 
0026 namespace Digikam
0027 {
0028 
0029 class DIGIKAM_EXPORT VidSlideThread : public ActionThreadBase
0030 {
0031     Q_OBJECT
0032 
0033 public:
0034 
0035     explicit VidSlideThread(QObject* const parent);
0036     ~VidSlideThread() override;
0037 
0038     /**
0039      * Stage 1: prepare frames in temporary directory.
0040      */
0041     void prepareFrames(VidSlideSettings* const settings);
0042 
0043     QString encodingTraces() const;
0044 
0045 Q_SIGNALS:
0046 
0047     void signalProgress(int);
0048     void signalDone(bool);
0049     void signalMessage(const QString&, bool);
0050 
0051 private Q_SLOTS:
0052 
0053     /**
0054      * Stage 2: encode frames as video stream.
0055      */
0056     void slotEncodeFrames(bool prepareDone);
0057 
0058     /**
0059      * Called when stage 2 is done.
0060      */
0061     void slotEncodeDone(bool timedOut, int exitCode);
0062 
0063 private:
0064 
0065     VidSlideSettings* m_settings = nullptr;
0066     FFmpegLauncher*   m_encoder  = nullptr;
0067 };
0068 
0069 } // namespace Digikam
0070 
0071 #endif // DIGIKAM_VIDSLIDE_THREAD_H