|
OpenShot Library | libopenshot
0.6.0
|
Go to the documentation of this file.
13 #ifndef OPENSHOT_READER_BASE_H
14 #define OPENSHOT_READER_BASE_H
111 virtual void Close() = 0;
125 virtual std::shared_ptr<openshot::Frame>
GetFrame(int64_t number) = 0;
128 virtual bool IsOpen() = 0;
135 virtual std::string
Name() = 0;
138 virtual std::string
Json()
const = 0;
139 virtual void SetJson(
const std::string value) = 0;
140 virtual Json::Value
JsonValue()
const = 0;
144 virtual void Open() = 0;
void DisplayInfo(std::ostream *out=&std::cout)
Display file information in the standard output stream (stdout)
Header file for ChannelLayout class.
virtual ~ReaderBase()=default
int sample_rate
The number of audio samples per second (44100 is a common sample rate)
virtual Json::Value JsonValue() const =0
Generate Json::Value for this object.
int MaxDecodeHeight() const
Return the current maximum decoded frame height (0 when unlimited).
Header file for Fraction class.
virtual std::shared_ptr< openshot::Frame > GetFrame(int64_t number)=0
virtual void SetJsonValue(const Json::Value root)=0
Load Json::Value into this object.
virtual std::string Json() const =0
Generate JSON string of this object.
This namespace is the default namespace for all code in the openshot library.
int max_decode_width
Optional maximum decoded frame width (0 disables the limit)
This class represents a fraction.
openshot::ReaderInfo info
Information about the current media file.
int audio_bit_rate
The bit rate of the audio stream (in bytes)
float duration
Length of time (in seconds)
virtual std::string Name()=0
Return the type name of the class.
bool has_video
Determines if this file has a video stream.
int width
The width of the video (in pixesl)
All cache managers in libopenshot are based on this CacheBase class.
openshot::ClipBase * clip
Pointer to the parent clip instance (if any)
int MaxDecodeWidth() const
Return the current maximum decoded frame width (0 when unlimited).
int64_t video_length
The number of frames in the video stream.
int height
The height of the video (in pixels)
void SetMaxDecodeSize(int width, int height)
Set an optional maximum decoded frame size. Use 0,0 to disable the limit.
virtual void Open()=0
Open the reader (and start consuming resources, such as images or video files)
bool has_audio
Determines if this file has an audio stream.
virtual bool IsOpen()=0
Determine if reader is open or closed.
int64_t file_size
Size of file (in bytes)
This struct contains info about a media file, such as height, width, frames per second,...
bool has_single_image
Determines if this file only contains a single image.
openshot::Fraction video_timebase
The video timebase determines how long each frame stays on the screen.
int max_decode_height
Optional maximum decoded frame height (0 disables the limit)
std::map< std::string, std::string > metadata
An optional map/dictionary of metadata for this reader.
int audio_stream_index
The index of the audio stream.
openshot::Fraction audio_timebase
The audio timebase determines how long each audio packet should be played.
int pixel_format
The pixel format (i.e. YUV420P, RGB24, etc...)
std::string vcodec
The name of the video codec used to encode / decode the video stream.
openshot::ChannelLayout channel_layout
The channel layout (mono, stereo, 5 point surround, etc...)
ReaderBase()
Constructor for the base reader, where many things are initialized.
openshot::Fraction fps
Frames per second, as a fraction (i.e. 24/1 = 24 fps)
int video_bit_rate
The bit rate of the video stream (in bytes)
This abstract class is the base class, used by all readers in libopenshot.
virtual void Close()=0
Close the reader (and any resources it was consuming)
virtual bool HardwareDecodeSuccessful() const
ChannelLayout
This enumeration determines the audio channel layout (such as stereo, mono, 5 point surround,...
openshot::Fraction pixel_ratio
The pixel ratio of the video stream as a fraction (i.e. some pixels are not square)
virtual void SetJson(const std::string value)=0
Load JSON string into this object.
Header file for JSON class.
int video_stream_index
The index of the video stream.
bool HasMaxDecodeSize() const
Return true when a maximum decoded frame size is active.
This abstract class is the base class, used by all clips in libopenshot.
std::string acodec
The name of the audio codec used to encode / decode the video stream.
openshot::Fraction display_ratio
The ratio of width to height of the video stream (i.e. 640x480 has a ratio of 4/3)
int channels
The number of audio channels used in the audio stream.
virtual openshot::CacheBase * GetCache()=0
Get the cache object used by this reader (note: not all readers use cache)
std::recursive_mutex getFrameMutex
Mutex for multiple threads.
openshot::ClipBase * ParentClip()
Parent clip object of this reader (which can be unparented and NULL)