OpenShot Library | libopenshot  0.2.7
Public Member Functions | Public Attributes | List of all members
openshot::WriterBase Class Referenceabstract

This abstract class is the base class, used by writers. Writers are types of classes that encode video, audio, and image files. More...

#include <WriterBase.h>

Inheritance diagram for openshot::WriterBase:
openshot::ChunkWriter openshot::FFmpegWriter openshot::ImageWriter

Public Member Functions

void CopyReaderInfo (openshot::ReaderBase *reader)
 This method copy's the info struct of a reader, and sets the writer with the same info. More...
 
void DisplayInfo (std::ostream *out=&std::cout)
 Display file information in the standard output stream (stdout) More...
 
virtual bool IsOpen ()=0
 Determine if writer is open or closed. More...
 
std::string Json () const
 Generate JSON string of this object. More...
 
Json::Value JsonValue () const
 Generate Json::Value for this object. More...
 
virtual void Open ()=0
 Open the writer (and start initializing streams) More...
 
void SetJson (const std::string value)
 Load JSON string into this object. More...
 
void SetJsonValue (const Json::Value root)
 Load Json::Value into this object. More...
 
virtual void WriteFrame (std::shared_ptr< openshot::Frame > frame)=0
 This method is required for all derived classes of WriterBase. Write a Frame to the video file. More...
 
virtual void WriteFrame (openshot::ReaderBase *reader, int64_t start, int64_t length)=0
 This method is required for all derived classes of WriterBase. Write a block of frames from a reader. More...
 
 WriterBase ()
 Constructor for WriterBase class, many things are initialized here. More...
 
virtual ~WriterBase ()=default
 

Public Attributes

WriterInfo info
 Information about the current media file. More...
 

Detailed Description

This abstract class is the base class, used by writers. Writers are types of classes that encode video, audio, and image files.

The only requirements for a 'writer', are to derive from this base class, and implement the WriteFrame method.

Definition at line 69 of file WriterBase.h.

Constructor & Destructor Documentation

◆ WriterBase()

WriterBase::WriterBase ( )

Constructor for WriterBase class, many things are initialized here.

Definition at line 22 of file WriterBase.cpp.

◆ ~WriterBase()

virtual openshot::WriterBase::~WriterBase ( )
virtualdefault

Member Function Documentation

◆ CopyReaderInfo()

void WriterBase::CopyReaderInfo ( openshot::ReaderBase reader)

This method copy's the info struct of a reader, and sets the writer with the same info.

Parameters
readerThe source reader to copy

Definition at line 53 of file WriterBase.cpp.

Referenced by openshot::ChunkWriter::ChunkWriter().

◆ DisplayInfo()

void WriterBase::DisplayInfo ( std::ostream *  out = &std::cout)

Display file information in the standard output stream (stdout)

Definition at line 88 of file WriterBase.cpp.

◆ IsOpen()

virtual bool openshot::WriterBase::IsOpen ( )
pure virtual

Determine if writer is open or closed.

Implemented in openshot::FFmpegWriter, openshot::ChunkWriter, and openshot::ImageWriter.

◆ Json()

std::string WriterBase::Json ( ) const

Generate JSON string of this object.

Definition at line 128 of file WriterBase.cpp.

◆ JsonValue()

Json::Value WriterBase::JsonValue ( ) const

Generate Json::Value for this object.

Definition at line 135 of file WriterBase.cpp.

Referenced by Json().

◆ Open()

virtual void openshot::WriterBase::Open ( )
pure virtual

Open the writer (and start initializing streams)

Implemented in openshot::FFmpegWriter, openshot::ChunkWriter, and openshot::ImageWriter.

◆ SetJson()

void WriterBase::SetJson ( const std::string  value)

Load JSON string into this object.

Definition at line 184 of file WriterBase.cpp.

◆ SetJsonValue()

void WriterBase::SetJsonValue ( const Json::Value  root)

Load Json::Value into this object.

Definition at line 201 of file WriterBase.cpp.

Referenced by SetJson().

◆ WriteFrame() [1/2]

virtual void openshot::WriterBase::WriteFrame ( std::shared_ptr< openshot::Frame frame)
pure virtual

This method is required for all derived classes of WriterBase. Write a Frame to the video file.

Implemented in openshot::FFmpegWriter, and openshot::ChunkWriter.

◆ WriteFrame() [2/2]

virtual void openshot::WriterBase::WriteFrame ( openshot::ReaderBase reader,
int64_t  start,
int64_t  length 
)
pure virtual

This method is required for all derived classes of WriterBase. Write a block of frames from a reader.

Implemented in openshot::FFmpegWriter, openshot::ChunkWriter, and openshot::ImageWriter.

Member Data Documentation

◆ info

WriterInfo openshot::WriterBase::info

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