OpenShot Library | libopenshot  0.3.3
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
openshot::VideoCacheThread Class Reference

The video cache class. More...

#include <Qt/VideoCacheThread.h>

Inheritance diagram for openshot::VideoCacheThread:
[legend]
Collaboration diagram for openshot::VideoCacheThread:
[legend]

Public Member Functions

bool isReady ()
 Is cache ready for video/audio playback. More...
 

Protected Member Functions

int64_t getBytes (int width, int height, int sample_rate, int channels, float fps)
 Get the size in bytes of a frame (rough estimate) More...
 
int getSpeed () const
 Get Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...) More...
 
void Play ()
 Play the video. More...
 
void Reader (ReaderBase *new_reader)
 Set the current thread's reader. More...
 
void run ()
 Start the thread. More...
 
void Seek (int64_t new_position)
 Seek the reader to a particular frame number. More...
 
void Seek (int64_t new_position, bool start_preroll)
 Seek the reader to a particular frame number and optionally start the pre-roll. More...
 
void setSpeed (int new_speed)
 Set Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...) More...
 
void Stop ()
 Stop the audio playback. More...
 
 VideoCacheThread ()
 Constructor. More...
 
 ~VideoCacheThread ()
 Destructor. More...
 

Protected Attributes

int64_t cached_frame_count = 0
 
int64_t current_display_frame
 
bool is_playing
 
std::shared_ptr< Framelast_cached_frame
 
int last_speed
 
int64_t max_frames_ahead
 
int64_t min_frames_ahead
 
ReaderBasereader
 
int64_t requested_display_frame
 
bool should_break
 
bool should_pause_cache
 
int speed
 
int64_t timeline_max_frame
 

Friends

class PlayerPrivate
 Parent class of VideoCacheThread. More...
 
class QtPlayer
 

Detailed Description

The video cache class.

Definition at line 29 of file VideoCacheThread.h.

Constructor & Destructor Documentation

◆ VideoCacheThread()

openshot::VideoCacheThread::VideoCacheThread ( )
protected

Constructor.

Definition at line 29 of file VideoCacheThread.cpp.

◆ ~VideoCacheThread()

openshot::VideoCacheThread::~VideoCacheThread ( )
protected

Destructor.

Definition at line 38 of file VideoCacheThread.cpp.

Member Function Documentation

◆ getBytes()

int64_t openshot::VideoCacheThread::getBytes ( int  width,
int  height,
int  sample_rate,
int  channels,
float  fps 
)
protected

Get the size in bytes of a frame (rough estimate)

Definition at line 110 of file VideoCacheThread.cpp.

Referenced by run().

◆ getSpeed()

int openshot::VideoCacheThread::getSpeed ( ) const
inlineprotected

Get Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...)

Definition at line 55 of file VideoCacheThread.h.

◆ isReady()

bool openshot::VideoCacheThread::isReady ( )

Is cache ready for video/audio playback.

Definition at line 135 of file VideoCacheThread.cpp.

Referenced by openshot::AudioReaderSource::getNextAudioBlock().

◆ Play()

void openshot::VideoCacheThread::Play ( )
protected

Play the video.

Definition at line 123 of file VideoCacheThread.cpp.

Referenced by Reader().

◆ Reader()

void openshot::VideoCacheThread::Reader ( ReaderBase new_reader)
inlineprotected

Set the current thread's reader.

Definition at line 76 of file VideoCacheThread.h.

Referenced by openshot::QtPlayer::Reader().

◆ run()

void openshot::VideoCacheThread::run ( )
protected

Start the thread.

Definition at line 140 of file VideoCacheThread.cpp.

◆ Seek() [1/2]

void openshot::VideoCacheThread::Seek ( int64_t  new_position)
protected

Seek the reader to a particular frame number.

Definition at line 43 of file VideoCacheThread.cpp.

Referenced by Seek(), and openshot::QtPlayer::Seek().

◆ Seek() [2/2]

void openshot::VideoCacheThread::Seek ( int64_t  new_position,
bool  start_preroll 
)
protected

Seek the reader to a particular frame number and optionally start the pre-roll.

Definition at line 49 of file VideoCacheThread.cpp.

◆ setSpeed()

void openshot::VideoCacheThread::setSpeed ( int  new_speed)
protected

Set Speed (The speed and direction to playback a reader (1=normal, 2=fast, 3=faster, -1=rewind, etc...)

Definition at line 101 of file VideoCacheThread.cpp.

Referenced by openshot::QtPlayer::Speed().

◆ Stop()

void openshot::VideoCacheThread::Stop ( )
protected

Stop the audio playback.

Definition at line 129 of file VideoCacheThread.cpp.

Referenced by openshot::QtPlayer::Stop().

Friends And Related Function Documentation

◆ PlayerPrivate

friend class PlayerPrivate
friend

Parent class of VideoCacheThread.

Definition at line 76 of file VideoCacheThread.h.

◆ QtPlayer

friend class QtPlayer
friend

Definition at line 80 of file VideoCacheThread.h.

Member Data Documentation

◆ cached_frame_count

int64_t openshot::VideoCacheThread::cached_frame_count = 0
protected

Definition at line 38 of file VideoCacheThread.h.

Referenced by isReady(), run(), and Seek().

◆ current_display_frame

int64_t openshot::VideoCacheThread::current_display_frame
protected

Definition at line 37 of file VideoCacheThread.h.

Referenced by run().

◆ is_playing

bool openshot::VideoCacheThread::is_playing
protected

Definition at line 35 of file VideoCacheThread.h.

Referenced by Play(), run(), and Stop().

◆ last_cached_frame

std::shared_ptr<Frame> openshot::VideoCacheThread::last_cached_frame
protected

Definition at line 32 of file VideoCacheThread.h.

Referenced by run().

◆ last_speed

int openshot::VideoCacheThread::last_speed
protected

Definition at line 34 of file VideoCacheThread.h.

Referenced by run(), Seek(), and setSpeed().

◆ max_frames_ahead

int64_t openshot::VideoCacheThread::max_frames_ahead
protected

Definition at line 41 of file VideoCacheThread.h.

Referenced by run().

◆ min_frames_ahead

int64_t openshot::VideoCacheThread::min_frames_ahead
protected

Definition at line 40 of file VideoCacheThread.h.

Referenced by isReady(), and run().

◆ reader

ReaderBase* openshot::VideoCacheThread::reader
protected

Definition at line 39 of file VideoCacheThread.h.

Referenced by Reader(), run(), and Seek().

◆ requested_display_frame

int64_t openshot::VideoCacheThread::requested_display_frame
protected

Definition at line 36 of file VideoCacheThread.h.

Referenced by run(), and Seek().

◆ should_break

bool openshot::VideoCacheThread::should_break
protected

Definition at line 44 of file VideoCacheThread.h.

Referenced by run(), and Seek().

◆ should_pause_cache

bool openshot::VideoCacheThread::should_pause_cache
protected

Definition at line 43 of file VideoCacheThread.h.

Referenced by run(), and Seek().

◆ speed

int openshot::VideoCacheThread::speed
protected

Definition at line 33 of file VideoCacheThread.h.

Referenced by getSpeed(), run(), Seek(), and setSpeed().

◆ timeline_max_frame

int64_t openshot::VideoCacheThread::timeline_max_frame
protected

Definition at line 42 of file VideoCacheThread.h.

Referenced by run(), and Seek().


The documentation for this class was generated from the following files: