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 CacheBase * | GetCache ()=0
| Get the cache object used by this reader (note: not all readers use cache) More...
virtual std::shared_ptr< Frame > | GetFrame (int64_t number)=0
virtual bool | IsOpen ()=0
| Determine if reader is open or closed. More...
virtual string | Json ()=0
| Get and Set JSON methods. More...
virtual Json::Value | JsonValue ()=0
| Generate Json::JsonValue for this object. More...
virtual 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...
virtual void | SetJson (string value)=0
| Load JSON string into this object. More...
virtual void | SetJsonValue (Json::Value root)=0
| Load Json::JsonValue into this object. More...
void | SetMaxSize (int width, int height)
| Set Max Image Size (used for performance optimization) More...

## Public Attributes

ReaderInfo | info
| Information about the current media file. More...

## Protected Attributes

CriticalSection | getFrameCriticalSection
| Section lock for multiple threads. More...
int | max_height
| The maximium image height needed by this clip (used for optimizations) More...
int | max_width
| The maximum image width needed by this clip (used for optimizations) More...
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 call the InitFileInfo() method.

Definition at line 96 of file ReaderBase.h.

## Constructor & Destructor Documentation

## ReaderBase()

ReaderBase::ReaderBase | ( |  | ) |

Constructor for the base reader, where many things are initialized.

Definition at line 33 of file ReaderBase.cpp.

## Member Function Documentation

## Close()

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

pure virtual

Close the reader (and any resources it was consuming)

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

## DisplayInfo()

void ReaderBase::DisplayInfo | ( |  | ) |

Display file information in the standard output stream (stdout)

Definition at line 66 of file ReaderBase.cpp.

## GetCache()

virtual CacheBase* openshot::ReaderBase::GetCache | ( |  | ) |

pure virtual

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

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

## GetFrame()

virtual std::shared_ptr<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::FFmpegReader, openshot::Timeline, openshot::FrameMapper, openshot::ChunkReader, openshot::TextReader, openshot::DecklinkReader, openshot::QtImageReader, openshot::ImageReader, and openshot::DummyReader.

## IsOpen()

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

pure virtual

Determine if reader is open or closed.

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

## Json()

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

pure virtual

Get and Set JSON methods.

Generate JSON string of this object

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

## JsonValue()

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

pure virtual

Generate Json::JsonValue for this object.

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

Definition at line 113 of file ReaderBase.cpp.

## Name()

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

pure virtual

Return the type name of the class.

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

## 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::FFmpegReader, openshot::FrameMapper, openshot::ChunkReader, openshot::TextReader, openshot::DecklinkReader, openshot::QtImageReader, openshot::ImageReader, and openshot::DummyReader.

## SetJson()

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

pure virtual

Load JSON string into this object.

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

## SetJsonValue()

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

pure virtual

Load Json::JsonValue into this object.

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

Definition at line 168 of file ReaderBase.cpp.

## SetMaxSize()

void openshot::ReaderBase::SetMaxSize | ( | int | width,
|  | int | height
| ) |  |

inline

Set Max Image Size (used for performance optimization)

Definition at line 144 of file ReaderBase.h.

## Member Data Documentation

## getFrameCriticalSection

CriticalSection openshot::ReaderBase::getFrameCriticalSection

protected

Section lock for multiple threads.

Definition at line 100 of file ReaderBase.h.

## info

ReaderInfo openshot::ReaderBase::info

Information about the current media file.

Definition at line 112 of file ReaderBase.h.

## max_height

int openshot::ReaderBase::max_height

protected

The maximium image height needed by this clip (used for optimizations)

Definition at line 104 of file ReaderBase.h.

## max_width

int openshot::ReaderBase::max_width

protected

The maximum image width needed by this clip (used for optimizations)

Definition at line 103 of file ReaderBase.h.

## processingCriticalSection

CriticalSection openshot::ReaderBase::processingCriticalSection

protected

Definition at line 101 of file ReaderBase.h.

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

- ReaderBase.h
- ReaderBase.cpp