OpenShot Library | libopenshot 0.2.7
|
This abstract class is the base class, used by all readers in libopenshot. More...
#include <ReaderBase.h>
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... | |
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 |
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::ClipBase * | ParentClip () |
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::ClipBase * | clip |
Pointer to the parent clip instance (if any) More... | |
juce::CriticalSection | getFrameCriticalSection |
Section lock for multiple threads. More... | |
juce::CriticalSection | processingCriticalSection |
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.
ReaderBase::ReaderBase | ( | ) |
Constructor for the base reader, where many things are initialized.
Definition at line 36 of file ReaderBase.cpp.
|
virtualdefault |
|
pure virtual |
Close the reader (and any resources it was consuming)
Implemented in openshot::DecklinkReader, openshot::ChunkReader, openshot::Clip, openshot::DummyReader, openshot::FFmpegReader, openshot::FrameMapper, openshot::ImageReader, openshot::QtHtmlReader, openshot::QtImageReader, openshot::QtTextReader, openshot::TextReader, and openshot::Timeline.
Referenced by openshot::ChunkWriter::Close(), openshot::Clip::Close(), openshot::FrameMapper::Close(), openshot::ChunkReader::GetFrame(), openshot::Clip::SetJsonValue(), and openshot::Mask::SetJsonValue().
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().
|
pure virtual |
Get the cache object used by this reader (note: not all readers use cache)
Implemented in openshot::DecklinkReader, openshot::ChunkReader, openshot::Clip, openshot::DummyReader, openshot::FFmpegReader, openshot::FrameMapper, openshot::ImageReader, openshot::QtHtmlReader, openshot::QtImageReader, openshot::QtTextReader, openshot::TextReader, and openshot::Timeline.
Referenced by openshot::Timeline::ClearAllCache(), and openshot::VideoCacheThread::run().
|
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.
[in] | number | The frame number that is requested. |
Implemented in openshot::Clip, openshot::DecklinkReader, openshot::ChunkReader, openshot::DummyReader, openshot::FFmpegReader, openshot::FrameMapper, openshot::ImageReader, openshot::QtHtmlReader, openshot::QtImageReader, openshot::QtTextReader, openshot::TextReader, and openshot::Timeline.
Referenced by openshot::ChunkReader::GetFrame(), openshot::Mask::GetFrame(), openshot::VideoCacheThread::run(), openshot::ChunkWriter::WriteFrame(), openshot::FFmpegWriter::WriteFrame(), openshot::DecklinkWriter::WriteFrame(), and openshot::ImageWriter::WriteFrame().
|
pure virtual |
Determine if reader is open or closed.
Implemented in openshot::DecklinkReader, openshot::ChunkReader, openshot::Clip, openshot::DummyReader, openshot::FFmpegReader, openshot::FrameMapper, openshot::ImageReader, openshot::QtHtmlReader, openshot::QtImageReader, openshot::QtTextReader, openshot::TextReader, and openshot::Timeline.
Referenced by openshot::Mask::GetFrame(), openshot::AudioReaderSource::getNextAudioBlock(), openshot::FrameMapper::IsOpen(), and openshot::Clip::SetJsonValue().
|
pure virtual |
Generate JSON string of this object.
Implemented in openshot::ChunkReader, openshot::Clip, openshot::DecklinkReader, openshot::DummyReader, openshot::FFmpegReader, openshot::FrameMapper, openshot::ImageReader, openshot::QtHtmlReader, openshot::QtImageReader, openshot::QtTextReader, openshot::TextReader, and openshot::Timeline.
Referenced by openshot::Mask::PropertiesJSON().
|
pure virtual |
Generate Json::Value for this object.
Implemented in openshot::DecklinkReader, openshot::ChunkReader, openshot::Clip, openshot::DummyReader, openshot::FFmpegReader, openshot::FrameMapper, openshot::ImageReader, openshot::QtHtmlReader, openshot::QtImageReader, openshot::QtTextReader, openshot::TextReader, and openshot::Timeline.
Definition at line 116 of file ReaderBase.cpp.
Referenced by openshot::DecklinkReader::JsonValue(), openshot::ChunkReader::JsonValue(), openshot::Clip::JsonValue(), openshot::DummyReader::JsonValue(), openshot::Mask::JsonValue(), openshot::FFmpegReader::JsonValue(), openshot::FrameMapper::JsonValue(), openshot::ImageReader::JsonValue(), openshot::QtHtmlReader::JsonValue(), openshot::QtImageReader::JsonValue(), openshot::QtTextReader::JsonValue(), openshot::TextReader::JsonValue(), and openshot::Timeline::JsonValue().
|
pure virtual |
Return the type name of the class.
Implemented in openshot::DecklinkReader, openshot::ChunkReader, openshot::Clip, openshot::DummyReader, openshot::FFmpegReader, openshot::FrameMapper, openshot::ImageReader, openshot::QtHtmlReader, openshot::QtImageReader, openshot::QtTextReader, openshot::TextReader, and openshot::Timeline.
|
pure virtual |
Open the reader (and start consuming resources, such as images or video files)
Implemented in openshot::DecklinkReader, openshot::ChunkReader, openshot::Clip, openshot::DummyReader, openshot::FFmpegReader, openshot::FrameMapper, openshot::ImageReader, openshot::QtHtmlReader, openshot::QtImageReader, openshot::QtTextReader, openshot::TextReader, and openshot::Timeline.
Referenced by openshot::ChunkWriter::ChunkWriter(), openshot::ChunkReader::GetFrame(), openshot::Mask::GetFrame(), openshot::Clip::Open(), openshot::FrameMapper::Open(), and openshot::Clip::SetJsonValue().
openshot::ClipBase * ReaderBase::ParentClip | ( | ) |
Parent clip object of this reader (which can be unparented and NULL)
Definition at line 254 of file ReaderBase.cpp.
Referenced by openshot::Clip::Clip(), openshot::FrameMapper::GetFrame(), openshot::Clip::Reader(), and openshot::Clip::SetJsonValue().
void ReaderBase::ParentClip | ( | openshot::ClipBase * | new_clip | ) |
Set parent clip object of this reader.
Definition at line 259 of file ReaderBase.cpp.
|
pure virtual |
Load JSON string into this object.
Implemented in openshot::DecklinkReader, openshot::ChunkReader, openshot::Clip, openshot::DummyReader, openshot::FFmpegReader, openshot::FrameMapper, openshot::ImageReader, openshot::QtHtmlReader, openshot::QtImageReader, openshot::QtTextReader, openshot::TextReader, and openshot::Timeline.
|
pure virtual |
Load Json::Value into this object.
Implemented in openshot::DecklinkReader, openshot::ChunkReader, openshot::Clip, openshot::DummyReader, openshot::FFmpegReader, openshot::FrameMapper, openshot::ImageReader, openshot::QtHtmlReader, openshot::QtImageReader, openshot::QtTextReader, openshot::TextReader, and openshot::Timeline.
Definition at line 171 of file ReaderBase.cpp.
Referenced by openshot::DecklinkReader::SetJsonValue(), openshot::ChunkReader::SetJsonValue(), openshot::Clip::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().
|
protected |
Pointer to the parent clip instance (if any)
Definition at line 103 of file ReaderBase.h.
Referenced by openshot::Timeline::AddClip(), openshot::Timeline::ApplyMapperToClips(), openshot::Timeline::ClearAllCache(), openshot::Timeline::ClipEffects(), openshot::Timeline::Close(), openshot::Timeline::GetClip(), openshot::Timeline::GetClipEffect(), openshot::Timeline::GetFrame(), ParentClip(), ReaderBase(), openshot::Timeline::RemoveClip(), and openshot::Timeline::Timeline().
|
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().
openshot::ReaderInfo openshot::ReaderBase::info |
Information about the current media file.
Definition at line 111 of file ReaderBase.h.
Referenced by openshot::Timeline::apply_effects(), 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::Clip::End(), openshot::FFmpegReader::FFmpegReader(), openshot::FrameMapper::FrameMapper(), openshot::FFmpegReader::GetFrame(), openshot::FrameMapper::GetFrame(), openshot::QtImageReader::GetFrame(), openshot::Timeline::GetFrame(), openshot::Mask::GetFrame(), openshot::FrameMapper::GetMappedFrame(), openshot::Timeline::GetMaxFrame(), openshot::AudioReaderSource::getNextAudioBlock(), openshot::AudioReaderSource::getReaderInfo(), openshot::AudioReaderSource::getTotalLength(), openshot::Clip::init_reader_rotation(), openshot::Clip::init_reader_settings(), JsonValue(), openshot::DecklinkReader::Open(), openshot::Clip::Open(), openshot::DummyReader::Open(), openshot::FFmpegReader::Open(), openshot::ImageReader::Open(), openshot::QtHtmlReader::Open(), openshot::QtImageReader::Open(), openshot::QtTextReader::Open(), openshot::TextReader::Open(), openshot::Clip::PropertiesJSON(), ReaderBase(), openshot::FrameMapper::ResampleMappedAudio(), openshot::VideoCacheThread::run(), openshot::Timeline::SetJsonValue(), SetJsonValue(), openshot::Timeline::SetMaxSize(), openshot::QtPlayer::SetSource(), openshot::QtPlayer::Speed(), and openshot::Timeline::Timeline().
|
protected |
Definition at line 102 of file ReaderBase.h.