File indexing completed on 2025-01-19 03:57:00

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2017-07-04
0007  * Description : FFmpeg launcher to encode frames as video
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_FFMPEG_LAUNCHER_H
0016 #define DIGIKAM_FFMPEG_LAUNCHER_H
0017 
0018 // Qt includes
0019 
0020 #include <QMap>
0021 #include <QString>
0022 #include <QTime>
0023 
0024 // Local includes
0025 
0026 #include "processlauncher.h"
0027 #include "vidslidesettings.h"
0028 #include "digikam_export.h"
0029 
0030 namespace Digikam
0031 {
0032 
0033 class DIGIKAM_EXPORT FFmpegLauncher : public ProcessLauncher
0034 {
0035     Q_OBJECT
0036 
0037 public:
0038 
0039     explicit FFmpegLauncher(QObject* const parent = nullptr);
0040     ~FFmpegLauncher() override;
0041 
0042     /**
0043      * Set encoding frames settings.
0044      */
0045     void setSettings(VidSlideSettings* const settings);
0046 
0047     /**
0048      * Encode frames in a separated thread.
0049      */
0050     void encodeFrames();
0051 
0052     /**
0053      * Get the map of supported codecs with features.
0054      */
0055     QMap<QString, QString> supportedCodecs();
0056 
0057     /**
0058      * Get the map of supported formats with features.
0059      */
0060     QMap<QString, QString> supportedFormats();
0061 
0062     /**
0063      * Return the length of an audio file.
0064      * If duration cannot be decoded, it returns a null QTime.
0065      */
0066     QTime soundTrackLength(const QString& audioPath);
0067 
0068 private:
0069 
0070     VidSlideSettings* m_settings = nullptr;
0071 };
0072 
0073 } // namespace Digikam
0074 
0075 #endif // DIGIKAM_FFMPEG_LAUNCHER_H