31 #include "../include/DummyReader.h" 110 throw ReaderClosed(
"The ImageReader is closed. Call Open() before calling this method.",
"dummy");
118 image_frame->number = requested_frame;
123 throw InvalidFile(
"No frame could be created from this type of file.",
"dummy");
138 root[
"type"] =
"DummyReader";
149 Json::CharReaderBuilder rbuilder;
150 Json::CharReader* reader(rbuilder.newCharReader());
153 bool success = reader->parse( value.c_str(),
154 value.c_str() + value.size(), &root, &errors );
159 throw InvalidJSON(
"JSON could not be parsed (or is invalid)");
166 catch (
const std::exception& e)
169 throw InvalidJSON(
"JSON is invalid (missing keys or invalid data types)");
void SetJson(std::string value)
Load JSON string into this object.
int num
Numerator for the fraction.
Json::Value JsonValue()
Generate Json::JsonValue for this object.
std::string Json()
Get and Set JSON methods.
int width
The width of the video (in pixesl)
float ToFloat()
Return this fraction as a float (i.e. 1/2 = 0.5)
float duration
Length of time (in seconds)
void Reduce()
Reduce this fraction (i.e. 640/480 = 4/3)
Fraction Reciprocal()
Return the reciprocal as a Fraction.
Exception when a reader is closed, and a frame is requested.
bool has_video
Determines if this file has a video stream.
DummyReader()
Blank constructor for DummyReader, with default settings.
int64_t file_size
Size of file (in bytes)
bool has_audio
Determines if this file has an audio stream.
int64_t video_length
The number of frames in the video stream.
int height
The height of the video (in pixels)
void Open()
Open File - which is called by the constructor automatically.
openshot::Fraction video_timebase
The video timebase determines how long each frame stays on the screen.
Exception for files that can not be found or opened.
This class represents a fraction.
std::shared_ptr< openshot::Frame > GetFrame(int64_t requested_frame)
juce::CriticalSection getFrameCriticalSection
Section lock for multiple threads.
virtual Json::Value JsonValue()=0
Generate Json::JsonValue for this object.
virtual void SetJsonValue(Json::Value root)=0
Load Json::JsonValue into this object.
openshot::ReaderInfo info
Information about the current media file.
std::string vcodec
The name of the video codec used to encode / decode the video stream.
This namespace is the default namespace for all code in the openshot library.
Exception for invalid JSON.
openshot::Fraction display_ratio
The ratio of width to height of the video stream (i.e. 640x480 has a ratio of 4/3) ...
openshot::Fraction pixel_ratio
The pixel ratio of the video stream as a fraction (i.e. some pixels are not square) ...
int den
Denominator for the fraction.
int channels
The number of audio channels used in the audio stream.
openshot::Fraction fps
Frames per second, as a fraction (i.e. 24/1 = 24 fps)
void SetJsonValue(Json::Value root)
Load Json::JsonValue into this object.
std::string acodec
The name of the audio codec used to encode / decode the video stream.
int sample_rate
The number of audio samples per second (44100 is a common sample rate)