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