OpenShot Library | libopenshot  0.1.1
Public Member Functions | Public Attributes | Protected Member Functions | 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::DecklinkWriter openshot::FFmpegWriter openshot::ImageWriter

Public Member Functions

void CopyReaderInfo (ReaderBase *reader)
 This method copy's the info struct of a reader, and sets the writer with the same info. More...
 
void DisplayInfo ()
 Display file information in the standard output stream (stdout) More...
 
virtual bool IsOpen ()=0
 Determine if writer is open or closed. More...
 
string Json ()
 Get and Set JSON methods. More...
 
Json::Value JsonValue ()
 Generate Json::JsonValue for this object. More...
 
virtual void Open ()=0
 Open the writer (and start initializing streams) More...
 
void SetJson (string value) throw (InvalidJSON)
 Load JSON string into this object. More...
 
void SetJsonValue (Json::Value root)
 Load Json::JsonValue into this object. More...
 
virtual void WriteFrame (tr1::shared_ptr< Frame > frame)=0 throw (ErrorEncodingVideo, WriterClosed)
 This method is required for all derived classes of WriterBase. Write a Frame to the video file. More...
 
virtual void WriteFrame (ReaderBase *reader, long int start, long int length)=0 throw (ErrorEncodingVideo, WriterClosed)
 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...
 

Public Attributes

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

Protected Member Functions

void AppendDebugMethod (string method_name, string arg1_name, float arg1_value, string arg2_name, float arg2_value, string arg3_name, float arg3_value, string arg4_name, float arg4_value, string arg5_name, float arg5_value, string arg6_name, float arg6_value)
 Append debug information as JSON. 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 85 of file WriterBase.h.

Constructor & Destructor Documentation

WriterBase::WriterBase ( )

Constructor for WriterBase class, many things are initialized here.

Definition at line 33 of file WriterBase.cpp.

Member Function Documentation

void WriterBase::AppendDebugMethod ( string  method_name,
string  arg1_name,
float  arg1_value,
string  arg2_name,
float  arg2_value,
string  arg3_name,
float  arg3_value,
string  arg4_name,
float  arg4_value,
string  arg5_name,
float  arg5_value,
string  arg6_name,
float  arg6_value 
)
protected

Append debug information as JSON.

Definition at line 67 of file WriterBase.cpp.

void WriterBase::CopyReaderInfo ( 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 113 of file WriterBase.cpp.

void WriterBase::DisplayInfo ( )

Display file information in the standard output stream (stdout)

Definition at line 148 of file WriterBase.cpp.

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

Determine if writer is open or closed.

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

string WriterBase::Json ( )

Get and Set JSON methods.

Generate JSON string of this object

Definition at line 188 of file WriterBase.cpp.

Json::Value WriterBase::JsonValue ( )

Generate Json::JsonValue for this object.

Definition at line 195 of file WriterBase.cpp.

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

Open the writer (and start initializing streams)

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

void WriterBase::SetJson ( string  value)
throw (InvalidJSON
)

Load JSON string into this object.

Definition at line 244 of file WriterBase.cpp.

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

Load Json::JsonValue into this object.

Definition at line 267 of file WriterBase.cpp.

virtual void openshot::WriterBase::WriteFrame ( tr1::shared_ptr< Frame frame)
throw (ErrorEncodingVideo,
WriterClosed
)
pure virtual

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

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

virtual void openshot::WriterBase::WriteFrame ( ReaderBase reader,
long int  start,
long int  length 
)
throw (ErrorEncodingVideo,
WriterClosed
)
pure virtual

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

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

Member Data Documentation

bool openshot::WriterBase::debug

Enable or disable debug output. Output will display on the standard output, and you can optionally invoke the OutputDebugJSON() method, which will format the debug output as JSON.

Definition at line 103 of file WriterBase.h.

WriterInfo openshot::WriterBase::info

Information about the current media file.

Definition at line 106 of file WriterBase.h.


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