Olive
previewgenerator.h
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 PREVIEWGENERATOR_H
22 #define PREVIEWGENERATOR_H
23 
24 #include <QThread>
25 #include <QSemaphore>
26 
27 enum IconType {
28  ICON_TYPE_VIDEO,
29  ICON_TYPE_AUDIO,
30  ICON_TYPE_IMAGE,
31  ICON_TYPE_ERROR
32 };
33 
34 struct Footage;
35 struct FootageStream;
36 struct AVFormatContext;
37 class Media;
38 
39 class PreviewGenerator : public QThread
40 {
41  Q_OBJECT
42 public:
43  PreviewGenerator(Media*, Footage*, bool);
44  void run();
45  void cancel();
46 signals:
47  void set_icon(int, bool);
48 private:
49  void parse_media();
50  bool retrieve_preview(const QString &hash);
51  void generate_waveform();
52  void finalize_media();
53  AVFormatContext* fmt_ctx;
54  Media* media;
55  Footage* footage;
56  bool retrieve_duration;
57  bool contains_still_image;
58  bool replace;
59  bool cancelled;
60  QString data_path;
61  QString get_thumbnail_path(const QString &hash, const FootageStream &ms);
62  QString get_waveform_path(const QString& hash, const FootageStream &ms);
63 };
64 
65 #endif // PREVIEWGENERATOR_H
Definition: previewgenerator.h:39
Definition: media.h:40
Definition: footage.h:45
Definition: footage.h:66