CuteLogger
Fast and simple logging solution for Qt based applications
proxymanager.h
1 /*
2  * Copyright (c) 2020-2021 Meltytech, LLC
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef PROXYMANAGER_H
19 #define PROXYMANAGER_H
20 
21 #include <QDir>
22 #include <QPoint>
23 #include <QString>
24 
25 namespace Mlt {
26 class Producer;
27 class Service;
28 } // namespace Mlt
29 
30 class ProxyManager
31 {
32 private:
33  ProxyManager(){};
34 
35 public:
36  enum ScanMode { Automatic, Progressive, InterlacedTopFieldFirst, InterlacedBottomFieldFirst };
37 
38  static QDir dir();
39  static QString resource(Mlt::Service &producer);
40  static void generateVideoProxy(Mlt::Producer &producer,
41  bool fullRange,
42  ScanMode scanMode = Automatic,
43  const QPoint &aspectRatio = QPoint(),
44  bool replace = true);
45  static void generateImageProxy(Mlt::Producer &producer, bool replace = true);
46  static bool filterXML(QString &xml, QString root);
47  static bool fileExists(Mlt::Producer &producer);
48  static bool filePending(Mlt::Producer &producer);
49  static bool isValidImage(Mlt::Producer &producer);
50  static bool isValidVideo(Mlt::Producer producer);
51  static bool generateIfNotExists(Mlt::Producer &producer, bool replace = true);
52  static const char *videoFilenameExtension();
53  static const char *pendingVideoExtension();
54  static const char *imageFilenameExtension();
55  static const char *pendingImageExtension();
56  static int resolution();
57  static void generateIfNotExistsAll(Mlt::Producer &producer);
58  static bool removePending();
59  static QString GoProProxyFilePath(const QString &resource);
60  static QString DJIProxyFilePath(const QString &resource);
61 };
62 
63 #endif // PROXYMANAGER_H