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