OpenShot Library | libopenshot  0.2.4
Public Member Functions | Public Attributes | Protected Attributes | List of all members
openshot::ReaderBase Class Referenceabstract

This abstract class is the base class, used by all readers in libopenshot. More...

#include <ReaderBase.h>

Inheritance diagram for openshot::ReaderBase:
openshot::ChunkReader openshot::DecklinkReader openshot::DummyReader openshot::FFmpegReader openshot::FrameMapper openshot::ImageReader openshot::QtHtmlReader openshot::QtImageReader openshot::QtTextReader openshot::TextReader openshot::Timeline

Public Member Functions

virtual void Close ()=0
 Close the reader (and any resources it was consuming) More...
 
void DisplayInfo ()
 Display file information in the standard output stream (stdout) More...
 
virtual openshot::CacheBaseGetCache ()=0
 Get the cache object used by this reader (note: not all readers use cache) More...
 
openshot::ClipBaseGetClip ()
 Parent clip object of this reader (which can be unparented and NULL) More...
 
virtual std::shared_ptr< openshot::FrameGetFrame (int64_t number)=0
 
virtual bool IsOpen ()=0
 Determine if reader is open or closed. More...
 
virtual std::string Json ()=0
 Get and Set JSON methods. More...
 
virtual Json::Value JsonValue ()=0
 Generate Json::JsonValue for this object. More...
 
virtual std::string Name ()=0
 Return the type name of the class. More...
 
virtual void Open ()=0
 Open the reader (and start consuming resources, such as images or video files) More...
 
 ReaderBase ()
 Constructor for the base reader, where many things are initialized. More...
 
void SetClip (openshot::ClipBase *clip)
 Set parent clip object of this reader. More...
 
virtual void SetJson (std::string value)=0
 Load JSON string into this object. More...
 
virtual void SetJsonValue (Json::Value root)=0
 Load Json::JsonValue into this object. More...
 
virtual ~ReaderBase ()=default
 

Public Attributes

openshot::ReaderInfo info
 Information about the current media file. More...
 

Protected Attributes

juce::CriticalSection getFrameCriticalSection
 Section lock for multiple threads. More...
 
openshot::ClipBaseparent
 
juce::CriticalSection processingCriticalSection
 

Detailed Description

This abstract class is the base class, used by all readers in libopenshot.

Readers are types of classes that read video, audio, and image files, and return openshot::Frame objects. The only requirements for a 'reader', are to derive from this base class, implement the GetFrame method, and populate ReaderInfo.

Definition at line 97 of file ReaderBase.h.

Constructor & Destructor Documentation

◆ ReaderBase()

ReaderBase::ReaderBase ( )

Constructor for the base reader, where many things are initialized.

Definition at line 36 of file ReaderBase.cpp.

◆ ~ReaderBase()

virtual openshot::ReaderBase::~ReaderBase ( )
virtualdefault

Member Function Documentation

◆ Close()

virtual void openshot::ReaderBase::Close ( )
pure virtual

◆ DisplayInfo()

void ReaderBase::DisplayInfo ( )

Display file information in the standard output stream (stdout)

Definition at line 70 of file ReaderBase.cpp.

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

◆ GetCache()

virtual openshot::CacheBase* openshot::ReaderBase::GetCache ( )
pure virtual

◆ GetClip()

openshot::ClipBase * ReaderBase::GetClip ( )

Parent clip object of this reader (which can be unparented and NULL)

Definition at line 253 of file ReaderBase.cpp.

Referenced by openshot::QtImageReader::GetFrame(), and openshot::FFmpegReader::GetFrame().

◆ GetFrame()

virtual std::shared_ptr<openshot::Frame> openshot::ReaderBase::GetFrame ( int64_t  number)
pure virtual

◆ IsOpen()

virtual bool openshot::ReaderBase::IsOpen ( )
pure virtual

◆ Json()

virtual std::string openshot::ReaderBase::Json ( )
pure virtual

◆ JsonValue()

Json::Value ReaderBase::JsonValue ( )
pure virtual

◆ Name()

virtual std::string openshot::ReaderBase::Name ( )
pure virtual

◆ Open()

virtual void openshot::ReaderBase::Open ( )
pure virtual

◆ SetClip()

void ReaderBase::SetClip ( openshot::ClipBase clip)

Set parent clip object of this reader.

Definition at line 258 of file ReaderBase.cpp.

Referenced by openshot::Clip::Reader(), and openshot::Clip::SetJsonValue().

◆ SetJson()

virtual void openshot::ReaderBase::SetJson ( std::string  value)
pure virtual

◆ SetJsonValue()

void ReaderBase::SetJsonValue ( Json::Value  root)
pure virtual

Member Data Documentation

◆ getFrameCriticalSection

juce::CriticalSection openshot::ReaderBase::getFrameCriticalSection
protected

◆ info

openshot::ReaderInfo openshot::ReaderBase::info

Information about the current media file.

Definition at line 111 of file ReaderBase.h.

Referenced by openshot::Timeline::ApplyJsonDiff(), openshot::Timeline::ApplyMapperToClips(), openshot::AudioReaderSource::AudioReaderSource(), openshot::FrameMapper::ChangeMapping(), openshot::ChunkReader::ChunkReader(), openshot::Clip::Clip(), openshot::QtImageReader::Close(), openshot::QtHtmlReader::Close(), openshot::QtTextReader::Close(), openshot::FFmpegReader::Close(), openshot::AudioDeviceManagerSingleton::CloseAudioDevice(), openshot::WriterBase::CopyReaderInfo(), DisplayInfo(), openshot::DummyReader::DummyReader(), openshot::Clip::End(), openshot::FFmpegReader::FFmpegReader(), openshot::FrameMapper::FrameMapper(), openshot::QtImageReader::GetFrame(), openshot::Mask::GetFrame(), openshot::Clip::GetFrame(), openshot::FrameMapper::GetFrame(), openshot::Timeline::GetFrame(), openshot::FFmpegReader::GetFrame(), openshot::FrameMapper::GetMappedFrame(), openshot::AudioReaderSource::getNextAudioBlock(), openshot::AudioReaderSource::getReaderInfo(), openshot::AudioReaderSource::getTotalLength(), JsonValue(), openshot::DummyReader::Open(), openshot::QtImageReader::Open(), openshot::ImageReader::Open(), openshot::DecklinkReader::Open(), openshot::QtHtmlReader::Open(), openshot::QtTextReader::Open(), openshot::TextReader::Open(), openshot::Clip::Open(), openshot::FFmpegReader::Open(), openshot::FrameMapper::Reader(), ReaderBase(), openshot::Timeline::RemoveClip(), openshot::FrameMapper::ResampleMappedAudio(), SetJsonValue(), openshot::Timeline::SetJsonValue(), openshot::Timeline::SetMaxSize(), openshot::QtPlayer::SetSource(), openshot::QtPlayer::Speed(), openshot::Timeline::Timeline(), and openshot::AudioReaderSource::~AudioReaderSource().

◆ parent

openshot::ClipBase* openshot::ReaderBase::parent
protected

◆ processingCriticalSection

juce::CriticalSection openshot::ReaderBase::processingCriticalSection
protected

Definition at line 102 of file ReaderBase.h.

Referenced by openshot::FFmpegReader::GetFrame().


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