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:

## 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::CacheBase * | GetCache ()=0
| Get the cache object used by this reader (note: not all readers use cache) More...
openshot::ClipBase * | GetClip ()
| Parent clip object of this reader (which can be unparented and NULL) More...
virtual std::shared_ptr< openshot::Frame > | GetFrame (int64_t number)=0
virtual bool | IsOpen ()=0
| Determine if reader is open or closed. More...
virtual std::string | Json () const =0
| Get and Set JSON methods. 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...
| 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 (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

juce::CriticalSection | getFrameCriticalSection
| Section lock for multiple threads. More...
openshot::ClipBase * | parent
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 | ( |  | ) |

virtual default

## Member Function Documentation

## Close()

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

pure virtual

Close the reader (and any resources it was consuming)

Implemented in openshot::Timeline, openshot::TextReader, openshot::QtTextReader, openshot::QtImageReader, openshot::QtHtmlReader, openshot::ImageReader, openshot::FrameMapper, openshot::FFmpegReader, openshot::DummyReader, openshot::DecklinkReader, and openshot::ChunkReader.

Referenced by openshot::ChunkWriter::Close(), openshot::Clip::Close(), openshot::FrameMapper::Close(), openshot::ChunkReader::GetFrame(), openshot::Clip::SetJsonValue(), and openshot::Mask::SetJsonValue().

## 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

Get the cache object used by this reader (note: not all readers use cache)

Implemented in openshot::Timeline, openshot::TextReader, openshot::QtTextReader, openshot::QtImageReader, openshot::QtHtmlReader, openshot::ImageReader, openshot::FrameMapper, openshot::FFmpegReader, openshot::DummyReader, openshot::DecklinkReader, and openshot::ChunkReader.

Referenced by openshot::Timeline::ClearAllCache().

## GetClip()

openshot::ClipBase * ReaderBase::GetClip | ( |  | ) |

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

Definition at line 254 of file ReaderBase.cpp.

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

## GetFrame()

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

pure virtual

This method is required for all derived classes of ReaderBase, and returns the openshot::Frame object, which contains the image and audio information for that frame of video.

Returns
  The requested frame of video

Parameters

  [in] | number | The frame number that is requested.

Implemented in openshot::Timeline, openshot::TextReader, openshot::QtTextReader, openshot::QtImageReader, openshot::QtHtmlReader, openshot::ImageReader, openshot::FrameMapper, openshot::FFmpegReader, openshot::DummyReader, openshot::DecklinkReader, and openshot::ChunkReader.

Referenced by openshot::ChunkReader::GetFrame(), openshot::Mask::GetFrame(), openshot::ChunkWriter::WriteFrame(), openshot::FFmpegWriter::WriteFrame(), openshot::DecklinkWriter::WriteFrame(), and openshot::ImageWriter::WriteFrame().

## IsOpen()

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

pure virtual

Determine if reader is open or closed.

Implemented in openshot::Timeline, openshot::TextReader, openshot::QtTextReader, openshot::QtImageReader, openshot::QtHtmlReader, openshot::ImageReader, openshot::FrameMapper, openshot::FFmpegReader, openshot::DummyReader, openshot::DecklinkReader, and openshot::ChunkReader.

Referenced by openshot::Mask::GetFrame(), openshot::AudioReaderSource::getNextAudioBlock(), openshot::FrameMapper::IsOpen(), and openshot::Clip::SetJsonValue().

## Json()

virtual std::string openshot::ReaderBase::Json | ( |  | ) | const

pure virtual

Get and Set JSON methods.

Generate JSON string of this object

Implemented in openshot::Timeline, openshot::TextReader, openshot::QtTextReader, openshot::QtImageReader, openshot::QtHtmlReader, openshot::ImageReader, openshot::FrameMapper, openshot::FFmpegReader, openshot::DummyReader, openshot::DecklinkReader, and openshot::ChunkReader.

Referenced by openshot::Mask::PropertiesJSON().

## JsonValue()

Json::Value ReaderBase::JsonValue | ( |  | ) | const

pure virtual

Generate Json::Value for this object.

Implemented in openshot::Timeline, openshot::TextReader, openshot::QtTextReader, openshot::QtImageReader, openshot::QtHtmlReader, openshot::FrameMapper, openshot::FFmpegReader, openshot::DummyReader, openshot::ChunkReader, openshot::ImageReader, and openshot::DecklinkReader.

Definition at line 116 of file ReaderBase.cpp.

Referenced by openshot::DecklinkReader::JsonValue(), openshot::ImageReader::JsonValue(), openshot::ChunkReader::JsonValue(), openshot::Clip::JsonValue(), openshot::DummyReader::JsonValue(), openshot::Mask::JsonValue(), openshot::FFmpegReader::JsonValue(), openshot::FrameMapper::JsonValue(), openshot::QtHtmlReader::JsonValue(), openshot::QtImageReader::JsonValue(), openshot::QtTextReader::JsonValue(), openshot::TextReader::JsonValue(), and openshot::Timeline::JsonValue().

## Name()

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

pure virtual

Return the type name of the class.

Implemented in openshot::Timeline, openshot::TextReader, openshot::QtTextReader, openshot::QtImageReader, openshot::QtHtmlReader, openshot::ImageReader, openshot::FrameMapper, openshot::FFmpegReader, openshot::DummyReader, openshot::DecklinkReader, and openshot::ChunkReader.

## Open()

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

pure virtual

Open the reader (and start consuming resources, such as images or video files)

Implemented in openshot::Timeline, openshot::TextReader, openshot::QtTextReader, openshot::QtImageReader, openshot::QtHtmlReader, openshot::ImageReader, openshot::FrameMapper, openshot::FFmpegReader, openshot::DummyReader, openshot::DecklinkReader, and openshot::ChunkReader.

Referenced by openshot::ChunkWriter::ChunkWriter(), openshot::ChunkReader::GetFrame(), openshot::Mask::GetFrame(), openshot::Clip::Open(), openshot::FrameMapper::Open(), and openshot::Clip::SetJsonValue().

## SetClip()

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

Set parent clip object of this reader.

Definition at line 259 of file ReaderBase.cpp.

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

## SetJson()

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

pure virtual

Load JSON string into this object.

Implemented in openshot::Timeline, openshot::TextReader, openshot::QtTextReader, openshot::QtImageReader, openshot::QtHtmlReader, openshot::ImageReader, openshot::FrameMapper, openshot::FFmpegReader, openshot::DummyReader, openshot::DecklinkReader, and openshot::ChunkReader.

## SetJsonValue()

void ReaderBase::SetJsonValue | ( | const Json::Value | root | ) |

pure virtual

Load Json::Value into this object.

Implemented in openshot::Timeline, openshot::TextReader, openshot::QtTextReader, openshot::QtImageReader, openshot::QtHtmlReader, openshot::ImageReader, openshot::FrameMapper, openshot::FFmpegReader, openshot::DummyReader, openshot::DecklinkReader, and openshot::ChunkReader.

Definition at line 171 of file ReaderBase.cpp.

Referenced by openshot::ChunkReader::SetJsonValue(), openshot::Clip::SetJsonValue(), openshot::DecklinkReader::SetJsonValue(), openshot::DummyReader::SetJsonValue(), openshot::Mask::SetJsonValue(), openshot::FFmpegReader::SetJsonValue(), openshot::FrameMapper::SetJsonValue(), openshot::ImageReader::SetJsonValue(), openshot::QtHtmlReader::SetJsonValue(), openshot::QtImageReader::SetJsonValue(), openshot::QtTextReader::SetJsonValue(), openshot::TextReader::SetJsonValue(), and openshot::Timeline::SetJsonValue().

## Member Data Documentation

## getFrameCriticalSection

juce::CriticalSection openshot::ReaderBase::getFrameCriticalSection

protected

Section lock for multiple threads.

Definition at line 101 of file ReaderBase.h.

Referenced by openshot::Timeline::ApplyJsonDiff(), openshot::Timeline::ClearAllCache(), openshot::FrameMapper::Close(), openshot::DummyReader::GetFrame(), openshot::FrameMapper::GetFrame(), openshot::QtImageReader::GetFrame(), openshot::Timeline::GetFrame(), and openshot::Timeline::SetJson().

## info

openshot::ReaderInfo openshot::ReaderBase::info

Information about the current media file.

Definition at line 111 of file ReaderBase.h.

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

## parent

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

protected

Definition at line 103 of file ReaderBase.h.

Referenced by GetClip(), openshot::QtImageReader::GetFrame(), ReaderBase(), and SetClip().

## processingCriticalSection

juce::CriticalSection openshot::ReaderBase::processingCriticalSection

protected

Definition at line 102 of file ReaderBase.h.

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

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

- ReaderBase.h
- ReaderBase.cpp