OpenShot Library | libopenshot
0.3.3
|
This class is used as a simple, dummy reader, which can be very useful when writing unit tests. It can return a single blank frame or it can return custom frame objects which were passed into the constructor with a Cache object. More...
#include <DummyReader.h>
Public Member Functions | |
void | Close () override |
Close File. More... | |
DummyReader () | |
Blank constructor for DummyReader, with default settings. More... | |
DummyReader (openshot::Fraction fps, int width, int height, int sample_rate, int channels, float duration) | |
Constructor for DummyReader. More... | |
DummyReader (openshot::Fraction fps, int width, int height, int sample_rate, int channels, float duration, CacheBase *cache) | |
Constructor for DummyReader which takes a frame cache object. More... | |
CacheMemory * | GetCache () override |
Get the cache object used by this reader (always returns NULL for this reader) More... | |
std::shared_ptr< openshot::Frame > | GetFrame (int64_t requested_frame) override |
bool | IsOpen () override |
Determine if reader is open or closed. More... | |
std::string | Json () const override |
Generate JSON string of this object. More... | |
Json::Value | JsonValue () const override |
Generate Json::Value for this object. More... | |
std::string | Name () override |
Return the type name of the class. More... | |
void | Open () override |
Open File - which is called by the constructor automatically. More... | |
void | SetJson (const std::string value) override |
Load JSON string into this object. More... | |
void | SetJsonValue (const Json::Value root) override |
Load Json::Value into this object. More... | |
virtual | ~DummyReader () |
Public Member Functions inherited from openshot::ReaderBase | |
void | DisplayInfo (std::ostream *out=&std::cout) |
Display file information in the standard output stream (stdout) 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 | ~ReaderBase ()=default |
Additional Inherited Members | |
Public Attributes inherited from openshot::ReaderBase | |
openshot::ReaderInfo | info |
Information about the current media file. More... | |
Protected Attributes inherited from openshot::ReaderBase | |
openshot::ClipBase * | clip |
Pointer to the parent clip instance (if any) More... | |
std::recursive_mutex | getFrameMutex |
Mutex for multiple threads. More... | |
This class is used as a simple, dummy reader, which can be very useful when writing unit tests. It can return a single blank frame or it can return custom frame objects which were passed into the constructor with a Cache object.
A dummy reader can be created with any framerate or samplerate. This is useful in unit tests that need to test different framerates or samplerates.
Definition at line 85 of file DummyReader.h.
DummyReader::DummyReader | ( | ) |
Blank constructor for DummyReader, with default settings.
Definition at line 50 of file DummyReader.cpp.
DummyReader::DummyReader | ( | openshot::Fraction | fps, |
int | width, | ||
int | height, | ||
int | sample_rate, | ||
int | channels, | ||
float | duration | ||
) |
Constructor for DummyReader.
Definition at line 57 of file DummyReader.cpp.
DummyReader::DummyReader | ( | openshot::Fraction | fps, |
int | width, | ||
int | height, | ||
int | sample_rate, | ||
int | channels, | ||
float | duration, | ||
CacheBase * | cache | ||
) |
Constructor for DummyReader which takes a frame cache object.
Definition at line 65 of file DummyReader.cpp.
|
virtual |
Definition at line 75 of file DummyReader.cpp.
|
overridevirtual |
|
inlineoverridevirtual |
Get the cache object used by this reader (always returns NULL for this reader)
Implements openshot::ReaderBase.
Definition at line 113 of file DummyReader.h.
|
overridevirtual |
Get an openshot::Frame object for a specific frame number of this reader. All numbers return the same Frame, since they all share the same image data.
requested_frame | The frame number that is requested. |
Implements openshot::ReaderBase.
Definition at line 105 of file DummyReader.cpp.
|
inlineoverridevirtual |
Determine if reader is open or closed.
Implements openshot::ReaderBase.
Definition at line 123 of file DummyReader.h.
|
overridevirtual |
Generate JSON string of this object.
Implements openshot::ReaderBase.
Definition at line 149 of file DummyReader.cpp.
|
overridevirtual |
Generate Json::Value for this object.
Implements openshot::ReaderBase.
Definition at line 156 of file DummyReader.cpp.
Referenced by Json().
|
inlineoverridevirtual |
Return the type name of the class.
Implements openshot::ReaderBase.
Definition at line 126 of file DummyReader.h.
|
overridevirtual |
Open File - which is called by the constructor automatically.
Implements openshot::ReaderBase.
Definition at line 79 of file DummyReader.cpp.
|
overridevirtual |
Load JSON string into this object.
Implements openshot::ReaderBase.
Definition at line 167 of file DummyReader.cpp.
|
overridevirtual |
Load Json::Value into this object.
Implements openshot::ReaderBase.
Definition at line 184 of file DummyReader.cpp.
Referenced by SetJson().