File indexing completed on 2024-12-01 04:28:36

0001 /*
0002     SPDX-FileCopyrightText: 2021 Jean-Baptiste Mardelle <jb@kdenlive.org>
0003 
0004 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include "abstracttask.h"
0010 #include <memory>
0011 #include <unordered_map>
0012 #include <mlt++/MltConsumer.h>
0013 
0014 namespace Mlt {
0015 class Profile;
0016 class Producer;
0017 class Consumer;
0018 class Filter;
0019 class Event;
0020 } // namespace Mlt
0021 
0022 class AssetParameterModel;
0023 class QProcess;
0024 
0025 class FilterTask : public AbstractTask
0026 {
0027 public:
0028     FilterTask(const ObjectId &owner, const QString &binId, const std::weak_ptr<AssetParameterModel> &model, const QString &assetId, int in, int out, const QString &filterName, const std::unordered_map<QString, QVariant> &filterParams, const std::unordered_map<QString, QString> &filterData, const QStringList &consumerArgs, QObject* object);
0029     static void start(const ObjectId &owner, const QString &binId, const std::weak_ptr<AssetParameterModel> &model, const QString &assetId, int in, int out, const QString &filterName, const std::unordered_map<QString, QVariant> &filterParams, const std::unordered_map<QString, QString> &filterData, const QStringList &consumerArgs, QObject* object, bool force = false);
0030     int length;
0031 
0032 private Q_SLOTS:
0033     void processLogInfo();
0034 
0035 protected:
0036     void run() override;
0037 
0038 private:
0039     QString m_binId;
0040     int m_inPoint;
0041     int m_outPoint;
0042     QString m_assetId;
0043     std::weak_ptr<AssetParameterModel> m_model;
0044     QString m_filterName;
0045     std::unordered_map<QString, QVariant> m_filterParams;
0046     std::unordered_map<QString, QString> m_filterData;
0047     QStringList m_consumerArgs;
0048     QString m_errorMessage;
0049     QString m_logDetails;
0050     std::unique_ptr<QProcess> m_jobProcess;
0051 };