Olive
previewgenerator.h
1 #ifndef PREVIEWGENERATOR_H
2 #define PREVIEWGENERATOR_H
3 
4 #include <QThread>
5 #include <QSemaphore>
6 
7 enum IconType {
8  ICON_TYPE_VIDEO,
9  ICON_TYPE_AUDIO,
10  ICON_TYPE_IMAGE,
11  ICON_TYPE_ERROR
12 };
13 
14 struct Footage;
15 struct FootageStream;
16 struct AVFormatContext;
17 class Media;
18 
19 class PreviewGenerator : public QThread
20 {
21  Q_OBJECT
22 public:
23  PreviewGenerator(Media*, Footage*, bool);
24  void run();
25  void cancel();
26 signals:
27  void set_icon(int, bool);
28 private:
29  void parse_media();
30  bool retrieve_preview(const QString &hash);
31  void generate_waveform();
32  void finalize_media();
33  AVFormatContext* fmt_ctx;
34  Media* media;
35  Footage* footage;
36  bool retrieve_duration;
37  bool contains_still_image;
38  bool replace;
39  bool cancelled;
40  QString data_path;
41  QString get_thumbnail_path(const QString &hash, const FootageStream &ms);
42  QString get_waveform_path(const QString& hash, const FootageStream &ms);
43 };
44 
45 #endif // PREVIEWGENERATOR_H
Definition: previewgenerator.h:19
Definition: media.h:20
Definition: footage.h:25
Definition: footage.h:46