OpenShot Library | libopenshot  0.3.3
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:
[legend]
Collaboration diagram for openshot::ReaderBase:
[legend]

Public Member Functions

virtual void Close ()=0
 Close the reader (and any resources it was consuming) More...
 
void DisplayInfo (std::ostream *out=&std::cout)
 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...
 
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 () const =0
 Generate JSON string of this object. More...
 
virtual Json::Value JsonValue () const =0
 Generate Json::Value 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...
 
openshot::ClipBaseParentClip ()
 Parent clip object of this reader (which can be unparented and NULL) More...
 
void ParentClip (openshot::ClipBase *new_clip)
 Set parent clip object of this reader. More...
 
 ReaderBase ()
 Constructor for the base reader, where many things are initialized. More...
 
virtual void SetJson (const std::string value)=0
 Load JSON string into this object. More...
 
virtual void SetJsonValue (const Json::Value root)=0
 Load Json::Value into this object. More...
 
virtual ~ReaderBase ()=default
 

Public Attributes

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

Protected Attributes

openshot::ClipBaseclip
 Pointer to the parent clip instance (if any) More...
 
std::recursive_mutex getFrameMutex
 Mutex for multiple threads. More...
 

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 75 of file ReaderBase.h.

Constructor & Destructor Documentation

◆ ReaderBase()

ReaderBase::ReaderBase ( )

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

Definition at line 27 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 ( std::ostream *  out = &std::cout)

Display file information in the standard output stream (stdout)

Definition at line 61 of file ReaderBase.cpp.

Referenced by openshot::QtPlayer::SetSource(), and openshot::QtPlayer::SetTimelineSource().

◆ GetCache()

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

◆ 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 ( ) const
pure virtual

◆ JsonValue()

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

◆ Name()

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

◆ Open()

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

◆ ParentClip() [1/2]

openshot::ClipBase * ReaderBase::ParentClip ( )

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

Definition at line 245 of file ReaderBase.cpp.

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

◆ ParentClip() [2/2]

void ReaderBase::ParentClip ( openshot::ClipBase new_clip)

Set parent clip object of this reader.

Definition at line 250 of file ReaderBase.cpp.

◆ SetJson()

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

◆ SetJsonValue()

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

Member Data Documentation

◆ clip

openshot::ClipBase* openshot::ReaderBase::clip
protected

◆ getFrameMutex

std::recursive_mutex openshot::ReaderBase::getFrameMutex
protected

◆ info

openshot::ReaderInfo openshot::ReaderBase::info

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