File indexing completed on 2024-03-24 04:55:50
0001 /* 0002 SPDX-FileCopyrightText: 2006-2008 Marco Gulino <marco@kmobiletools.org> 0003 adapted for MLT video preview by Jean-Baptiste Mardelle 0004 SPDX-FileCopyrightText: Jean-Baptiste Mardelle <jb@kdenlive.org> 0005 0006 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0007 */ 0008 0009 #pragma once 0010 0011 #include <KIO/ThumbnailCreator> 0012 #include <memory> 0013 #include <mlt++/Mlt.h> 0014 0015 #include <QObject> 0016 0017 class MltPreview : public KIO::ThumbnailCreator 0018 { 0019 public: 0020 MltPreview(QObject *parent, const QVariantList &args); 0021 ~MltPreview() override; 0022 KIO::ThumbnailResult create(const KIO::ThumbnailRequest &request) override; 0023 0024 protected: 0025 static int imageVariance(const QImage &image); 0026 QImage getFrame(std::shared_ptr<Mlt::Producer> producer, int framepos, int width, int height); 0027 };