Olive
playback.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 PLAYBACK_H
22 #define PLAYBACK_H
23 
24 #include <QVector>
25 #include <QMutex>
26 
27 #include "project/clip.h"
28 #include "project/sequence.h"
29 
30 extern "C" {
31  #include <libavformat/avformat.h>
32 }
33 
34 long refactor_frame_number(long framenumber, double source_frame_rate, double target_frame_rate);
35 bool clip_uses_cacher(ClipPtr clip);
36 void open_clip(ClipPtr clip, bool multithreaded);
37 void cache_clip(ClipPtr clip, long playhead, bool reset, bool scrubbing, QVector<ClipPtr> &nests, int playback_speed);
38 void close_clip(ClipPtr clip, bool wait);
39 void handle_media(SequencePtr sequence, long playhead, bool multithreaded);
40 void reset_cache(ClipPtr c, long target_frame, int playback_speed);
41 void get_clip_frame(ClipPtr c, long playhead, bool &texture_failed);
42 double get_timecode(ClipPtr c, long playhead);
43 
44 long playhead_to_clip_frame(ClipPtr c, long playhead);
45 double playhead_to_clip_seconds(ClipPtr c, long playhead);
46 int64_t seconds_to_timestamp(ClipPtr c, double seconds);
47 int64_t playhead_to_timestamp(ClipPtr c, long playhead);
48 
49 int retrieve_next_frame(ClipPtr c, AVFrame* f);
50 bool is_clip_active(ClipPtr c, long playhead);
51 void get_next_audio(ClipPtr c, bool mix);
54 
55 #endif // PLAYBACK_H
void handle_media(SequencePtr sequence, long playhead, bool multithreaded)
double get_timecode(ClipPtr c, long playhead)
Definition: playback.cpp:154
void cache_clip(ClipPtr clip, long playhead, bool reset, bool scrubbing, QVector< ClipPtr > &nests, int playback_speed)
Definition: playback.cpp:136
void set_sequence(SequencePtr s)
Definition: playback.cpp:458
double playhead_to_clip_seconds(ClipPtr c, long playhead)
Definition: playback.cpp:382
int retrieve_next_frame(ClipPtr c, AVFrame *f)
Definition: playback.cpp:399
bool clip_uses_cacher(ClipPtr clip)
Definition: playback.cpp:61
bool is_clip_active(ClipPtr c, long playhead)
Definition: playback.cpp:445
std::shared_ptr< Clip > ClipPtr
Definition: cacher.h:28
int64_t seconds_to_timestamp(ClipPtr c, double seconds)
Definition: playback.cpp:391
void get_next_audio(ClipPtr c, bool mix)
void close_clip(ClipPtr clip, bool wait)
Definition: playback.cpp:87
long refactor_frame_number(long framenumber, double source_frame_rate, double target_frame_rate)
Definition: playback.cpp:57
int64_t playhead_to_timestamp(ClipPtr c, long playhead)
Definition: playback.cpp:395
std::shared_ptr< Sequence > SequencePtr
Definition: clip.h:48
void open_clip(ClipPtr clip, bool multithreaded)
Definition: playback.cpp:65
void get_clip_frame(ClipPtr c, long playhead, bool &texture_failed)
Definition: playback.cpp:158
void closeActiveClips(SequencePtr s)
Definition: playback.cpp:466
void reset_cache(ClipPtr c, long target_frame, int playback_speed)
Definition: cacher.cpp:588
long playhead_to_clip_frame(ClipPtr c, long playhead)
Definition: playback.cpp:378