OpenShot Library | libopenshot 0.3.3
Loading...
Searching...
No Matches
VideoCacheThread.h
Go to the documentation of this file.
1
9// Copyright (c) 2008-2019 OpenShot Studios, LLC
10//
11// SPDX-License-Identifier: LGPL-3.0-or-later
12
13#ifndef OPENSHOT_VIDEO_CACHE_THREAD_H
14#define OPENSHOT_VIDEO_CACHE_THREAD_H
15
16#include "ReaderBase.h"
17
18#include <AppConfig.h>
19#include <juce_audio_basics/juce_audio_basics.h>
20
21namespace openshot
22{
23 using juce::Thread;
24 using juce::WaitableEvent;
25
29 class VideoCacheThread : Thread
30 {
31 protected:
32 std::shared_ptr<Frame> last_cached_frame;
33 int speed;
38 int64_t cached_frame_count = 0;
45
50
52 int64_t getBytes(int width, int height, int sample_rate, int channels, float fps);
53
55 int getSpeed() const { return speed; }
56
58 void Play();
59
61 void Seek(int64_t new_position);
62
64 void Seek(int64_t new_position, bool start_preroll);
65
67 void setSpeed(int new_speed);
68
70 void Stop();
71
73 void run();
74
76 void Reader(ReaderBase *new_reader) { reader=new_reader; Play(); };
77
79 friend class PlayerPrivate;
80 friend class QtPlayer;
81
82 public:
84 bool isReady();
85 };
86}
87
88#endif // OPENSHOT_VIDEO_CACHE_THREAD_H
Header file for ReaderBase class.
The private part of QtPlayer class, which contains an audio thread and video thread,...
This class is used to playback a video from a reader.
Definition QtPlayer.h:33
This abstract class is the base class, used by all readers in libopenshot.
Definition ReaderBase.h:76
The video cache class.
void setSpeed(int new_speed)
Set Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster,...
void Stop()
Stop the audio playback.
bool isReady()
Is cache ready for video/audio playback.
void Reader(ReaderBase *new_reader)
Set the current thread's reader.
int64_t getBytes(int width, int height, int sample_rate, int channels, float fps)
Get the size in bytes of a frame (rough estimate)
void Seek(int64_t new_position)
Seek the reader to a particular frame number.
int getSpeed() const
Get Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster,...
void run()
Start the thread.
std::shared_ptr< Frame > last_cached_frame
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29