Olive
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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/media.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();
45  double get_proxy_progress(Media *f);
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 namespace olive {
68  // proxy generator is a global omnipotent entity
70 }
71 
72 #endif // PROXYGENERATOR_H
Media * media
Definition: proxygenerator.h:32
void queue(const ProxyInfo &info)
Definition: proxygenerator.cpp:375
QString path
Definition: proxygenerator.h:35
double size_multiplier
Definition: proxygenerator.h:33
void transcode(const ProxyInfo &info)
Definition: proxygenerator.cpp:44
Definition: proxygenerator.h:31
QWaitCondition waitCond
Definition: proxygenerator.h:51
int codec_type
Definition: proxygenerator.h:34
Definition: media.h:45
ProxyGenerator proxy_generator
Definition: proxygenerator.cpp:420
void cancel()
Definition: proxygenerator.cpp:400
void run()
Definition: proxygenerator.cpp:336
bool cancelled
Definition: proxygenerator.h:55
bool skip
Definition: proxygenerator.h:58
QMutex mutex
Definition: proxygenerator.h:52
QVector< ProxyInfo > proxy_queue
Definition: proxygenerator.h:48
double get_proxy_progress(Media *f)
Definition: proxygenerator.cpp:412
Definition: proxygenerator.h:38
double current_progress
Definition: proxygenerator.h:61
ProxyGenerator()
Definition: proxygenerator.cpp:42