Olive
proxygenerator.h
Go to the documentation of this file.
1 /***
2 
3  Olive - Non-Linear Video Editor
4  Copyright (C) 2019 Olive Team
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 ***/
20 
21 #ifndef PROXYGENERATOR_H
22 #define PROXYGENERATOR_H
23 
24 #include <QThread>
25 #include <QVector>
26 #include <QMutex>
27 #include <QWaitCondition>
28 
29 #include "project/footage.h"
30 
31 struct ProxyInfo {
35  QString path;
36 };
37 
38 class ProxyGenerator : public QThread {
39  Q_OBJECT
40 public:
42  void run();
43  void queue(const ProxyInfo& info);
44  void cancel();
46 private:
47  // queue of footage to process proxies for
48  QVector<ProxyInfo> proxy_queue;
49 
50  // threading objects
51  QWaitCondition waitCond;
52  QMutex mutex;
53 
54  // set to true if you want to permanently close ProxyGenerator
55  bool cancelled;
56 
57  // set to true if you want to abort the footage currently being processed
58  bool skip;
59 
60  // stores progress in percent of proxy currently being processed
62 
63  // function that performs the actual transcode
64  void transcode(const ProxyInfo& info);
65 };
66 
67 // proxy generator is a global omnipotent entity
69 
70 #endif // PROXYGENERATOR_H
bool cancelled
Definition: proxygenerator.h:55
FootagePtr footage
Definition: proxygenerator.h:32
QWaitCondition waitCond
Definition: proxygenerator.h:51
Definition: proxygenerator.h:31
std::shared_ptr< Footage > FootagePtr
Definition: footage.h:103
int codec_type
Definition: proxygenerator.h:34
void queue(const ProxyInfo &info)
Definition: proxygenerator.cpp:365
bool skip
Definition: proxygenerator.h:58
double current_progress
Definition: proxygenerator.h:61
ProxyGenerator proxy_generator
Definition: proxygenerator.cpp:410
double get_proxy_progress(FootagePtr f)
Definition: proxygenerator.cpp:402
QString path
Definition: proxygenerator.h:35
void transcode(const ProxyInfo &info)
Definition: proxygenerator.cpp:43
QVector< ProxyInfo > proxy_queue
Definition: proxygenerator.h:48
Definition: proxygenerator.h:38
void cancel()
Definition: proxygenerator.cpp:390
void run()
Definition: proxygenerator.cpp:326
ProxyGenerator()
Definition: proxygenerator.cpp:41
QMutex mutex
Definition: proxygenerator.h:52
double size_multiplier
Definition: proxygenerator.h:33