Olive
footage.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 FOOTAGE_H
22 #define FOOTAGE_H
23 
24 #include <QString>
25 #include <QVector>
26 #include <QMetaType>
27 #include <QVariant>
28 #include <QMutex>
29 #include <QPixmap>
30 #include <QIcon>
31 
32 #include "project/marker.h"
33 
34 enum VideoInterlacingMode {
35  VIDEO_PROGRESSIVE,
36  VIDEO_TOP_FIELD_FIRST,
37  VIDEO_BOTTOM_FIELD_FIRST
38 };
39 
40 struct Sequence;
41 class Clip;
42 class PreviewGenerator;
43 class MediaThrobber;
44 
45 struct FootageStream {
46  int file_index;
47  int video_width;
48  int video_height;
49  bool infinite_length;
50  double video_frame_rate;
51  int video_interlacing;
52  int video_auto_interlacing;
53  int audio_channels;
54  int audio_layout;
55  int audio_frequency;
56  bool enabled;
57 
58  // preview thumbnail/waveform
59  bool preview_done;
60  QImage video_preview;
61  QIcon video_preview_square;
62  QVector<char> audio_preview;
63  void make_square_thumb();
64 };
65 
66 struct Footage {
67  Footage();
68  ~Footage();
69 
70  // footage metadata
71  QString url;
72  QString name;
73  int64_t length;
74  QVector<FootageStream> video_tracks;
75  QVector<FootageStream> audio_tracks;
76  int save_id;
77  bool ready;
78  bool invalid;
79  double speed;
80  bool alpha_is_premultiplied;
81 
82  // proxy config
83  bool proxy;
84  QString proxy_path;
85 
86  // thumbnail/waveform generation
87  PreviewGenerator* preview_gen;
88  QMutex ready_lock;
89 
90  // in/out points
91  bool using_inout;
92  long in;
93  long out;
94 
95  // markers
96  QVector<Marker> markers;
97 
98  // functions
99  long get_length_in_frames(double frame_rate);
100  FootageStream *get_stream_from_file_index(bool video, int index);
101  void reset();
102 };
103 
104 #endif // FOOTAGE_H
Definition: sequence.h:33
Definition: previewgenerator.h:39
Definition: project.h:131
Definition: footage.h:45
Definition: clip.h:53
Definition: footage.h:66