Olive
proxygenerator.h
1 #ifndef PROXYGENERATOR_H
2 #define PROXYGENERATOR_H
3 
4 #include <QThread>
5 #include <QVector>
6 #include <QMutex>
7 #include <QWaitCondition>
8 
9 struct Footage;
10 
11 struct ProxyInfo {
12  Footage* footage;
13  double size_multiplier;
14  int codec_type;
15  QString path;
16 };
17 
18 class ProxyGenerator : public QThread {
19  Q_OBJECT
20 public:
22  void run();
23  void queue(const ProxyInfo& info);
24  void cancel();
25  double get_proxy_progress(Footage* f);
26 private:
27  // queue of footage to process proxies for
28  QVector<ProxyInfo> proxy_queue;
29 
30  // threading objects
31  QWaitCondition waitCond;
32  QMutex mutex;
33 
34  // set to true if you want to permanently close ProxyGenerator
35  bool cancelled;
36 
37  // set to true if you want to abort the footage currently being processed
38  bool skip;
39 
40  // stores progress in percent of proxy currently being processed
41  double current_progress;
42 
43  // function that performs the actual transcode
44  void transcode(const ProxyInfo& info);
45 };
46 
47 // proxy generator is a global omnipotent entity
48 extern ProxyGenerator proxy_generator;
49 
50 #endif // PROXYGENERATOR_H
Definition: proxygenerator.h:11
Definition: proxygenerator.h:18
Definition: footage.h:46