GIFT-Grab  1708
Copyright (c) 2015-7, University College London (UCL)
gg::VideoTargetFactory Class Reference

This class implements the factory design pattern for creating video targets, for instance for encoding video streams to files. More...

#include <videotargetfactory.h>

Public Member Functions

virtual ~VideoTargetFactory ()
 
IVideoTargetcreate_file_writer (enum Codec codec, const std::string filename, const float frame_rate)
 Create specified video saving target. More...
 

Static Public Member Functions

static VideoTargetFactoryget_instance ()
 Get reference to singleton instance of this class. More...
 

Protected Member Functions

 VideoTargetFactory ()
 The constructor should never be publicly called. More...
 
 DISALLOW_COPY_AND_ASSIGNMENT (VideoTargetFactory)
 

Detailed Description

This class implements the factory design pattern for creating video targets, for instance for encoding video streams to files.

The creation functions follow the "Resource Acquisition Is Initialisation" (RAII) principle.

See also
IVideoTarget

Constructor & Destructor Documentation

§ VideoTargetFactory()

gg::VideoTargetFactory::VideoTargetFactory ( )
protected

The constructor should never be publicly called.

See also
get_instance

§ ~VideoTargetFactory()

gg::VideoTargetFactory::~VideoTargetFactory ( )
virtual

Member Function Documentation

§ create_file_writer()

IVideoTarget * gg::VideoTargetFactory::create_file_writer ( enum Codec  codec,
const std::string  filename,
const float  frame_rate 
)

Create specified video saving target.

Parameters
codec
filenameRAII on this filename if target is created successfully
frame_ratethe resulting file writer will use this frame rate
Returns
pointer to created video saving target. It is the caller's responsibility to properly garbage-collect this pointer, i.e. its owner is the caller.
Exceptions
VideoTargetErrorwith a detailed error message if creation of video target with specified type fails for some reason, most notably wrong file extension or invalid frame_rate

§ DISALLOW_COPY_AND_ASSIGNMENT()

gg::VideoTargetFactory::DISALLOW_COPY_AND_ASSIGNMENT ( VideoTargetFactory  )
protected

§ get_instance()

VideoTargetFactory & gg::VideoTargetFactory::get_instance ( )
static

Get reference to singleton instance of this class.

Returns

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