#include <videosource.h>
Public Member Functions | |
DLLEXPORT | VideoSourceFactory () |
DLLEXPORT | ~VideoSourceFactory () |
DLLEXPORT void | registerParameters (IniParser *parser) |
The registerParameters allow each driver to add it's own keywords in the .ini file grammar. | |
DLLEXPORT void | registerParameters (ParamSection *sec) |
register parameters into an existing ParamSection | |
DLLEXPORT VideoSource * | construct () |
construct a valid and working VideoSource | |
DLLEXPORT void | registerFactory (ParticularVSFactory *f) |
register a VideoSource driver. | |
Static Public Member Functions | |
static DLLEXPORT VideoSourceFactory * | instance () |
Singleton implementation; gives access to the only VideoSourceFactory object. |
Basically, it is just a directory of ParticularVSFactory and redirect registerParameters() and construct() calls to every factories.
The registerParameters allow each driver to add it's own keywords in the .ini file grammar. This call is optional, but provide runtime user configuration.
Here's how to use it:
VideoSourceFactory::instance()->registerParameters(&iniParser); VideoSource *vs = VideoSourceFactory::instance()->construct();
if (vs ==0) { // fail } // the vs object is valid and ready.
To add a new video source type, open videosource.cpp, look for the constructor, and call registerFactory().
Definition at line 153 of file videosource.h.
VideoSourceFactory::VideoSourceFactory | ( | ) |
Definition at line 78 of file videosource.cpp.
References registerFactory().
Referenced by instance().
VideoSourceFactory::~VideoSourceFactory | ( | ) |
Definition at line 122 of file videosource.cpp.
VideoSource * VideoSourceFactory::construct | ( | ) |
construct a valid and working VideoSource
This method try to initialize all the registered drivers until a valid VideoSource is obtained.
Definition at line 64 of file videosource.cpp.
Referenced by main().
VideoSourceFactory * VideoSourceFactory::instance | ( | ) | [static] |
Singleton implementation; gives access to the only VideoSourceFactory object.
Definition at line 73 of file videosource.cpp.
References VideoSourceFactory().
DLLEXPORT void VideoSourceFactory::registerFactory | ( | ParticularVSFactory * | f | ) | [inline] |
register a VideoSource driver.
calls to registerFactory are located in the VideoSourceFactory constructor, called once by instance().
Definition at line 184 of file videosource.h.
Referenced by VideoSourceFactory().
void VideoSourceFactory::registerParameters | ( | ParamSection * | sec | ) |
void VideoSourceFactory::registerParameters | ( | IniParser * | parser | ) |
The registerParameters allow each driver to add it's own keywords in the .ini file grammar.
This call is optional, but provide runtime user configuration. Two versions of this method are available: one creates a new section, and the other one uses an existing section.
Definition at line 48 of file videosource.cpp.
References IniParser::addSection(), and IniSection::name.
Referenced by main().