Merge branch 'master' of git://git.pipapo.org/cinelerra3/ichthyo
Conflicts: tests/plugin/Makefile.am tests/plugin/plugin_main.c
This commit is contained in:
commit
0283653026
51 changed files with 2186 additions and 106 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -1,9 +1,7 @@
|
|||
/wiki/backups/*
|
||||
*~
|
||||
*.tar.*
|
||||
.sconf_temp
|
||||
.sconf_temp/*
|
||||
.sconsign.dblite
|
||||
.[^.]*
|
||||
Buildhelper.pyc
|
||||
optcache
|
||||
Makefile.in
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ include $(top_srcdir)/src/lib/Makefile.am
|
|||
|
||||
# tests
|
||||
include $(top_srcdir)/tests/Makefile.am
|
||||
include $(top_srcdir)/tests/examples/Makefile.am
|
||||
include $(top_srcdir)/tests/plugin/Makefile.am
|
||||
|
||||
#EXTRA_DIST += admin debian doc depcomp README.BUILD LICENSE \
|
||||
# cinelerra-cvs-current.spec
|
||||
|
|
|
|||
69
SConstruct
69
SConstruct
|
|
@ -32,6 +32,7 @@ OPTIONSCACHEFILE = 'optcache'
|
|||
CUSTOPTIONSFILE = 'custom-options'
|
||||
SRCDIR = 'src'
|
||||
BINDIR = 'src/bin'
|
||||
TESTDIR = 'tests'
|
||||
VERSION = '3+alpha.01'
|
||||
#-----------------------------------Configuration
|
||||
|
||||
|
|
@ -54,35 +55,52 @@ def setupBasicEnvironment():
|
|||
opts = defineCmdlineOptions()
|
||||
|
||||
env = Environment(options=opts)
|
||||
|
||||
env.Append ( CCCOM=' -std=gnu99') # workaround for a bug: CCCOM currently doesn't honor CFLAGS, only CCFLAGS
|
||||
env.Replace( VERSION=VERSION
|
||||
, SRCDIR=SRCDIR
|
||||
, BINDIR=BINDIR
|
||||
, CPPPATH=SRCDIR # used to find includes
|
||||
, CPPPATH=["#"+SRCDIR] # used to find includes, "#" means always absolute to build-root
|
||||
, CPPDEFINES=['-DCINELERRA_VERSION=\\"%s\\"' % VERSION ] # note: make it a list to append further defines
|
||||
, CCFLAGS='-Wall'
|
||||
)
|
||||
|
||||
appendCppDefine(env,'DEBUG','DEBUG')
|
||||
appendCppDefine(env,'OPENGL','USE_OPENGL')
|
||||
appendVal(env,'ARCHFLAGS', 'CPPFLAGS') # for both C and C++
|
||||
appendVal(env,'OPTIMIZE', 'CPPFLAGS', val=' -O3')
|
||||
handleNoBugSwitches(env)
|
||||
|
||||
if env['BUILDLEVEL'] in ['ALPHA', 'BETA']:
|
||||
env.Append(CPPFLAGS = ' -DEBUG_'+env['BUILDLEVEL'])
|
||||
if env['BUILDLEVEL'] == 'RELEASE':
|
||||
env.Append(CPPFLAGS = ' -DNDEBUG')
|
||||
appendCppDefine(env,'DEBUG','DEBUG', 'NDEBUG')
|
||||
appendCppDefine(env,'OPENGL','USE_OPENGL')
|
||||
appendVal(env,'ARCHFLAGS', 'CCFLAGS') # for both C and C++
|
||||
appendVal(env,'OPTIMIZE', 'CCFLAGS', val=' -O3')
|
||||
appendVal(env,'DEBUG', 'CCFLAGS', val=' -g')
|
||||
|
||||
prepareOptionsHelp(opts,env)
|
||||
opts.Save(OPTIONSCACHEFILE, env)
|
||||
return env
|
||||
|
||||
def appendCppDefine(env,var,cppVar):
|
||||
def appendCppDefine(env,var,cppVar, elseVal=''):
|
||||
if env[var]:
|
||||
env.Append(CPPDEFINES = {cppVar: env[var]})
|
||||
env.Append(CPPDEFINES = cppVar )
|
||||
elif elseVal:
|
||||
env.Append(CPPDEFINES = elseVal)
|
||||
|
||||
def appendVal(env,var,targetVar,val=None):
|
||||
if env[var]:
|
||||
env.Append( **{targetVar: val or env[var]})
|
||||
|
||||
|
||||
def handleNoBugSwitches(env):
|
||||
""" set the build level for NoBug.
|
||||
Release builds imply no DEBUG
|
||||
"""
|
||||
level = env['BUILDLEVEL']
|
||||
if level in ['ALPHA', 'BETA']:
|
||||
env.Replace( DEBUG = 1 )
|
||||
env.Append(CPPDEFINES = 'EBUG_'+level)
|
||||
elif level == 'RELEASE':
|
||||
env.Replace( DEBUG = 0 )
|
||||
|
||||
|
||||
|
||||
|
||||
def defineCmdlineOptions():
|
||||
""" current options will be persisted in a options cache file.
|
||||
|
|
@ -117,6 +135,8 @@ USAGE: scons [-c] [OPTS] [key=val,...] [TARGETS]
|
|||
|
||||
Special Targets:
|
||||
build : just compile and link
|
||||
testcode: additionally compile the Testsuite
|
||||
check : build and run the Testsuite
|
||||
install : install created artifacts at PREFIX
|
||||
src.tar : create source tarball
|
||||
doc.tar : create developer doc tarball
|
||||
|
|
@ -142,16 +162,29 @@ def configurePlatform(env):
|
|||
print 'Did not find math.h / libm, exiting.'
|
||||
Exit(1)
|
||||
|
||||
if not conf.CheckLibWithHeader('dl', 'dlfcn.h', 'C'):
|
||||
print 'Functions for runtime dynamic loading not available, exiting.'
|
||||
Exit(1)
|
||||
|
||||
if not conf.CheckLibWithHeader('nobugmt', 'nobug.h', 'C'):
|
||||
print 'Did not find NoBug [http://www.pipapo.org/pipawiki/NoBug], exiting.'
|
||||
Exit(1)
|
||||
|
||||
if not conf.CheckLibWithHeader('pthread', 'pthread.h', 'C'):
|
||||
print 'Did not find the pthread lib or pthread.h, exiting.'
|
||||
else:
|
||||
conf.env.Append(CPPFLAGS = ' -DHAVE_PTHREAD_H')
|
||||
|
||||
if conf.CheckCHeader('execinfo.h'):
|
||||
conf.env.Append(CPPFLAGS = ' -DHAS_EXECINFO_H')
|
||||
|
||||
if conf.CheckCHeader('valgrind/valgrind.h'):
|
||||
conf.env.Append(CPPFLAGS = ' -DHAS_VALGRIND_VALGIND_H')
|
||||
|
||||
if not conf.CheckCXXHeader('tr1/memory'):
|
||||
print 'We rely on the std::tr1 proposed standard extension for shared_ptr.'
|
||||
Exit(1)
|
||||
|
||||
if not conf.CheckCXXHeader('boost/config.hpp'):
|
||||
print 'We need the C++ boost-lib.'
|
||||
Exit(1)
|
||||
|
|
@ -186,18 +219,20 @@ def defineBuildTargets(env, artifacts):
|
|||
setup sub-environments with special build options if necessary.
|
||||
We use a custom function to declare a whole tree of srcfiles.
|
||||
"""
|
||||
cinobj = ( srcSubtree(env,'backend')
|
||||
+ srcSubtree(env,'proc')
|
||||
+ env.Object('$SRCDIR/main.cpp')
|
||||
cinobj = ( srcSubtree(env,'$SRCDIR/backend')
|
||||
+ srcSubtree(env,'$SRCDIR/proc')
|
||||
+ srcSubtree(env,'$SRCDIR/common')
|
||||
+ srcSubtree(env,'$SRCDIR/lib')
|
||||
)
|
||||
plugobj = srcSubtree(env,'plugin', isShared=True)
|
||||
plugobj = srcSubtree(env,'$SRCDIR/plugin', isShared=True)
|
||||
corelib = env.StaticLibrary('$BINDIR/core.la', cinobj)
|
||||
|
||||
artifacts['cinelerra'] = env.Program('$BINDIR/cinelerra', cinobj)
|
||||
artifacts['cinelerra'] = env.Program('$BINDIR/cinelerra', ['$SRCDIR/main.cpp']+ corelib )
|
||||
artifacts['plugins'] = env.SharedLibrary('$BINDIR/cinelerra-plugin', plugobj)
|
||||
|
||||
# call subdir SConscript(s) for independent components
|
||||
SConscript(dirs=[SRCDIR+'/tool'], exports='env artifacts')
|
||||
|
||||
SConscript(dirs=[TESTDIR], exports='env artifacts corelib')
|
||||
|
||||
|
||||
def defineInstallTargets(env, artifacts):
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
import os
|
||||
import sys
|
||||
import glob
|
||||
import fnmatch
|
||||
import re
|
||||
import tarfile
|
||||
|
|
@ -47,10 +48,10 @@ def isHelpRequest():
|
|||
|
||||
def srcSubtree(env,tree,isShared=False, **args):
|
||||
""" convienience wrapper: scans the given subtree, which is
|
||||
to be located within $SRCDIR, find all source files and
|
||||
relative to the current SConscript, find all source files and
|
||||
declare them as Static or SharedObjects for compilation
|
||||
"""
|
||||
root = env.subst('$SRCDIR/%s' % tree) # expand $SRCDIR
|
||||
root = env.subst(tree) # expand Construction Vars
|
||||
if isShared:
|
||||
builder = lambda f: env.SharedObject(f, **args)
|
||||
else:
|
||||
|
|
@ -62,10 +63,12 @@ def srcSubtree(env,tree,isShared=False, **args):
|
|||
|
||||
SRCPATTERNS = ['*.c','*.cpp','*.cc']
|
||||
|
||||
def scanSrcSubtree(root):
|
||||
""" scan the given subtree for source filesnames
|
||||
def scanSrcSubtree(roots):
|
||||
""" first expand (possible) wildcards and filter out non-dirs.
|
||||
Then scan the given subtree for source filesnames
|
||||
(python generator function)
|
||||
"""
|
||||
for root in globRootdirs(roots):
|
||||
for (dir,_,files) in os.walk(root):
|
||||
if dir.startswith('./'):
|
||||
dir = dir[2:]
|
||||
|
|
@ -75,6 +78,16 @@ def scanSrcSubtree(root):
|
|||
|
||||
|
||||
|
||||
def globRootdirs(roots):
|
||||
""" helper: expand shell wildcards and filter the resulting list,
|
||||
so that it only contains existing directories
|
||||
"""
|
||||
filter = lambda f: os.path.isdir(f) and os.path.exists(f)
|
||||
roots = glob.glob(roots)
|
||||
return (dir for dir in roots if filter(dir) )
|
||||
|
||||
|
||||
|
||||
|
||||
def Tarball(env,location,dirs,suffix=''):
|
||||
""" Custom Command: create Tarball of some subdirs
|
||||
|
|
|
|||
2
src/.gitignore
vendored
Normal file
2
src/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
bin/*
|
||||
plugin/*.os
|
||||
|
|
@ -1 +1 @@
|
|||
every components source in a own subdir here
|
||||
root of sourcecode tree
|
||||
|
|
|
|||
1
src/bin/DIR_INFO
Normal file
1
src/bin/DIR_INFO
Normal file
|
|
@ -0,0 +1 @@
|
|||
cinelerra executable(s) and libraries will be built here
|
||||
|
|
@ -40,13 +40,18 @@ extern "C" {
|
|||
|
||||
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include "nobugcfg.h"
|
||||
|
||||
#ifdef __cplusplus /* ============== C++-Part ================= */
|
||||
#else /* ========================== C++-Part ================= */
|
||||
|
||||
|
||||
/* common types frequently used... */
|
||||
|
||||
#include "common/util.hpp"
|
||||
#include "common/time.hpp"
|
||||
#include "common/appconfig.hpp" // includes NoBug via "nobugcfg.h"
|
||||
#include "common/error.hpp"
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
|
|
|
|||
94
src/common/appconfig.cpp
Normal file
94
src/common/appconfig.cpp
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
Appconfig - for global initialization and configuration
|
||||
|
||||
Copyright (C) CinelerraCV
|
||||
2007, Christian Thaeter <ct@pipapo.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
#include "common/appconfig.hpp"
|
||||
#include "common/error.hpp"
|
||||
#include "common/util.hpp"
|
||||
|
||||
#define NOBUG_INIT_DEFS_
|
||||
#include "nobugcfg.h"
|
||||
#undef NOBUG_INIT_DEFS_
|
||||
|
||||
|
||||
using util::isnil;
|
||||
|
||||
namespace cinelerra
|
||||
{
|
||||
|
||||
/** This internal pointer to the single instance is deliberately
|
||||
* not initialized (i.e. rely on implicit initialisation to 0),
|
||||
* because when static init reaches this definition, the
|
||||
* Appconfig::instance() probably already has been called
|
||||
* by another compilation unit. This is ugliy, but preferable
|
||||
* to beeing dependant on inclusion order of headers. */
|
||||
Appconfig* Appconfig::theApp_ ;
|
||||
|
||||
#ifndef CINELERRA_VERSION
|
||||
#define CINELERRA_VERSION "3++devel"
|
||||
#endif
|
||||
|
||||
|
||||
/** perform initialization on first access.
|
||||
* A call is placed in static initialization code
|
||||
* included in cinelerra.h; thus it will happen
|
||||
* probably very early.
|
||||
*/
|
||||
Appconfig::Appconfig()
|
||||
: configParam_ (new Configmap)
|
||||
{
|
||||
//////////
|
||||
NOBUG_INIT;
|
||||
//////////
|
||||
|
||||
INFO(config, "Basic application configuration triggered.");
|
||||
(*configParam_)["version"] = CINELERRA_VERSION;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** access the configuation value for a given key.
|
||||
* @return empty string for unknown keys, else the corresponding configuration value
|
||||
*/
|
||||
const string &
|
||||
Appconfig::get (const string & key) throw()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
const string& val = (*instance().configParam_)[key];
|
||||
WARN_IF( isnil(val), config, "undefined config parameter \"%s\" requested.", key.c_str());
|
||||
return val;
|
||||
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
ERROR(config, "error while accessing configuration parameter \"%s\".", key.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace cinelerra
|
||||
111
src/common/appconfig.hpp
Normal file
111
src/common/appconfig.hpp
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
/*
|
||||
APPCONFIG.hpp - for global initialization and configuration
|
||||
|
||||
Copyright (C) CinelerraCV
|
||||
2007, Christian Thaeter <ct@pipapo.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
/** @file appconfig.hpp
|
||||
** This header is special, as it causes global system initialisation
|
||||
** to happen. On inclusion, it places static initialisation code,
|
||||
** which on first run will create the Appconfig singleton instance.
|
||||
** Additionally, the inclusion, configuration and initialisation
|
||||
** of the NoBug library is handled here. Global <i>definitions</i>
|
||||
** for NoBug are placed into the corresponding translation unit
|
||||
** appconfig.cpp"
|
||||
**
|
||||
** @see nobugcfg.h
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CINELERRA_APPCONFIG_H
|
||||
#define CINELERRA_APPCONFIG_H
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
#include "nobugcfg.h"
|
||||
|
||||
|
||||
using std::string;
|
||||
using std::auto_ptr;
|
||||
|
||||
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Singleton to hold inevitable global flags and constants
|
||||
* and for performing early (static) global initialization tasks.
|
||||
*/
|
||||
class Appconfig
|
||||
{
|
||||
private:
|
||||
|
||||
/** holds the single instance and triggers initialization */
|
||||
static Appconfig* theApp_;
|
||||
|
||||
|
||||
/** perform initialization on first access.
|
||||
* A call is placed in static initialization code
|
||||
* included via cinelerra.h (see below),
|
||||
* thus it will happen rather early.
|
||||
*/
|
||||
Appconfig () ;
|
||||
|
||||
|
||||
public:
|
||||
static Appconfig& instance()
|
||||
{
|
||||
if (!theApp_) theApp_ = new Appconfig ();
|
||||
return *theApp_;
|
||||
}
|
||||
|
||||
/** access the configuation value for a given key.
|
||||
* @return empty string for unknown keys, config value else
|
||||
* @todo do we need such a facility?
|
||||
*/
|
||||
static const string & get (const string& key) throw();
|
||||
|
||||
|
||||
private:
|
||||
typedef std::map<string,string> Configmap;
|
||||
typedef auto_ptr<Configmap> PConfig;
|
||||
|
||||
/** @TODO <b>the following is just placeholder code!</b>
|
||||
* Appconfig <i>could</i> do such things if necessary.
|
||||
*/
|
||||
PConfig configParam_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
/** "magic code" to cause early static initialization */
|
||||
Appconfig& init (Appconfig::instance ());
|
||||
}
|
||||
|
||||
} // namespace cinelerra
|
||||
#endif
|
||||
53
src/common/error.cpp
Normal file
53
src/common/error.cpp
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
Error - Cinelerra Exception Interface
|
||||
|
||||
Copyright (C) CinelerraCV
|
||||
2007, Christian Thaeter <ct@pipapo.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
#include "common/error.hpp"
|
||||
|
||||
namespace cinelerra
|
||||
{
|
||||
|
||||
/** Description of the problem, including the internal char constant
|
||||
* in accordance to cinelerras error identification scheme.
|
||||
* If a ::rootCause() can be obtained, this will be included in the
|
||||
* generated output as well.
|
||||
*/
|
||||
const char*
|
||||
Error::what () const throw()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/** If this exception was caused by a chain of further exceptions,
|
||||
* return the first one registered in this throw sequence.
|
||||
* This works only, if every exceptions thrown as a consequence
|
||||
* of another exception is propperly constructed by passing
|
||||
* the original exception to the constructor
|
||||
*/
|
||||
std::exception
|
||||
Error::rootCause() const throw()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace cinelerra
|
||||
102
src/common/error.hpp
Normal file
102
src/common/error.hpp
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
ERROR.hpp - Cinelerra Exception Interface
|
||||
|
||||
Copyright (C) CinelerraCV
|
||||
2007, Christian Thaeter <ct@pipapo.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CINELERRA_ERROR_H
|
||||
#define CINELERRA_ERROR_H
|
||||
|
||||
#include <exception>
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Interface and Baseclass of all Exceptions thrown
|
||||
* from within cinelerra (C++) code. Common operations
|
||||
* for getting an diagnostic message and for obtaining
|
||||
* the root cause, i.e. the frist exception encountered
|
||||
* in a chain of exceptions.
|
||||
*/
|
||||
class Error : public std::exception
|
||||
{
|
||||
public:
|
||||
virtual ~Error () throw() {};
|
||||
|
||||
/** yield a diagnostig message characterizing the problem */
|
||||
virtual const char* what () const throw();
|
||||
|
||||
/** If this exception was caused by a chain of further exceptions,
|
||||
* return the first one registered in this throw sequence.
|
||||
* This works only, if every exceptions thrown as a consequence
|
||||
* of another exception is propperly constructed by passing
|
||||
* the original exception to the constructor
|
||||
*/
|
||||
std::exception rootCause () const throw();
|
||||
|
||||
private:
|
||||
/** a copy of the first exception encountered in this exception chain */
|
||||
std::exception cause;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/* === Exception Subcategories === */
|
||||
|
||||
namespace error
|
||||
{
|
||||
|
||||
class Logic : public Error
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class Config : public Error
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class State : public Error
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class Invalid : public Error
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
class External : public Error
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace error
|
||||
|
||||
} // namespace cinelerra
|
||||
#endif
|
||||
127
src/common/factory.hpp
Normal file
127
src/common/factory.hpp
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
FACTORY.hpp - template for object/smart-pointer factories
|
||||
|
||||
Copyright (C) CinelerraCV
|
||||
2007, Christian Thaeter <ct@pipapo.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CINELERRA_FACTORY_H
|
||||
#define CINELERRA_FACTORY_H
|
||||
|
||||
#include <tr1/memory>
|
||||
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
{
|
||||
|
||||
namespace factory{ class VanillaAllocator; }//////////////////////////////////TODO
|
||||
|
||||
/**
|
||||
* Configurable template for creating Factory classes.
|
||||
* These encapsulate the creating of new objects, indeed
|
||||
* delegating the memory allocation to the backend layer.
|
||||
* The clients get just a smart-pointer or similar handle
|
||||
* to the created object, which will manage the ownership.
|
||||
*
|
||||
* The provided default implementation uses just std::auto_ptr,
|
||||
* but delegates the allocation to cinelerra's backend-layer.
|
||||
*
|
||||
*/
|
||||
template
|
||||
<
|
||||
class T, // the product to be created
|
||||
template <class> class SMP = std::auto_ptr,// smart-pointer actually returned
|
||||
class ALO = factory::VanillaAllocator // Allocator facility to be used //////////////TODO
|
||||
>
|
||||
class Factory : protected ALO
|
||||
{
|
||||
public:
|
||||
/** Object creating facility.
|
||||
* Intended to be over/written/ with a variant taking
|
||||
* the appropriate number of parameters and using the
|
||||
* (privately inherited) functions of the allocator.
|
||||
* Note: non-virtual.
|
||||
*/
|
||||
SMP<T> operator() (){ return SMP<T> (new T ); };
|
||||
|
||||
private:
|
||||
void operator= (const Factory&); // copy prohibited
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* -- some example and default instantiiations -- */
|
||||
|
||||
namespace factory
|
||||
{
|
||||
/**
|
||||
* Example Allocator using just the normal C++ memory management.
|
||||
* The intended use is for a Factory instance to iherit from this class.
|
||||
* Specialized Allocators typically overload operator new and delete.
|
||||
*/
|
||||
class VanillaAllocator {};
|
||||
|
||||
/**
|
||||
* Example Allocator using plain C memory management.
|
||||
*/
|
||||
class MallocAllocator
|
||||
{
|
||||
void* operator new (size_t siz) { return malloc (siz); };
|
||||
void operator delete (void* p) { if (p) free (p); };
|
||||
};
|
||||
|
||||
|
||||
using std::tr1::shared_ptr;
|
||||
|
||||
/** a frequently used instantiation of the Factory,
|
||||
* using the refcounting shared_ptr from Boost
|
||||
* and for allocation just our default Allocator
|
||||
*/
|
||||
template<class T>
|
||||
class RefcountPtr : public Factory<T, shared_ptr>
|
||||
{
|
||||
/** let the smart-Ptr use the custom operator delete,
|
||||
* which may be defined in our Allocator baseclass.
|
||||
*/
|
||||
static void destroy (T* victim) { delete victim; };
|
||||
|
||||
public:
|
||||
shared_ptr<T> operator() () { return shared_ptr<T> (new T, &destroy ); }
|
||||
};
|
||||
|
||||
|
||||
/** another convienience instantiiation: auto_ptr-Factory,
|
||||
* actually creating a subclass of the returned type
|
||||
*/
|
||||
template<class T, class TImpl>
|
||||
class SubclassPtr : public Factory<T>
|
||||
{
|
||||
typedef std::auto_ptr<T> aP;
|
||||
|
||||
public:
|
||||
aP operator() (){ return aP (new TImpl ); };
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace factory
|
||||
|
||||
} // namespace cinelerra
|
||||
#endif
|
||||
48
src/common/factorytest.cpp
Normal file
48
src/common/factorytest.cpp
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
Factorytest - check basic workings of object/smart-pointer factory
|
||||
|
||||
Copyright (C) CinelerraCV
|
||||
2007, Christian Thaeter <ct@pipapo.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
#include "common/factory.hpp"
|
||||
|
||||
namespace cinelerra
|
||||
{
|
||||
|
||||
class Blubb
|
||||
{
|
||||
int uii ;
|
||||
|
||||
public:
|
||||
typedef factory::RefcountPtr<Blubb> Factory;
|
||||
static Factory create;
|
||||
|
||||
Blubb() : uii(42) {} ;
|
||||
};
|
||||
|
||||
/** a static Factory instance
|
||||
* for creating refcounting Ptrs to Blubb objects
|
||||
*/
|
||||
Blubb::Factory Blubb::create;
|
||||
|
||||
std::tr1::shared_ptr<Blubb> huii = Blubb::create ();
|
||||
std::tr1::shared_ptr<Blubb> pfuii = huii;
|
||||
|
||||
} // namespace cinelerra
|
||||
53
src/common/util.hpp
Normal file
53
src/common/util.hpp
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
TIME.hpp - unified representation of a time point, including conversion functions
|
||||
|
||||
Copyright (C) CinelerraCV
|
||||
2007, Christian Thaeter <ct@pipapo.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef UTIL_HPP_
|
||||
#define UTIL_HPP_
|
||||
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
namespace util
|
||||
{
|
||||
using std::string;
|
||||
|
||||
|
||||
/** a family of util functions providing a "no value whatsoever" test */
|
||||
inline bool isnil(const string& val)
|
||||
{
|
||||
return 0 == val.length();
|
||||
}
|
||||
|
||||
inline bool isnil(const string* pval)
|
||||
{
|
||||
return !pval || 0 == pval->length();
|
||||
}
|
||||
|
||||
inline bool isnil(const char* pval)
|
||||
{
|
||||
return !pval || 0 == std::strlen(pval);
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
#endif /*UTIL_HPP_*/
|
||||
|
|
@ -26,9 +26,14 @@
|
|||
#include "cinelerra.h"
|
||||
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
using cinelerra::Appconfig;
|
||||
|
||||
|
||||
int main (int argc, char* argv[])
|
||||
{
|
||||
cout << "hello cinelerra again\n";
|
||||
cout << "*** Cinelerra NLE for Linux ***" << endl
|
||||
<< " Version: " << Appconfig::get("version") << endl;
|
||||
assert(true);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
84
src/nobugcfg.h
Normal file
84
src/nobugcfg.h
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
NOBUGCFG.h - global configuration and definitions for NoBug
|
||||
|
||||
|
||||
Copyright (C) CinelerraCV
|
||||
2007, Christian Thaeter <ct@pipapo.org>
|
||||
Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
/** @file nobugcfg.h
|
||||
** This header is for including and configuring NoBug.
|
||||
** The idea is that configuration and some globally used flag
|
||||
** declarations are to be kept in one central location. Normally,
|
||||
** this header will be included by appconfig.hpp, which in turn gets
|
||||
** included by cinelerra.h
|
||||
** @par Besides the usual guarded declarations, this header contains
|
||||
** one section with the corresponding <b>definitions</b>. This section
|
||||
** is to be called by appconfig.cpp only, which deals with application
|
||||
** wide configuration values contained in the Singleton class Appconfig.
|
||||
** Incidentally, the constructor of Appconfig issues the NOBUG_INIT call
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifndef NOBUGCFG_H /* ============= Part 1: DECLARATIONS ======== */
|
||||
#define NOBUGCFG_H
|
||||
|
||||
#include <syslog.h>
|
||||
|
||||
/* configuration of NoBug goes here... */
|
||||
|
||||
#include <nobug.h>
|
||||
|
||||
|
||||
/* declare flags used throughout the code base... */
|
||||
NOBUG_DECLARE_FLAG(config);
|
||||
NOBUG_DECLARE_FLAG(test);
|
||||
|
||||
|
||||
#endif /*NOBUGCFG_H ======= (End) Part 1: DECLARATIONS ======== */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef NOBUG_INIT_DEFS_ /*========== Part 2: DEFINITIONS ========= */
|
||||
|
||||
/* ================================= common C Part ========= */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus /* ============== C++-Part ============== */
|
||||
|
||||
|
||||
/* flags used throughout the code base... */
|
||||
NOBUG_CPP_DEFINE_FLAG(config);
|
||||
NOBUG_CPP_DEFINE_FLAG(test);
|
||||
|
||||
|
||||
|
||||
#endif /* ===================== (End) C++-Part ============= */
|
||||
|
||||
|
||||
|
||||
#endif /*NOBUG_INIT_DEFS_ ==== (End) Part 2: DEFINITIONS ========= */
|
||||
|
|
@ -44,8 +44,8 @@ namespace mobject
|
|||
* the possible kinds of RelativePlacements
|
||||
*/
|
||||
enum RelType
|
||||
{ SAMETIME /** place subject at the same time as the anchor */
|
||||
, ATTACH /** attach subject to anchor (e.g. an effect to a clip) */
|
||||
{ SAMETIME /**< place subject at the same time as the anchor */
|
||||
, ATTACH /**< attach subject to anchor (e.g. an effect to a clip) */
|
||||
};
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -5,6 +5,13 @@
|
|||
|
||||
Import('env','artifacts')
|
||||
|
||||
# build the ubiquitous Hello World application (note: C source)
|
||||
artifacts['tools'] = env.Program('#$BINDIR/hello-world','hello.c')
|
||||
# at the moment (8/07), Ichthyo tries to find out how to configure NoBug
|
||||
# does it help, if we set the NOBUG_LOG to the environment used for building??
|
||||
env = env.Clone()
|
||||
env['ENV']['NOBUG_LOG'] = 'ttt:WARNING'
|
||||
|
||||
# build the ubiquitous Hello World application (note: C source)
|
||||
artifacts['tools'] = [ env.Program('#$BINDIR/hello-world','hello.c')
|
||||
+ env.Program('#$BINDIR/try', 'try.cpp') #### to try out some feature:
|
||||
]
|
||||
|
||||
|
|
|
|||
35
src/tool/try.cpp
Normal file
35
src/tool/try.cpp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/* try.cpp - for trying out some language features....
|
||||
* scons will create the binary bin/try
|
||||
*
|
||||
*/
|
||||
|
||||
// 8/07 - how to control NOBUG??
|
||||
|
||||
|
||||
#include <syslog.h>
|
||||
|
||||
#define NOBUG_LOG_LIMIT LOG_ERR
|
||||
|
||||
#include <nobug.h>
|
||||
|
||||
NOBUG_DECLARE_FLAG(ttt);
|
||||
|
||||
NOBUG_DEFINE_FLAG(ttt);
|
||||
|
||||
int main (int argc, char* argv[])
|
||||
{
|
||||
|
||||
NOBUG_INIT;
|
||||
|
||||
NOBUG_INIT_FLAG_LIMIT(ttt, LOG_WARNING);
|
||||
|
||||
TRACE(ttt,"trace");
|
||||
INFO(ttt,"info");
|
||||
NOTICE(ttt,"notice");
|
||||
WARN(ttt,"warning");
|
||||
ERROR(ttt,"error");
|
||||
|
||||
TRACE(NOBUG_ON,"allways on?");
|
||||
|
||||
return 0;
|
||||
}
|
||||
4
tests/.gitignore
vendored
Normal file
4
tests/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
,*
|
||||
mainsuite
|
||||
errortest
|
||||
plugin-example
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
TESTING "Error handling" ./errortest
|
||||
TESTING "Error handling" ./test-error
|
||||
|
||||
TEST "no error" <<END
|
||||
return: 0
|
||||
|
|
|
|||
5
tests/15plugin.tests
Normal file
5
tests/15plugin.tests
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
TESTING "test plugin example code" ./test-plugin
|
||||
|
||||
TEST "plugin example" <<END
|
||||
END
|
||||
|
||||
12
tests/50components.tests
Normal file
12
tests/50components.tests
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
TESTING "Component Test Suite" ./test-components
|
||||
|
||||
TEST "Fac test" Factory_test <<END
|
||||
return: 0
|
||||
END
|
||||
|
||||
TEST "Hello test" HelloWorld_test <<END
|
||||
out: This is how the world ends...
|
||||
return: 0
|
||||
END
|
||||
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
TESTING "test plugin example code" ./plugin_example
|
||||
|
||||
TEST "plugin example" <<END
|
||||
END
|
||||
|
||||
|
|
@ -18,10 +18,10 @@
|
|||
|
||||
tests_srcdir = $(top_srcdir)/tests
|
||||
|
||||
check_PROGRAMS += errortest
|
||||
check_PROGRAMS += test-error
|
||||
|
||||
errortest_SOURCES = $(tests_srcdir)/errortest.c
|
||||
errortest_CPPFLAGS = $(AM_CPPFLAGS) -std=gnu99 -Wall -Werror -I$(top_srcdir)/src/lib/
|
||||
errortest_LDADD = $(builddir)/libcin3.a -lnobugmt -lpthread -ldl
|
||||
test_error_SOURCES = $(tests_srcdir)/error/errortest.c
|
||||
test_error_CPPFLAGS = $(AM_CPPFLAGS) -std=gnu99 -Wall -Werror -I$(top_srcdir)/src/
|
||||
test_error_LDADD = $(builddir)/libcin3.a -lnobugmt -lpthread -ldl
|
||||
|
||||
TESTS = $(tests_srcdir)/test.sh
|
||||
|
|
|
|||
76
tests/SConscript
Normal file
76
tests/SConscript
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
# -*- python -*-
|
||||
##
|
||||
## SConscript - SCons buildscript for the Testsuite (called by SConstruct)
|
||||
##
|
||||
|
||||
from Buildhelper import srcSubtree
|
||||
from Buildhelper import globRootdirs
|
||||
|
||||
Import('env','artifacts','corelib')
|
||||
|
||||
|
||||
def SingleTestExecutableSubdir(env,tree):
|
||||
""" declare all targets needed to create a standalone
|
||||
Test executalbe of the given Sub-tree. Note that
|
||||
each subdir is built in its own Environment.
|
||||
"""
|
||||
env = env.Clone()
|
||||
env.Append(CPPPATH=tree) # add Subdir to Includepath
|
||||
tree = env.subst(tree) # expand Construction Vars
|
||||
exeName = 'test-%s' % tree
|
||||
objects = srcSubtree(env,tree)
|
||||
return env.Program(exeName, objects + corelib)
|
||||
|
||||
|
||||
def treatPluginTestcase(env):
|
||||
""" Special case: the test-plugin executable
|
||||
"""
|
||||
env = env.Clone()
|
||||
env.Append(CPPPATH='plugin')
|
||||
testplugin = env.SharedLibrary('hello_1', 'plugin/example_plugin.c', SHLIBPREFIX='')
|
||||
testExe = env.Program('test-plugin', ['plugin/plugin_main.c'] + corelib)
|
||||
env.Depends(testExe, testplugin)
|
||||
return testExe
|
||||
#-- it depentds (at the moment) on a specific isolated test-plugin,
|
||||
# which is not integrated in the "normal procedure" for building Plugins
|
||||
# (which is not yet implemented as of 8/07)
|
||||
# TODO: handle this case automatically
|
||||
|
||||
|
||||
#
|
||||
# build a Test-Executable out of every subdir...
|
||||
moduledirs = globRootdirs('*')
|
||||
|
||||
#
|
||||
# have to treat the plugin-example specially.
|
||||
isnt_plugin = lambda dir : dir!='plugin'
|
||||
moduledirs = filter(isnt_plugin, moduledirs)
|
||||
pluginExe = treatPluginTestcase(env)
|
||||
print 'moduledirs: %s' %moduledirs
|
||||
|
||||
artifacts['testsuite'] = ts = [ SingleTestExecutableSubdir(env, dir) for dir in moduledirs] + pluginExe
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# actually run the Testsuite
|
||||
#
|
||||
# - the product of running the Testsuite is the ",testlog"
|
||||
# - it depends on all artifacts defined as "ts" above
|
||||
#
|
||||
runTs = env.Command(',testlog', ts, "./test.sh", chdir=1)
|
||||
|
||||
env.Clean (runTs, [ ',*']) # declare tempfiles of test.sh as cleanable
|
||||
|
||||
|
||||
#
|
||||
# define Phony targets
|
||||
# - 'scons testcode' triggers building of the Testsuite
|
||||
# - 'scons check' triggers building and running
|
||||
#
|
||||
env.Alias('testcode', ts )
|
||||
env.Alias('check', runTs )
|
||||
|
||||
28
tests/bugs/bugmain.c
Normal file
28
tests/bugs/bugmain.c
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
errortest.c - executable for running bug regression tests
|
||||
|
||||
Copyright (C) CinelerraCV
|
||||
2007, Christian Thaeter <ct@pipapo.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
printf("hello sunshine, noBugs whatsoever\n");
|
||||
return 0;
|
||||
}
|
||||
1
tests/components/DIR_INFO
Normal file
1
tests/components/DIR_INFO
Normal file
|
|
@ -0,0 +1 @@
|
|||
Testsuite sourcecode tree
|
||||
54
tests/components/common/factorytest.cpp
Normal file
54
tests/components/common/factorytest.cpp
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
Factory(Test) - unittest for the object creating factory
|
||||
|
||||
Copyright (C) CinelerraCV
|
||||
2007, Christian Thaeter <ct@pipapo.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
#include "helper/run.hpp"
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
{
|
||||
namespace test
|
||||
{
|
||||
|
||||
/**
|
||||
* Target object to be created by the Test-Factory
|
||||
*/
|
||||
class TargetObj
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
class Factory_test : public Test
|
||||
{
|
||||
virtual void run(Arg arg)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
/** Register this test class to be invoked in some test groups (suites) */
|
||||
Launch<Factory_test> run_Factory_test("Factory_test","unit common");
|
||||
|
||||
|
||||
|
||||
} // namespace test
|
||||
|
||||
} // namespace cinelerra
|
||||
55
tests/components/common/helloworldtest.cpp
Normal file
55
tests/components/common/helloworldtest.cpp
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
HelloWorld(Test) - how to use this test framework...
|
||||
|
||||
Copyright (C) CinelerraCV
|
||||
2007, Christian Thaeter <ct@pipapo.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include "helper/run.hpp"
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
{
|
||||
namespace test
|
||||
{
|
||||
|
||||
|
||||
class HelloWorld_test : public Test
|
||||
{
|
||||
virtual void run(Arg arg)
|
||||
{
|
||||
greeting();
|
||||
}
|
||||
|
||||
void greeting()
|
||||
{
|
||||
std::cout << "This is how the world ends...\n";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/** Register this test class to be invoked in some test groups (suites) */
|
||||
Launch<HelloWorld_test> run_HelloWorld_test("HelloWorld_test","unit common");
|
||||
|
||||
|
||||
} // namespace test
|
||||
|
||||
} // namespace cinelerra
|
||||
92
tests/components/helper/run.hpp
Normal file
92
tests/components/helper/run.hpp
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
/*
|
||||
RUN.hpp - helper class for grouping, registering and invoking testcases
|
||||
|
||||
Copyright (C) CinelerraCV
|
||||
2007, Christian Thaeter <ct@pipapo.org>
|
||||
Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef TESTHELPER_RUN_H
|
||||
#define TESTHELPER_RUN_H
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "helper/suite.hpp"
|
||||
|
||||
|
||||
namespace test
|
||||
{
|
||||
|
||||
using std::string;
|
||||
using std::auto_ptr;
|
||||
|
||||
typedef std::vector<string> * Arg;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Abstract Base Class for all testcases.
|
||||
* Typically, such testcases are created by a Launcher.
|
||||
*/
|
||||
class Test
|
||||
{
|
||||
public:
|
||||
virtual ~Test() {}
|
||||
virtual void run(Arg arg) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/** interface: generic testcase creating functor. */
|
||||
class Launcher
|
||||
{
|
||||
public:
|
||||
virtual ~Launcher() {}
|
||||
virtual auto_ptr<Test> operator() () = 0;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Helper class for running a collection of tests.
|
||||
* Launch objects are functors, which create on
|
||||
* invocation an instance of the Test class
|
||||
* they were created with. Creating such a
|
||||
* Test Launcher internally registers this
|
||||
* testcase with the Testsuite-Class,
|
||||
* optionally under several groups
|
||||
* (=categories, suite selections).
|
||||
* @note a subclass of Launcher
|
||||
*/
|
||||
template<class TEST>
|
||||
class Launch : public Launcher
|
||||
{
|
||||
public:
|
||||
Launch (string testID, string groups) { Suite::enroll (this,testID,groups); };
|
||||
virtual auto_ptr<Test> operator() () { return auto_ptr<Test> (new TEST ); };
|
||||
};
|
||||
|
||||
} // namespace test
|
||||
|
||||
// make them global for convienience
|
||||
using ::test::Arg;
|
||||
using ::test::Test;
|
||||
using ::test::Launch;
|
||||
|
||||
#endif
|
||||
182
tests/components/helper/suite.cpp
Normal file
182
tests/components/helper/suite.cpp
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
/*
|
||||
Suite - helper class for running collections of tests
|
||||
|
||||
Copyright (C) CinelerraCV
|
||||
2007, Christian Thaeter <ct@pipapo.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <tr1/memory>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
#include "helper/suite.hpp"
|
||||
#include "helper/run.hpp"
|
||||
#include "common/error.hpp"
|
||||
#include "common/util.hpp"
|
||||
|
||||
#include "nobugcfg.h"
|
||||
|
||||
|
||||
namespace test
|
||||
{
|
||||
using std::map;
|
||||
using std::vector;
|
||||
using std::auto_ptr;
|
||||
using std::tr1::shared_ptr;
|
||||
|
||||
using util::isnil;
|
||||
|
||||
typedef map<string, Launcher*> TestMap;
|
||||
typedef shared_ptr<TestMap> PTestMap;
|
||||
typedef map<string,PTestMap> GroupMap;
|
||||
|
||||
|
||||
|
||||
/** helper to collect and manage the test cases.
|
||||
* Every testcase class should create a Launch instance
|
||||
* which causes a call to Suite::enroll(), so we can add a
|
||||
* pointer to this Launcher into a map indexed by the
|
||||
* provided testIDs and groupIDs.
|
||||
* This enables us to build a Suite instance for any
|
||||
* requested group and then instantiiate and invoke
|
||||
* individual testcases accordingly.
|
||||
*/
|
||||
class Registry
|
||||
{
|
||||
auto_ptr<GroupMap> groups;
|
||||
public:
|
||||
Registry() : groups(new GroupMap ) {};
|
||||
PTestMap& getGroup (string grpID) { return (*groups)[grpID]; };
|
||||
void add2group (Launcher* test, string testID, string groupID);
|
||||
};
|
||||
|
||||
void
|
||||
Registry::add2group (Launcher* test, string testID, string groupID)
|
||||
{
|
||||
REQUIRE( test );
|
||||
REQUIRE( !isnil(testID) );
|
||||
REQUIRE( !isnil(groupID) );
|
||||
|
||||
PTestMap& group = getGroup(groupID);
|
||||
if (!group)
|
||||
group.reset( new TestMap );
|
||||
(*group)[testID] = test;
|
||||
}
|
||||
|
||||
Registry testcases;
|
||||
|
||||
|
||||
|
||||
|
||||
/** register the given test-launcher, so it can be later accessed
|
||||
* either as a member of one of the specified groups, or direcly
|
||||
* by its testID. Any test is automatically added to the groupID
|
||||
* #ALLGROUP
|
||||
* @param groups List of group-IDs selected by whitespace
|
||||
*/
|
||||
void
|
||||
Suite::enroll (Launcher* test, string testID, string groups)
|
||||
{
|
||||
REQUIRE( test );
|
||||
REQUIRE( !isnil(testID) );
|
||||
|
||||
std::istringstream ss(groups);
|
||||
string group;
|
||||
while (ss >> group )
|
||||
testcases.add2group(test, testID, group);
|
||||
|
||||
// Magic: allways add any testcas to groupID="ALL"
|
||||
testcases.add2group(test,testID, ALLGROUP);
|
||||
}
|
||||
|
||||
/** "magic" groupID containing all registered testcases */
|
||||
const string Suite::ALLGROUP = "ALL";
|
||||
|
||||
|
||||
|
||||
/** create a suite comprised of all the testcases
|
||||
* previously @link #enroll() registered @endlink with this
|
||||
* this group.
|
||||
* @see #run() running tests in a Suite
|
||||
*/
|
||||
Suite::Suite(string groupID)
|
||||
: groupID_(groupID)
|
||||
{
|
||||
REQUIRE( !isnil(groupID) );
|
||||
TRACE(test, "Test-Suite( groupID=%s )\n", groupID.c_str () );
|
||||
|
||||
if (!testcases.getGroup(groupID))
|
||||
throw cinelerra::error::Invalid ();
|
||||
//throw "empty testsuite"; /////////// TODO Errorhandling!
|
||||
}
|
||||
|
||||
|
||||
/** run all testcases contained in this Suite.
|
||||
* The first argument in the commandline, if present, will select
|
||||
* one single testcase with a matching ID.
|
||||
*/
|
||||
void
|
||||
Suite::run (int argc, char* argv[])
|
||||
{
|
||||
|
||||
PTestMap tests = testcases.getGroup(groupID_);
|
||||
if (!tests)
|
||||
throw cinelerra::error::Invalid ();
|
||||
|
||||
if (argc >= 2)
|
||||
{
|
||||
if (Launcher* test = (*tests)[argv[1]])
|
||||
{
|
||||
// first cmdline argument denotes a valid
|
||||
// testcase registered in this group:
|
||||
// go ahead and invoke just this test.
|
||||
if (argc > 2)
|
||||
{ // pass additional cmdline as vector
|
||||
vector<string> arglist(argc-2);
|
||||
for ( int i=2; i<argc; ++i )
|
||||
arglist.push_back(string(argv[i]));
|
||||
|
||||
// run single Testcase with provided arguments
|
||||
(*test)()->run(&arglist);
|
||||
}
|
||||
else
|
||||
(*test)()->run(0); // without additional argumens
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// no test-ID was specified.
|
||||
// instantiiate all tests cases and execute them.
|
||||
for ( TestMap::iterator i=tests->begin(); i!=tests->end(); ++i )
|
||||
if (i->second)
|
||||
{
|
||||
std::cout << " ----------"<< i->first<< "----------\n";
|
||||
Launcher& test = *(i->second);
|
||||
test()->run(0); // without cmdline arguments
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace test
|
||||
60
tests/components/helper/suite.hpp
Normal file
60
tests/components/helper/suite.hpp
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
SUITE.hpp - helper class for running collections of tests
|
||||
|
||||
Copyright (C) CinelerraCV
|
||||
2007, Christian Thaeter <ct@pipapo.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef TESTHELPER_SUITE_H
|
||||
#define TESTHELPER_SUITE_H
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
|
||||
namespace test
|
||||
{
|
||||
using std::string;
|
||||
|
||||
// Forward decls needed for run.hpp
|
||||
class Test;
|
||||
class Launcher;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Helper class for running a collection of tests.
|
||||
*
|
||||
*/
|
||||
class Suite
|
||||
{
|
||||
string groupID_;
|
||||
|
||||
public:
|
||||
Suite (string groupID);
|
||||
void run (int argc, char* argv[]);
|
||||
static void enroll (Launcher *test, string testID, string groups);
|
||||
|
||||
static const string ALLGROUP;
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace test
|
||||
#endif
|
||||
36
tests/components/mainsuite.cpp
Normal file
36
tests/components/mainsuite.cpp
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
mainsuite.cpp - "the" cinelerra3 self test suite
|
||||
|
||||
Copyright (C) CinelerraCV
|
||||
2007, Christian Thaeter <ct@pipapo.org>
|
||||
Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
#include "helper/suite.hpp"
|
||||
|
||||
|
||||
/** run all tests or any single test specified in the first
|
||||
* cmd line argument.
|
||||
* Note: to ease debugging, we don't catch any exceptions.
|
||||
*/
|
||||
int main (int argc, char* argv[])
|
||||
{
|
||||
test::Suite suite (test::Suite::ALLGROUP);
|
||||
suite.run(argc,argv);
|
||||
return 0;
|
||||
}
|
||||
3
tests/error/DIR_INFO
Normal file
3
tests/error/DIR_INFO
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
example (test) code for errorhandling
|
||||
The test application to be built from this directory shows how
|
||||
to use the various error handling features.
|
||||
|
|
@ -19,10 +19,12 @@
|
|||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <error.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "lib/error.h"
|
||||
|
||||
|
||||
CINELERRA_ERROR_DEFINE(TEST, "test error");
|
||||
|
||||
int
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
working example code
|
||||
working example code for cinelerra's plugin system
|
||||
This directory contains example code which shows how to use specific features.
|
||||
All examples will be build and run as part of the testsuite
|
||||
|
|
@ -15,19 +15,18 @@
|
|||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
examples_srcdir = $(top_srcdir)/tests/examples
|
||||
noinst_PROGRAMS += plugin_example
|
||||
examples_srcdir = $(top_srcdir)/tests/plugin
|
||||
noinst_PROGRAMS += test-plugin
|
||||
|
||||
plugin_example_CFLAGS = $(AM_CFLAGS) -std=gnu99 -Wall -Werror
|
||||
plugin_example_CPPFLAGS = $(AM_CPPFLAGS) -std=gnu99 -Wall -Werror -I$(top_srcdir)/src/lib/
|
||||
plugin_example_LDADD = $(builddir)/libcin3.a -lnobugmt -lpthread -ldl
|
||||
plugin_example_SOURCES = $(examples_srcdir)/plugin_main.c
|
||||
test_plugin_CFLAGS = $(AM_CFLAGS) -std=gnu99 -Wall -Werror
|
||||
test_plugin_CPPFLAGS = $(AM_CPPFLAGS) -std=gnu99 -Wall -Werror -I$(top_srcdir)/src
|
||||
test_plugin_LDADD = $(builddir)/libcin3.a -lnobugmt -lpthread -ldl
|
||||
test_plugin_SOURCES = $(examples_srcdir)/plugin_main.c
|
||||
|
||||
noinst_HEADERS += $(examples_srcdir)/hello_interface.h
|
||||
|
||||
check_LTLIBRARIES += example_plugin.la
|
||||
example_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -std=gnu99 -Wall -Werror -I$(top_srcdir)/src/lib/
|
||||
example_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -std=gnu99 -Wall -Werror -I$(top_srcdir)/src
|
||||
example_plugin_la_SOURCES = $(examples_srcdir)/example_plugin.c
|
||||
# the -rpath option is required, prolly a automake bug?
|
||||
example_plugin_la_LDFLAGS = -avoid-version -module -rpath $(shell pwd)
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#include "plugin.h"
|
||||
#include "lib/plugin.h"
|
||||
|
||||
CINELERRA_INTERFACE(hello, 1,
|
||||
CINELERRA_INTERFACE_PROTO(void, hello, (void))
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
|
||||
#include "plugin.h"
|
||||
#include "lib/plugin.h"
|
||||
#include "hello_interface.h"
|
||||
|
||||
|
||||
|
|
@ -10,7 +10,6 @@ main(int argc, char** argv)
|
|||
NOBUG_INIT;
|
||||
|
||||
cinelerra_init_plugin ();
|
||||
|
||||
/*
|
||||
we have a plugin 'hello_1' which provides us 2 hello interfaces, one for english and one for german output,
|
||||
open both try them, close them.
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
format 38
|
||||
format 40
|
||||
"CommonLib" // CommonLib
|
||||
revision 6
|
||||
revision 9
|
||||
modified_by 5 "hiv"
|
||||
// class settings
|
||||
//class diagram settings
|
||||
|
|
@ -8,7 +8,7 @@ format 38
|
|||
//use case diagram settings
|
||||
package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default
|
||||
//sequence diagram settings
|
||||
show_full_operations_definition default write_horizontally default drawing_language default draw_all_relations default shadow default
|
||||
show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default
|
||||
//collaboration diagram settings
|
||||
show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default draw_all_relations default shadow default
|
||||
//object diagram settings
|
||||
|
|
@ -26,6 +26,216 @@ format 38
|
|||
package_name_in_tab default show_context default show_opaque_action_definition default auto_label_position default write_flow_label_horizontally default draw_all_relations default shadow default
|
||||
show_infonote default drawing_language default
|
||||
|
||||
classview 128773 "error"
|
||||
//class diagram settings
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
|
||||
//collaboration diagram settings
|
||||
show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default draw_all_relations default shadow default
|
||||
//object diagram settings
|
||||
write_horizontally default package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default
|
||||
//sequence diagram settings
|
||||
show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default
|
||||
//state diagram settings
|
||||
package_name_in_tab default show_context default auto_label_position default write_trans_label_horizontally default show_trans_definition default draw_all_relations default shadow default
|
||||
show_activities default region_horizontally default drawing_language default
|
||||
//class settings
|
||||
//activity diagram settings
|
||||
package_name_in_tab default show_context default show_opaque_action_definition default auto_label_position default write_flow_label_horizontally default draw_all_relations default shadow default
|
||||
show_infonote default drawing_language default
|
||||
|
||||
classdiagram 130181 "Hierarchy"
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
|
||||
comment "Cinelerra Exception hierarchy"
|
||||
size A4
|
||||
end
|
||||
|
||||
class 135557 "Error"
|
||||
visibility package
|
||||
cpp_decl "${comment}${template}class ${name}${inherit}
|
||||
{
|
||||
${members} };
|
||||
${inlines}
|
||||
"
|
||||
java_decl ""
|
||||
idl_decl ""
|
||||
explicit_switch_type ""
|
||||
|
||||
classrelation 139781 // <generalisation>
|
||||
relation 137989 ---|>
|
||||
a public
|
||||
cpp default "${type}"
|
||||
classrelation_ref 139781 // <generalisation>
|
||||
b multiplicity "" parent class_ref 136325 // std::exception
|
||||
end
|
||||
|
||||
operation 131845 "what"
|
||||
const cpp_virtual public explicit_return_type "const char*"
|
||||
nparams 0
|
||||
cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name} ${(}${)}${const}${volatile} ${throw}${abstract};"
|
||||
cpp_def "${comment}${inline}${type}
|
||||
${class}::${name} ${(}${)}${const}${volatile} ${throw}${staticnl}
|
||||
{
|
||||
${body}
|
||||
}
|
||||
|
||||
"
|
||||
|
||||
|
||||
end
|
||||
|
||||
operation 131973 "rootCause"
|
||||
public explicit_return_type "std::exception"
|
||||
nparams 0
|
||||
cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name} ${(}${)}${const}${volatile} ${throw}${abstract};"
|
||||
cpp_def "${comment}${inline}${type}
|
||||
${class}::${name} ${(}${)}${const}${volatile} ${throw}${staticnl}
|
||||
{
|
||||
${body}
|
||||
}
|
||||
|
||||
"
|
||||
|
||||
|
||||
comment "If this exception was caused by a chain of further exceptions,
|
||||
return the first one registered in this throw sequence.
|
||||
This works only, if every exceptions thrown as a consequence
|
||||
of another exception is propperly constructed by passing
|
||||
the original exception to the constructor"
|
||||
end
|
||||
|
||||
attribute 130309 "cause"
|
||||
private type class_ref 136325 // std::exception
|
||||
stereotype "auto_ptr"
|
||||
cpp_decl " ${comment}${static}${mutable}${volatile}${const}${type} ${name}${value};
|
||||
"
|
||||
java_decl ""
|
||||
idl_decl ""
|
||||
comment "a copy of the first exception encountered in this exception chain"
|
||||
end
|
||||
end
|
||||
|
||||
class 135685 "Logic"
|
||||
visibility package
|
||||
cpp_decl "${comment}${template}class ${name}${inherit}
|
||||
{
|
||||
${members} };
|
||||
${inlines}
|
||||
"
|
||||
java_decl ""
|
||||
idl_decl ""
|
||||
explicit_switch_type ""
|
||||
|
||||
classrelation 139397 // <generalisation>
|
||||
relation 137605 ---|>
|
||||
a public
|
||||
cpp default "${type}"
|
||||
classrelation_ref 139397 // <generalisation>
|
||||
b multiplicity "" parent class_ref 135557 // Error
|
||||
end
|
||||
end
|
||||
|
||||
class 135813 "Config"
|
||||
visibility package
|
||||
cpp_decl "${comment}${template}class ${name}${inherit}
|
||||
{
|
||||
${members} };
|
||||
${inlines}
|
||||
"
|
||||
java_decl ""
|
||||
idl_decl ""
|
||||
explicit_switch_type ""
|
||||
|
||||
classrelation 139269 // <generalisation>
|
||||
relation 137477 ---|>
|
||||
a public
|
||||
cpp default "${type}"
|
||||
classrelation_ref 139269 // <generalisation>
|
||||
b multiplicity "" parent class_ref 135557 // Error
|
||||
end
|
||||
end
|
||||
|
||||
class 135941 "State"
|
||||
visibility package
|
||||
cpp_decl "${comment}${template}class ${name}${inherit}
|
||||
{
|
||||
${members} };
|
||||
${inlines}
|
||||
"
|
||||
java_decl ""
|
||||
idl_decl ""
|
||||
explicit_switch_type ""
|
||||
|
||||
classrelation 139141 // <generalisation>
|
||||
relation 137349 ---|>
|
||||
a public
|
||||
cpp default "${type}"
|
||||
classrelation_ref 139141 // <generalisation>
|
||||
b multiplicity "" parent class_ref 135557 // Error
|
||||
end
|
||||
end
|
||||
|
||||
class 136069 "Invalid"
|
||||
visibility package
|
||||
cpp_decl "${comment}${template}class ${name}${inherit}
|
||||
{
|
||||
${members} };
|
||||
${inlines}
|
||||
"
|
||||
java_decl ""
|
||||
idl_decl ""
|
||||
explicit_switch_type ""
|
||||
|
||||
classrelation 139525 // <generalisation>
|
||||
relation 137733 ---|>
|
||||
a public
|
||||
cpp default "${type}"
|
||||
classrelation_ref 139525 // <generalisation>
|
||||
b multiplicity "" parent class_ref 135557 // Error
|
||||
end
|
||||
end
|
||||
|
||||
class 136197 "External"
|
||||
visibility package
|
||||
cpp_decl "${comment}${template}class ${name}${inherit}
|
||||
{
|
||||
${members} };
|
||||
${inlines}
|
||||
"
|
||||
java_decl ""
|
||||
idl_decl ""
|
||||
explicit_switch_type ""
|
||||
|
||||
classrelation 139653 // <generalisation>
|
||||
relation 137861 ---|>
|
||||
a public
|
||||
cpp default "${type}"
|
||||
classrelation_ref 139653 // <generalisation>
|
||||
b multiplicity "" parent class_ref 135557 // Error
|
||||
end
|
||||
end
|
||||
|
||||
class 136325 "std::exception"
|
||||
visibility public stereotype "auxiliary"
|
||||
cpp_external cpp_decl "${comment}${template}class ${name}${inherit}
|
||||
{
|
||||
${members} };
|
||||
${inlines}
|
||||
"
|
||||
java_decl ""
|
||||
idl_decl ""
|
||||
explicit_switch_type ""
|
||||
|
||||
operation 131717 "what"
|
||||
const cpp_virtual public explicit_return_type "const char*"
|
||||
nparams 0
|
||||
cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name} ${(}${)}${const}${volatile} ${throw}${abstract};"
|
||||
|
||||
|
||||
comment "the base class of all exceptions thrown by the standard library"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
classview 128645 "Service Components"
|
||||
//class diagram settings
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
|
||||
|
|
@ -34,7 +244,7 @@ format 38
|
|||
//object diagram settings
|
||||
write_horizontally default package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default
|
||||
//sequence diagram settings
|
||||
show_full_operations_definition default write_horizontally default drawing_language default draw_all_relations default shadow default
|
||||
show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default
|
||||
//state diagram settings
|
||||
package_name_in_tab default show_context default auto_label_position default write_trans_label_horizontally default show_trans_definition default draw_all_relations default shadow default
|
||||
show_activities default region_horizontally default drawing_language default
|
||||
|
|
@ -58,6 +268,91 @@ ${inlines}
|
|||
|
||||
investigate posix.4 realtime timers, wrap these here"
|
||||
end
|
||||
|
||||
class 135301 "Factory"
|
||||
visibility public
|
||||
nformals 1
|
||||
formal name "T" type "class" explicit_default_value ""
|
||||
explicit_extends ""
|
||||
cpp_decl "${comment}${template}class ${name}${inherit}
|
||||
{
|
||||
${members} };
|
||||
${inlines}
|
||||
"
|
||||
java_decl ""
|
||||
idl_decl ""
|
||||
explicit_switch_type ""
|
||||
|
||||
comment "a template for generating functor-like Factory objects, used to encapsulate object creation and providing access via smart-pointers only."
|
||||
end
|
||||
|
||||
class 135429 "Appconfig"
|
||||
visibility public stereotype "singleton"
|
||||
cpp_decl "${comment}${template}class ${name}${inherit}
|
||||
{
|
||||
${members} };
|
||||
${inlines}
|
||||
"
|
||||
java_decl ""
|
||||
idl_decl ""
|
||||
explicit_switch_type ""
|
||||
|
||||
comment "Singleton to hold inevitable global flags and constants and for performing erarly (static) global initialization tasks."
|
||||
attribute 130181 "theApp_"
|
||||
class_attribute private type class_ref 135429 // Appconfig
|
||||
init_value "=0"
|
||||
cpp_decl " ${comment}${static}${mutable}${volatile}${const}${type} ${name}${value};
|
||||
"
|
||||
java_decl ""
|
||||
idl_decl ""
|
||||
comment "holds the single instance and triggers initialization"
|
||||
end
|
||||
|
||||
operation 131333 "Appconfig"
|
||||
private explicit_return_type ""
|
||||
nparams 0
|
||||
cpp_decl " ${comment}${inline}${name} ${(}${)}${volatile} ${throw};"
|
||||
cpp_def "${comment}${inline}
|
||||
${class}::${name} ${(}${)}${volatile} ${throw}
|
||||
{
|
||||
${body}
|
||||
}
|
||||
|
||||
"
|
||||
|
||||
|
||||
comment "perform initialization on first access.
|
||||
A call is placed in static initialization code
|
||||
included in cinelerra.h; thus it will happen
|
||||
ubiquitous very early."
|
||||
end
|
||||
|
||||
operation 131461 "instance"
|
||||
class_operation private explicit_return_type "Appconfig*"
|
||||
nparams 0
|
||||
cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name} ${(}${)}${const}${volatile} ${throw}${abstract};"
|
||||
|
||||
|
||||
end
|
||||
|
||||
operation 131589 "get"
|
||||
class_operation public explicit_return_type "string"
|
||||
nparams 1
|
||||
param inout name "key" explicit_type "string"
|
||||
cpp_decl " ${comment}${friend}${static}${inline}${virtual}${type} ${name} ${(}${t0} & ${p0}${)}${const}${volatile} ${throw}${abstract};"
|
||||
cpp_def "${comment}${inline}${type}
|
||||
${class}::${name} ${(}${t0} & ${p0}${)}${const}${volatile} ${throw}${staticnl}
|
||||
{
|
||||
${body}
|
||||
}
|
||||
|
||||
"
|
||||
|
||||
|
||||
comment "access the configuation value for a given key.
|
||||
@return empty string for unknown keys, else the corresponding configuration value"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
classview 128138 "Posix Threads Abstraction"
|
||||
|
|
@ -68,7 +363,7 @@ investigate posix.4 realtime timers, wrap these here"
|
|||
//object diagram settings
|
||||
write_horizontally default package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default
|
||||
//sequence diagram settings
|
||||
show_full_operations_definition default write_horizontally default drawing_language default draw_all_relations default shadow default
|
||||
show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default
|
||||
//state diagram settings
|
||||
package_name_in_tab default show_context default auto_label_position default write_trans_label_horizontally default show_trans_definition default draw_all_relations default shadow default
|
||||
show_activities default region_horizontally default drawing_language default
|
||||
|
|
@ -148,7 +443,7 @@ ${inlines}
|
|||
//object diagram settings
|
||||
write_horizontally default package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default
|
||||
//sequence diagram settings
|
||||
show_full_operations_definition default write_horizontally default drawing_language default draw_all_relations default shadow default
|
||||
show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default
|
||||
//state diagram settings
|
||||
package_name_in_tab default show_context default auto_label_position default write_trans_label_horizontally default show_trans_definition default draw_all_relations default shadow default
|
||||
show_activities default region_horizontally default drawing_language default
|
||||
|
|
@ -159,7 +454,7 @@ ${inlines}
|
|||
|
||||
class 128906 "SmartPointer"
|
||||
abstract visibility package stereotype "auxiliary"
|
||||
cpp_decl "${comment}${template}class ${name}${inherit} {
|
||||
cpp_external cpp_decl "${comment}${template}class ${name}${inherit} {
|
||||
${members}};
|
||||
${inlines}
|
||||
"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
format 40
|
||||
"common" // design::codegen::common
|
||||
revision 11
|
||||
revision 13
|
||||
modified_by 5 "hiv"
|
||||
// class settings
|
||||
//class diagram settings
|
||||
|
|
@ -39,6 +39,89 @@ Common library and helper classes"
|
|||
package_name_in_tab default show_context default write_horizontally default auto_label_position default draw_all_relations default shadow default
|
||||
draw_component_as_icon default show_component_req_prov default show_component_rea default
|
||||
comment "defines source files to be generated by BOUML"
|
||||
artifact 135813 "error"
|
||||
stereotype "source"
|
||||
cpp_h "/*
|
||||
${NAME}.hpp - ${description}
|
||||
@{CopyrightClaim}@{GPLHeader}
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ${NAMESPACE}_${NAME}_H
|
||||
#define ${NAMESPACE}_${NAME}_H
|
||||
|
||||
${includes}
|
||||
${declarations}
|
||||
|
||||
|
||||
${namespace_start}
|
||||
|
||||
${definition}
|
||||
${namespace_end}
|
||||
#endif
|
||||
"
|
||||
cpp_src "/*
|
||||
${Name} - ${description}
|
||||
@{CopyrightClaim}@{GPLHeader}
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
${includes}
|
||||
${namespace_start}
|
||||
|
||||
|
||||
${members}
|
||||
${namespace_end}"
|
||||
associated_classes
|
||||
class_ref 135557 // Error
|
||||
class_ref 135685 // Logic
|
||||
class_ref 135813 // Config
|
||||
class_ref 135941 // State
|
||||
class_ref 136069 // Invalid
|
||||
class_ref 136197 // External
|
||||
end
|
||||
comment "Cinelerra Exception Interface"
|
||||
end
|
||||
|
||||
artifact 135173 "appconfig"
|
||||
stereotype "source"
|
||||
cpp_h "/*
|
||||
${NAME}.hpp - ${description}
|
||||
@{CopyrightClaim}@{GPLHeader}
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ${NAMESPACE}_${NAME}_H
|
||||
#define ${NAMESPACE}_${NAME}_H
|
||||
|
||||
${includes}
|
||||
${declarations}
|
||||
|
||||
|
||||
${namespace_start}
|
||||
|
||||
${definition}
|
||||
${namespace_end}
|
||||
#endif
|
||||
"
|
||||
cpp_src "/*
|
||||
${Name} - ${description}
|
||||
@{CopyrightClaim}@{GPLHeader}
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
${includes}
|
||||
${namespace_start}
|
||||
|
||||
|
||||
${members}
|
||||
${namespace_end}"
|
||||
associated_classes
|
||||
class_ref 135429 // Appconfig
|
||||
end
|
||||
comment "for global initialization and configuration "
|
||||
end
|
||||
|
||||
artifact 134789 "time"
|
||||
stereotype "source"
|
||||
cpp_h "/*
|
||||
|
|
@ -78,4 +161,6 @@ ${namespace_end}"
|
|||
comment "unified representation of a time point, including conversion functions"
|
||||
end
|
||||
end
|
||||
|
||||
package_ref 130821 // error
|
||||
end
|
||||
|
|
|
|||
74
uml/cinelerra3/130181.diagram
Normal file
74
uml/cinelerra3/130181.diagram
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
format 40
|
||||
|
||||
classcanvas 128005 class_ref 135557 // Error
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
|
||||
xyz 254 162 2000
|
||||
end
|
||||
classcanvas 128133 class_ref 135685 // Logic
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
|
||||
xyz 87 361 2000
|
||||
end
|
||||
classcanvas 128261 class_ref 135813 // Config
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
|
||||
xyz 175 361 2000
|
||||
end
|
||||
classcanvas 128389 class_ref 135941 // State
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
|
||||
xyz 267 361 2000
|
||||
end
|
||||
classcanvas 128517 class_ref 136069 // Invalid
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
|
||||
xyz 355 361 2000
|
||||
end
|
||||
classcanvas 128645 class_ref 136197 // External
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
|
||||
xyz 444 361 2000
|
||||
end
|
||||
packagecanvas 130821
|
||||
package_ref 130821 // error
|
||||
show_context_mode namespace xyzwh 55 258 1994 472 162
|
||||
classcanvas 130949 class_ref 136325 // std::exception
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
|
||||
xyz 409 43 2000
|
||||
end
|
||||
relationcanvas 128773 relation_ref 137349 // <generalisation>
|
||||
geometry VHV
|
||||
from ref 128389 z 1999 to point 287 304
|
||||
line 130565 z 1999 to point 287 304
|
||||
line 130693 z 1999 to ref 128005
|
||||
no_role_a no_role_b
|
||||
no_multiplicity_a no_multiplicity_b
|
||||
relationcanvas 128901 relation_ref 137477 // <generalisation>
|
||||
geometry VHV
|
||||
from ref 128261 z 1999 to point 197 304
|
||||
line 130053 z 1999 to point 287 304
|
||||
line 130181 z 1999 to ref 128005
|
||||
no_role_a no_role_b
|
||||
no_multiplicity_a no_multiplicity_b
|
||||
relationcanvas 129029 relation_ref 137605 // <generalisation>
|
||||
geometry VHV
|
||||
from ref 128133 z 1999 to point 107 304
|
||||
line 130309 z 1999 to point 287 304
|
||||
line 130437 z 1999 to ref 128005
|
||||
no_role_a no_role_b
|
||||
no_multiplicity_a no_multiplicity_b
|
||||
relationcanvas 129157 relation_ref 137733 // <generalisation>
|
||||
geometry VHV
|
||||
from ref 128517 z 1999 to point 376 304
|
||||
line 129797 z 1999 to point 287 304
|
||||
line 129925 z 1999 to ref 128005
|
||||
no_role_a no_role_b
|
||||
no_multiplicity_a no_multiplicity_b
|
||||
relationcanvas 129285 relation_ref 137861 // <generalisation>
|
||||
geometry VHV
|
||||
from ref 128645 z 1999 to point 469 304
|
||||
line 129541 z 1999 to point 287 304
|
||||
line 129669 z 1999 to ref 128005
|
||||
no_role_a no_role_b
|
||||
no_multiplicity_a no_multiplicity_b
|
||||
relationcanvas 131077 relation_ref 137989 // <generalisation>
|
||||
from ref 128005 z 1999 to point 450 181
|
||||
line 131205 z 1999 to ref 130949
|
||||
no_role_a no_role_b
|
||||
no_multiplicity_a no_multiplicity_b
|
||||
end
|
||||
33
uml/cinelerra3/130821
Normal file
33
uml/cinelerra3/130821
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
format 40
|
||||
"error" // design::codegen::common::error
|
||||
revision 1
|
||||
modified_by 5 "hiv"
|
||||
// class settings
|
||||
//class diagram settings
|
||||
draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
|
||||
//use case diagram settings
|
||||
package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default
|
||||
//sequence diagram settings
|
||||
show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default
|
||||
//collaboration diagram settings
|
||||
show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default draw_all_relations default shadow default
|
||||
//object diagram settings
|
||||
write_horizontally default package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default
|
||||
//component diagram settings
|
||||
package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default
|
||||
draw_component_as_icon default show_component_req_prov default show_component_rea default
|
||||
//deployment diagram settings
|
||||
package_name_in_tab default show_context default write_horizontally default auto_label_position default draw_all_relations default shadow default
|
||||
draw_component_as_icon default show_component_req_prov default show_component_rea default
|
||||
//state diagram settings
|
||||
package_name_in_tab default show_context default auto_label_position default write_trans_label_horizontally default show_trans_definition default draw_all_relations default shadow default
|
||||
show_activities default region_horizontally default drawing_language default
|
||||
//activity diagram settings
|
||||
package_name_in_tab default show_context default show_opaque_action_definition default auto_label_position default write_flow_label_horizontally default draw_all_relations default shadow default
|
||||
show_infonote default drawing_language default
|
||||
|
||||
cpp_h_dir "common"
|
||||
cpp_src_dir "common"
|
||||
cpp_namespace "cinelerra::error"
|
||||
comment "Namespace for Exception Kinds"
|
||||
end
|
||||
|
|
@ -1,9 +1,24 @@
|
|||
window_sizes 1104 756 270 824 557 120
|
||||
diagrams
|
||||
active classdiagram_ref 130181 // Hierarchy
|
||||
762 514 100 4 0 0
|
||||
end
|
||||
show_stereotypes
|
||||
selected
|
||||
package_ref 129 // cinelerra3
|
||||
selected artifact_ref 135813 // error
|
||||
open
|
||||
deploymentview_ref 128261 // gen
|
||||
deploymentview_ref 128773 // gen
|
||||
|
||||
package_ref 129669 // proc
|
||||
package_ref 129797 // gui
|
||||
|
||||
package_ref 129285 // ProcessingLayer
|
||||
class_ref 135685 // Logic
|
||||
class_ref 135813 // Config
|
||||
class_ref 135941 // State
|
||||
class_ref 136069 // Invalid
|
||||
class_ref 136197 // External
|
||||
class_ref 136325 // std::exception
|
||||
class_ref 135429 // Appconfig
|
||||
classview_ref 128266 // SmartPointers
|
||||
end
|
||||
end
|
||||
|
|
|
|||
1
wiki/.gitignore
vendored
1
wiki/.gitignore
vendored
|
|
@ -1 +0,0 @@
|
|||
tmp/*
|
||||
119
wiki/index.html
119
wiki/index.html
|
|
@ -42,7 +42,7 @@ DAMAGE.
|
|||
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml'/>
|
||||
<!--}}}-->
|
||||
|
||||
<style type="text/css">#contentWrapper {display:none;}</style><div id="SplashScreen" style="border: 3px solid #ccc; display: block; text-align: center; width: 320px; margin: 100px auto; padding: 50px; color:#000; font-size: 28px; font-family:Tahoma; background-color:#eee;"><b>My TiddlyWiki</b> is loading<blink> ...</blink><br><br><span style="font-size: 14px; color:red;">Requires Javascript.</span></div>
|
||||
<style type="text/css">#contentWrapper {display:none;}</style><div id="SplashScreen" style="border: 3px solid #ccc; display: block; text-align: center; width: 320px; margin: 100px auto; padding: 50px; color:#000; font-size: 28px; font-family:Tahoma; background-color:#eee;"><b>Cinelerra TiddlyWiki</b> is loading<blink> ...</blink><br><br><span style="font-size: 14px; color:red;">Requires Javascript.</span></div>
|
||||
<!--PRE-HEAD-END-->
|
||||
<title> Cinelerra3 - Distributed Developer Wiki </title>
|
||||
<style type="text/css">
|
||||
|
|
@ -747,7 +747,19 @@ config.macros.timeline.handler = function(place,macroName,params,wikifier,paramS
|
|||
}
|
||||
//}}}</pre>
|
||||
</div>
|
||||
<div title="BuildSystem" modifier="Ichthyostega" modified="200708051534" created="200708051532" tags="organization buildsys" changecount="3">
|
||||
<div title="BuildDependenceis" modifier="Ichthyostega" modified="200708140618" created="200708120103" tags="organization buildsys" changecount="5">
|
||||
<pre>for __Building__
|
||||
* gcc (4.1), glibc6 (2.3), libstdc++6 (4.1)
|
||||
* [[build system|BuildSystem]] dependencies: SCons (0.96.90), Python (2.3)
|
||||
* NoBug for Logging, Tracing, Asserting (can be obtained from [[Pipapo.org|http://www.pipapo.org/pipawiki/NoBug]])
|
||||
* ~NoBug needs [[valgrind|Valgrind]] (3.2), execinfo.h and libpthread (&rarr; glibc)
|
||||
* std::tr1 &mdash; esp. for the former BOOST::shared_ptr (which is now proposed standard)
|
||||
* BOOST
|
||||
//usually, newer versions are OK//
|
||||
|
||||
for __Running__</pre>
|
||||
</div>
|
||||
<div title="BuildSystem" modifier="Ichthyostega" modified="200708120101" created="200708051532" tags="organization buildsys" changecount="4">
|
||||
<pre>July 2007 we agreed to try out several Build Systems in real world usage, to get a better feel on the maintenance costs of each.
|
||||
* SCons
|
||||
* AutoTools
|
||||
|
|
@ -755,6 +767,7 @@ config.macros.timeline.handler = function(place,macroName,params,wikifier,paramS
|
|||
!Used Functionality
|
||||
* (re)building with reliable dependency checks
|
||||
* environment checks ("configure")
|
||||
* executing self-test suite
|
||||
* provide central interface for setting switches and configuration options
|
||||
* installing of some or all created artifacts</pre>
|
||||
</div>
|
||||
|
|
@ -795,22 +808,22 @@ This distributed wiki might be used instead the pipapo.org wiki, investigate tha
|
|||
Wiki works. It is simple to use and just flexible enough to handle the task. I don't go to install any other software for such tasks on my server. While the design progresses I'd propose to move our work into git repositories and eventually phase this wiki pages out anyways. I'd rather like to start out distributed/git right away .. but git gives us only a fine storage layer, for a design process we need some good presentation layer (later when using git and starting the implementation everyones favorite editor serves for that) I have no better ideas yet to solve the presentation problem other than using this wiki (or maybe Bouml).
|
||||
</pre>
|
||||
</div>
|
||||
<div title="Cinelerra3Wiki" modifier="CehTeh" modified="200708131455" created="200706172308" tags="portal" changecount="24">
|
||||
<pre>This 'index.html' becomes the entry point of some tiddlywikis managed under git. There is a 'empty.html' in the same folder serving as template for generating new wikis. Please refrain from editing it.
|
||||
<div title="Cinelerra3Wiki" modifier="Ichthyostega" modified="200708170218" created="200706172308" tags="portal" changecount="29">
|
||||
<pre>This is the entry point to several [[TiddlyWiki]]-Pages containing the developer and design documentation for Cinelrra-3.
|
||||
|
||||
* I started a GitNotes where we will collect some information about git, howto and special setups
|
||||
* Cehteh started GitNotes where we will collect some information about git, howto and special setups
|
||||
* since we prefer gpg signed tags in git and not each developer knows gpg well here is a Micro-GPG-HowTo
|
||||
* we maintain (semi-) final design docs in DesignDocumentation
|
||||
* Things get often worked out on IRC, see IRC-Transcripts for decisions made there and not yet put into the proper documentation places
|
||||
|
||||
Please end your tiddlers in a newline, this makes merging in git easier since the /pre tag used in tiddlywiki will become on a single line.
|
||||
Please __end your tiddlers in a newline__, this makes merging in git easier since the /pre tag used in tiddlywiki will become on a single line.
|
||||
|
||||
----
|
||||
!Design Draft
|
||||
to get started, we create design drafts emphasizing different aspects and regions of Cinelerra-3
|
||||
|
||||
* Ichthyo focuses mainly on the Render Engine and its interconnection to the EDL, [[see this separate page|renderengine.html]]
|
||||
* cehteh works on the data backend draft, see [[this page|backend.html]]
|
||||
* Cehteh works on the data backend draft, see [[this page|backend.html]]
|
||||
* Some tools which don't fit somewhere else and are used everywhere are put into a [[Support Library|support_library.html]]
|
||||
* [[Description of the Test System|TestSh]]
|
||||
|
||||
|
|
@ -821,9 +834,8 @@ next we should //start thinking// on how to organize several aspects of the prac
|
|||
* how to organize the executable to be built?
|
||||
* what coding conventions to prefer? &rarr; [[GNU Style|DesignDocumentation]]
|
||||
* what [[build system|BuildSystem]] to use?
|
||||
|
||||
Ichthyo thinks we should do some informal brainstorming, test/prototypes to see how things work out and discuss them; then we should make them into formal project proposals on pipapo.org
|
||||
</pre>
|
||||
* various [[build dependencies|BuildDependenceis]]
|
||||
* TestSuite</pre>
|
||||
</div>
|
||||
<div title="DefaultTiddlers" modifier="CehTeh" modified="200707111115" created="200706172308" changecount="3">
|
||||
<pre>Cinelerra3Wiki
|
||||
|
|
@ -922,12 +934,12 @@ these two commands are used by 'admin/git-hooks/post-commit'
|
|||
|
||||
'git publish' just sends the commit to some repository which has to be registered with 'git remote add public ...', in case you are working offline this will stuck and timeout, you may break it with ctrl-c, someone may fix it.</pre>
|
||||
</div>
|
||||
<div title="GitBranches" modifier="Ichthyostega" modified="200708051534" created="200706260447" tags="overview git organization" changecount="11">
|
||||
<div title="GitBranches" modifier="Ichthyostega" modified="200708120100" created="200706260447" tags="overview git organization" changecount="13">
|
||||
<pre>some ''interesting Branches''
|
||||
|
||||
|![[pipapo.org|PipapoOrg]] |!''mirrored'' |!|!description |
|
||||
| ct#master | ichthyo#master | |Cinelerra3 main development line |
|
||||
| ichthyo#prototype | | |first coding attempts ;-) |
|
||||
| ichthyo#scons | | |[[SCons]]-based build system, improvements|
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
|
|
@ -979,28 +991,33 @@ git push git://git.pipapo.org/cinelerra3/mob
|
|||
|
||||
cinelerra3/mob is an anonymous account at pipapo.org where everyone can commit changes. </pre>
|
||||
</div>
|
||||
<div title="IRC-Transcripts" modifier="CehTeh" created="200708120209" changecount="1">
|
||||
<div title="IRC-Transcripts" modifier="Ichthyostega" modified="200708170239" created="200708120209" tags="discuss irclog" changecount="4">
|
||||
<pre>!10/11 aug 2007
|
||||
* maybe let the render graph builder generate a meta language which then is jit compiled for each configuration
|
||||
* using smart pointers and factories for objects, if this wont work because of cycles, we might investigate specialized garbage collectors for specific cases.
|
||||
* maybe let the render graph builder generate a meta language which then is ''jit compiled'' for each configuration
|
||||
* using smart pointers and factories for objects ''and avoid unprotected use of {{{new}}} and {{{delete}}}'', if this wont work because of cycles, we might investigate specialized garbage collectors for specific cases.
|
||||
* format for frames would be likely ffmpeg or such first, finally we see what suits best. We have to provide coverter nodes to convert frame formats for accessing diffrent libraries anyway (ffmpeg, v4l, gstreamer, ...)
|
||||
* we need a pool of worker threads and associated api's
|
||||
* accessing frames has a time (get until..), unique frame identifier (see below), policies (what to do when out of time, quality required,..) and hints (recursive dependency, must cache, playback speed and direction, ...)
|
||||
* accessing frames has a time (get until..), ''unique frame identifier'' (see below), policies (what to do when out of time, quality required,..) and hints (recursive dependency, must cache, playback speed and direction, ...)
|
||||
* for each sequence (configuration) each node has a number (monotonic incrementing), a generation counter (increment on each parameter change), a propagation sum (from parent nodes)
|
||||
* frames are identified by their time(frame number) and node number plus generation number and propagation sum. This allows easily to find out when a frame has to be rerendered
|
||||
* no difference between compositor and viewer
|
||||
** viewer is just a decoder where a display window attaches
|
||||
** one can have multiple of such display windows
|
||||
** tracks, effects, (things which are nodes in the render graph) can add gui components to the viewer, like masking tools, panning, overlay and other compositor things.
|
||||
** does such a display need to be a node in the render graph (means reconfig when changing it) or just something which peeks on top of it?
|
||||
** in the render graph we have ''attachement points'' i.e. ~ExitNode-instances. Display and other output can only be pulled from such ~ExitNodes. Changing just the display or attaching it to another ~ExitNode doesn't count as change of the render graph, while reordering or reconfiguring the ~ExitNodes themselfes of course //is// a reconfig.
|
||||
* tracks are just containers for other nodes
|
||||
** they serve a gui representation (timeline, patchbay, viewer)
|
||||
** they do the mixing of contained things
|
||||
** can be recursive, the gui represents basically a tree
|
||||
** we need some 'wireing' abstraction for the gui to make it a real graph
|
||||
* rendering frames, context between frames
|
||||
** the proc layer only queries frames (by identifier and timeout) the backend tries to serve the best it can do (from cache or let them render)
|
||||
** each render job carries some quality limit (as S/N ratio) when previewing or scratching through the project this is used to generate reasonable quality previews
|
||||
** the proc layer ''only queries frames'' (by identifier and timeout) the backend tries to serve the best it can do (from cache or let them render)
|
||||
** each render job carries some ''quality limit'' (as S/N ratio) when previewing or scratching through the project this is used to generate reasonable quality previews
|
||||
** individual processing nodes can use additional state for their processings...
|
||||
*** the node objects themselfs should stay stateles, i.e. they shouldn't store state internally.
|
||||
*** they can use special ''context frames'', which are provided and managed by the backend (as opaque data blocks).
|
||||
*** they can depend on previous state, i.e request from the backend a previous context frame, the same way as they can request previous media frames from the bakend, but there is no guarantee that the backend will satisfy this request.
|
||||
* on the question who decides what to do after a cache miss, we tend to put the decision into the render node (because this seems to be the simpler aproach), but still have to work out the details.
|
||||
</pre>
|
||||
</div>
|
||||
<div title="InlineJavaScript" modifier="Jeremy" created="200603090618" tags="systemConfig" server.type="file" server.host="file:///home/ct/.homepage/home.html" server.page.revision="200603090618">
|
||||
|
|
@ -1355,12 +1372,12 @@ We are in need of a new development model which is acceptable by all involved pe
|
|||
# ''All for Cinelerra''<<br>>The goal is to make the best Linux video editor to date, nothing less. Everyone puts in their best abilities. This project is not the place to blame people for things where they are not profound, help each other, make things right instead of blaming someone. Everyone should rate himself at what he can do best on the project.
|
||||
</pre>
|
||||
</div>
|
||||
<div title="MarkupPreHead" modifier="Ichthyostega" modified="200706260507" created="200706172303" tags="excludeMissing" changecount="1">
|
||||
<div title="MarkupPreHead" modifier="Ichthyostega" modified="200708120049" created="200706172303" tags="excludeMissing" changecount="2">
|
||||
<pre><!--{{{-->
|
||||
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml'/>
|
||||
<!--}}}-->
|
||||
|
||||
<style type="text/css">#contentWrapper {display:none;}</style><div id="SplashScreen" style="border: 3px solid #ccc; display: block; text-align: center; width: 320px; margin: 100px auto; padding: 50px; color:#000; font-size: 28px; font-family:Tahoma; background-color:#eee;"><b>My TiddlyWiki</b> is loading<blink> ...</blink><br><br><span style="font-size: 14px; color:red;">Requires Javascript.</span></div></pre>
|
||||
<style type="text/css">#contentWrapper {display:none;}</style><div id="SplashScreen" style="border: 3px solid #ccc; display: block; text-align: center; width: 320px; margin: 100px auto; padding: 50px; color:#000; font-size: 28px; font-family:Tahoma; background-color:#eee;"><b>Cinelerra TiddlyWiki</b> is loading<blink> ...</blink><br><br><span style="font-size: 14px; color:red;">Requires Javascript.</span></div></pre>
|
||||
</div>
|
||||
<div title="Micro-GPG-HowTo" modifier="CehTeh" modified="200708101901" created="200708101900" changecount="2">
|
||||
<pre>I (cehteh) just paste my configs and give very few hints here, refer to the gpg manpage, the gpg documentation, google or ask on IRC for details. Maybe you improve this.
|
||||
|
|
@ -2316,6 +2333,28 @@ I made this proposal 'final' now further details are likely better worked out in
|
|||
-- ["ct"] [[DateTime(2007-06-27T16:01:52Z)]]
|
||||
</pre>
|
||||
</div>
|
||||
<div title="SCons" modifier="Ichthyostega" modified="200708180224" created="200708180211" tags="organization buildsys" changecount="3">
|
||||
<pre>[SCons|http://www.scons.org/] is an //alternate build system// written in Python and using specific python-scripts for defining the buildprocess. These build scripts, called {{{SConstruct}}} and {{{SConsscript}}} are indeed //definitions//, not scripts for //doing// the build. If you are new to SCons (and familiar with make), you should really read the [Introduction of the users guide|http://www.scons.org/doc/0.97/HTML/scons-user/book1.html], because SCons is quite a different beast then make and the autotools.
|
||||
|
||||
To learn how to use SCons and to get a better feeling of its strenghtes and weaknesses, Ichthyo started a SCons based build system for cinelerra in July 2007 and will maintain it for some time parallel to the automake system (maintained by Cehteh). Every build system looks good in theory and has some big advantages, but only in real use one can see how much effort is needed to keep up with the demands of a given project.
|
||||
|
||||
!some Notes
|
||||
* we build always in the top level directory
|
||||
* at the moment, we use no separate build directory, rather we place the object files alongside with the sources
|
||||
* but we place the created executables and shared libraries into one $BINDIR (configurable in the top level {{{SConstruct}}})
|
||||
* note: for SCons, each file (which is buildable) and each directory (containing buildable files) is on itself a Target.
|
||||
* additionally, we provide some //aliasses//
|
||||
** build == $BINDIR
|
||||
** install places some of the created artifacts into $DESTDIR
|
||||
** testcode is an alias for all the executables comprising the testsuite
|
||||
** check == directory {{{tests}}} and runs the testsuite
|
||||
* run scons -h to get additional explanations.
|
||||
|
||||
Typically, one would just write the necessary definitions as they come into one global scope. But because the buildscripts are actually Python scripts, ichthyo found it preferable to use some more structuring and break down the code into several python functions and pass all necessary variables as parameters. This may seem overkill at first look, but the cinelerra project is expected to become a large project.
|
||||
|
||||
Moreover, one could simply list all needed files or break everything down into a hierarchical build. But instead, we use for most objects a helper function (located in {{{admin/scons/Buildhelper.py}}}) called {{{srcSubtree()}}}, which will scan a directory tree and add all {{{'*.c','*.cpp','*.cc'}}} - files as Object nodes to the build process. Besides that, we use the //hierarchical aproach rather reluctant//: at the moment, only the subtree for separate tools and the tests-directory have a separate buildscript. Probably, the subtree for plugins will get one as well at some point in the future.
|
||||
</pre>
|
||||
</div>
|
||||
<div title="ShortCuts" modifier="MichaelPloujnikov" modified="200706270305" created="200706260438" tags="portal" changecount="7">
|
||||
<pre>~~This small Tiddler contains usefull Shortcuts, Info, Links~~
|
||||
|
||||
|
|
@ -3455,9 +3494,11 @@ Portions written by Luke Blanshard are hereby released into the public domain.
|
|||
<!--}}}-->
|
||||
</pre>
|
||||
</div>
|
||||
<div title="TestSh" modifier="CehTeh" modified="200708131521" created="200708131509" changecount="5">
|
||||
<div title="TestSh" modifier="Ichthyostega" modified="200708180215" created="200708131509" tags="buildsys organization testsuite" changecount="9">
|
||||
<pre>! The Test Script
|
||||
There is a simple test script in tests which will be used to drive various tests. All tests are run under valgrind control if available unless {{{VALGRINDFLAGS=DISABLE}}} is defined. This test script is integrated in the automake build and will be used when {{{make check}}} is called.
|
||||
To drive the various tests, we use the script {{{tests/test.sh}}}. All tests are run under valgrind control if available unless {{{VALGRINDFLAGS=DISABLE}}} is defined.
|
||||
* The SCons buildsystem will build and run the testcode when executing the target {{{scons tests}}}.
|
||||
* This test script is integrated in the automake build and will be used when {{{make check}}} is called.
|
||||
|
||||
! Options for running the Test Suite
|
||||
One may define {{{TESTMODE}}} containing any one of the following strings:
|
||||
|
|
@ -3476,7 +3517,7 @@ make check
|
|||
}}}
|
||||
|
||||
! Writing Tests
|
||||
Tests are written in files named {{{NNname.tests}}} in the {{{tests}}} dir, where NN is a number defining the order of the various test files, 'name' should be a descriptive name about whats going to be tested.
|
||||
~Test-Definitons are written in files named {{{NNname.tests}}} in the {{{tests}}} dir, where NN is a number defining the order of the various test files, 'name' should be a descriptive name about whats going to be tested.
|
||||
|
||||
In a .tests file one has to define following:
|
||||
* {{{TESTING <description> <binary>}}} set the program binary to be tested to <binary>, <description> should be a string which is displayed as header before running following tests
|
||||
|
|
@ -3488,6 +3529,30 @@ In a .tests file one has to define following:
|
|||
|
||||
If no {{{out:}}} or {{{err:}}} is given, stdout and stderr are not considered as part of the test. If no {{{return:}}} is given, then 0 is expected.
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
<div title="TestSuite" modifier="Ichthyostega" modified="200708180218" created="200708120254" tags="buildsys organization testsuite" changecount="11">
|
||||
<pre>For running the automatic Tests, we use Cehteh's simple [[test.sh|TestSh]].
|
||||
|
||||
This page is a proposal (by Ichthyo) how the various tests could be organized.
|
||||
* individual ''Testcases'' are classes, doing whatsoever and however they see fit.
|
||||
* it is up to the individual test classes to take care / handle / isolate themself form any ''dependencies'' (similar to the [[philosophy of TestNG|http://www.beust.com/weblog/archives/000082.html]])
|
||||
* Testcases are ''grouped'' together into thematic (Sub)-Testsuites. Each Testcase has an unique ID and can be tagged with several groupIDs
|
||||
* for running a ''Testsuite'' (=distinct collection of tests) we build an executable linked against the test class objects.
|
||||
* moreover, for ''simple Tests'', we can build separate stelf-contained executables or even use other scripts.
|
||||
* the Testsuite executable provides some command line magic to select individual tests.
|
||||
* Top-level Testsuites or ''~Test-Collections'' for [[test.sh|TestSh]] contain calls to the different (sub)-Suites, together with the expected results/output
|
||||
|
||||
!conventions for the Buildsystem
|
||||
to help with automating the build, ichthyo would appreciate to have the following conventions.
|
||||
* in the {{{tests}}} directory are
|
||||
** the testdefinitions together with {{{test.sh}}}
|
||||
** the test-executables, which should named according to the pattern {{{test-XXX}}}
|
||||
* below are the source directories for each of the aforementioned test-executables. When such a source directory is named "XXX", the corresponding executable is "test-XXX"
|
||||
* each of the source directories, which actually could be source trees, will be compiled and linked together with the cinelerra core classes and files. Thus, it needs to contain exactly //one// main(), but by using commandline parameters, one executable can drive a lot of different tests.
|
||||
|
||||
-------
|
||||
//as of 18.8.2007, ichthyo has implemented this scheme for the SCons build//
|
||||
</pre>
|
||||
</div>
|
||||
<div title="TextAreaPlugin" modifier="Jeremy" created="200601261745" tags="systemConfig" server.type="file" server.host="file:///home/ct/.homepage/home.html" server.page.revision="200601261745">
|
||||
|
|
@ -3617,10 +3682,12 @@ function addKeyDownHandlers(e)
|
|||
}
|
||||
//}}}</pre>
|
||||
</div>
|
||||
<div title="TiddlyWiki" modifier="Ichthyostega" created="200706260506" tags="excludeMissing" changecount="2">
|
||||
<div title="TiddlyWiki" modifier="Ichthyostega" modified="200708120058" created="200706260506" tags="excludeMissing" changecount="4">
|
||||
<pre>The Name of the Software driving this Wiki. Is is written completely in ~JavaScript and contained in one single HTML page.
|
||||
Thus no server and no network connection is needed. Simply open the file in your browser and save changes locally. As the wiki HTML is located in the Cinelerra source tree, all changes will be managed and distributed via [[GIT|GitNotes]]. While doing so, you sometimes will have to merge conflicing changes manually in the HTML source. There is a 'empty.html' in the same folder serving as template for generating new wikis. Please refrain from editing it.
|
||||
* see GettingStarted
|
||||
* see [[Homepage|http://tiddlywiki.com]]</pre>
|
||||
* see [[Homepage|http://tiddlywiki.com]], [[Wiki-Markup|http://tiddlywiki.com/#MainFeatures]]
|
||||
</pre>
|
||||
</div>
|
||||
<div title="whatInBOUML" modifier="Ichthyostega" modified="200708051535" created="200706260559" tags="discuss policy" changecount="3">
|
||||
<pre>The question to find out about is: how much of the coding to do with the help of BOUML. Basically, BOUML is capable to permanently support the coding; you can define all entities, fields and methods in the UML model an just develop the method bodies //conventionally// with a text editor.
|
||||
|
|
|
|||
|
|
@ -514,7 +514,16 @@ ColorPalette
|
|||
|
||||
SiteUrl</pre>
|
||||
</div>
|
||||
<div title="Automation" modifier="MichaelPloujnikov" modified="200706271424" created="200706250751" changecount="3">
|
||||
<div title="Asset" modifier="Ichthyostega" created="200708100337" tags="def" changecount="2">
|
||||
<pre>Asset management is a subsystem on its own. Assets are "things" that can be loaded into a session, like Media, Clips, Effects, Transitions. It is the "bookkeeping view", while the EDL is the "manipulation and process view".
|
||||
|
||||
The Assets are important reference points holding the information needed to access external resources. For example, an Clip asset can reference a Media asset, which in turn holds the external filename from which to get the media stream. Or, an Effect asset can hold a plugin-ID.
|
||||
|
||||
!still to be worked out..
|
||||
is how to implement the relationship between [[MObject]]s and Assets. Do we use direct pointers, or do we prefer an ID + central registry approach? And how to handle the removal of an Asset (&rarr; see also [[analysis of mem management|ManagementAssetRelation]])
|
||||
</pre>
|
||||
</div>
|
||||
<div title="Automation" modifier="Ichthyostega" modified="200708100315" created="200706250751" tags="def" changecount="5">
|
||||
<pre>Automation is treated as a function over time. It is always tied to a specific Parameter (which can thus be variable over the course of the timeline). All details //how// this function is defined are completely abstracted away. The Parameter uses a ParamProvider to get the value for a given Time (point). Typically, this will use linear or bezier interpolation over a set of keyframes internally. Parameters can be configured to have different value ranges and distribution types (on-off, stepped, continuous, bounded)
|
||||
|
||||
[img[how to implement Automation|uml/fig129669.png]]
|
||||
|
|
@ -686,8 +695,12 @@ TertiaryMid: #99a
|
|||
TertiaryDark: #667
|
||||
Error: #f88</pre>
|
||||
</div>
|
||||
<div title="Controller" modifier="Ichthyostega" created="200706220319" tags="def" changecount="1">
|
||||
<div title="Controller" modifier="Ichthyostega" modified="200708100409" created="200706220319" tags="def" changecount="3">
|
||||
<pre>Here, in the context of the Render Engine, the Controller component is responsible for managing the global playback state, for triggering the build process and for activating the backend and the Render Engine configuration created by the Builder to carry out the actual rendering. So you can expect the Controller to encompass a State Machine.
|
||||
|
||||
!Facade
|
||||
This is an very important external Interface, because it links together all three Layers of our current architecture. It can be used by the backend to initiate [[Render Processes (=StateProxy)|StateProxy]] and it will probably be used by the Dispatcher for GUI actions as well...
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
<div title="DefaultTiddlers" modifier="Ichthyostega" modified="200706190047" created="200706172308" changecount="2">
|
||||
|
|
@ -748,6 +761,60 @@ To make the intended use of the classes more clear, consider the following two e
|
|||
<pre>A special kind (subclass) of [[Placement]]. As such it is always linked to a //Subject//, i.e. a MObject. In addition to the properties of a (unspecific) Placement, the ExplicitPlacement specifies a absolute time and track position for locating the Subject
|
||||
</pre>
|
||||
</div>
|
||||
<div title="Factories" modifier="Ichthyostega" modified="200708112256" created="200708100401" tags="impl discuss" changecount="18">
|
||||
<pre>We use Factories
|
||||
* for centralizing [[memory management|MemoryManagement]]
|
||||
* to support polymorphism (of course...)
|
||||
|
||||
!Requirements
|
||||
* request the actual placement/allocation from the backend
|
||||
* allways hand out a smart-pointer
|
||||
* encapsulate / make configurable the smart-pointer type
|
||||
* install a callback into the smart-pointer for destroying the resource.
|
||||
* redirect the destroying request to the backend
|
||||
|
||||
!Implementation Questions
|
||||
* how much genericity? (Ichthyo is rather inclined not to overdo this one. Often it is preferable to have repeated implementations follow a well known pattern, if this leads to short and simple implementations, while the complete general solution will be much more contrived).
|
||||
* how to specify the actual type needed?
|
||||
* how to implement the cases where a subtype needs to be selected (abstract factory pattern). Embody this into the Factory, pass it in as a Strategy or treat the Factory just as a simple service taking an explicit type-ID and providing the new object?
|
||||
|
||||
!!chosen design
|
||||
My main goal is to have an easy-to-use interface for the implementer of individual classes using this factory mechanism. The intended use should mimic the standard use of operator new, and at the same time there should be a possibility to configure »real« Factory behaviour in.
|
||||
|
||||
For this reason I make Factory a Functor, and for handling the concrete memory allocation, it inherits from an Allocator class. The users of this factory template typically either parametrize it with existing smart-pointer types and some Allocator instantiation, or they may chose to create a specialized Factory derived from this Factory template. After typically hiding this configuration behind a typedef, the user adds a static field to the class intended to use the Factory and initializes this field with the concrete Factory (this may pass internal ~IDs to the constructor of the Factory and from there on to the underlying Allocator).
|
||||
{{{
|
||||
#include "common/factory.hpp"
|
||||
|
||||
class Blubb
|
||||
{
|
||||
int uii ;
|
||||
|
||||
public:
|
||||
typedef cinelerra::factory::RefcountPtr<Blubb> Factory;
|
||||
static Factory create;
|
||||
|
||||
Blubb() : uii(42) {} ;
|
||||
};
|
||||
|
||||
/** a static Factory instance
|
||||
* for creating refcounting Ptrs to Blubb objects
|
||||
*/
|
||||
Blubb::Factory Blubb::create; // <----note this is a constructor call
|
||||
}}}
|
||||
Now, the clients of {{{class Blubb}}} can create ref-counting pointers to Blubb-objects by doing a fully qualified {{{create()}}} functor call:
|
||||
{{{
|
||||
std::tr1::shared_ptr<Blubb> huii = Blubb::create (); // <----will invoke the default Blubb() ctor
|
||||
std::tr1::shared_ptr<Blubb> pfuii = huii;
|
||||
}}}
|
||||
Some further details
|
||||
* Functor inherits (protected) from Allocator, besides that there are no additional requirements.
|
||||
* typically, Allocator provides a overloaded {{{operator new(size_t)}}} etc.
|
||||
* thus, when Functor or any derived class issues a new XX(), our custom Allocator gains control
|
||||
* the Functor-behaviour relies on a custom {{{operator()}}} which can be overridden in derived classes to take various parameter lists.
|
||||
* then, such a Factory class derived from Functor can do specific magic and e.g. create some subclass
|
||||
* and, as the created smart-pointer is a template parameter, such a custom Functor can create all sorts of Proxies, wrappers and the like
|
||||
</pre>
|
||||
</div>
|
||||
<div title="Fixture" modifier="Ichthyostega" modified="200706220325" created="200706220324" tags="def" changecount="2">
|
||||
<pre>a specially configured EDL
|
||||
* all MObjects have their position, length and configuration set up ready for rendering.
|
||||
|
|
@ -846,10 +913,13 @@ For this Cinelerra3 design, we could consider making GOP just another raw media
|
|||
&rarr;see in [[Wikipedia|http://en.wikipedia.org/wiki/Group_of_pictures]]
|
||||
</pre>
|
||||
</div>
|
||||
<div title="ImplementationDetails" modifier="Ichthyostega" created="200708080322" tags="overview" changecount="1">
|
||||
<pre>This wiki page is the entry point to some detail notes covering some technical decisions, details and problems encountered in the course of the implementation of the Cinelerra Renderengine, the Builder and the related parts.
|
||||
<div title="ImplementationDetails" modifier="Ichthyostega" modified="200708100408" created="200708080322" tags="overview" changecount="4">
|
||||
<pre>This wiki page is the entry point to detail notes covering some technical decisions, details and problems encountered in the course of the implementation of the Cinelerra Renderengine, the Builder and the related parts.
|
||||
|
||||
* [[Packages, Interfaces and Namespaces|InterfaceNamespaces]]</pre>
|
||||
* [[Packages, Interfaces and Namespaces|InterfaceNamespaces]]
|
||||
* [[Memory Management Issues|MemoryManagement]]
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
<div title="InlineJavaScript" modifier="Jeremy" created="200603090618" tags="systemConfig" server.type="file" server.host="file:///home/ct/.homepage/home.html" server.page.revision="200603090618">
|
||||
<pre>/***
|
||||
|
|
@ -1162,7 +1232,7 @@ config.formatters.push( {
|
|||
} )
|
||||
//}}}</pre>
|
||||
</div>
|
||||
<div title="InterfaceNamespaces" modifier="Ichthyostega" modified="200708081455" created="200708080338" tags="impl decision discuss" changecount="13">
|
||||
<div title="InterfaceNamespaces" modifier="Ichthyostega" modified="200708120302" created="200708080338" tags="impl decision discuss" changecount="15">
|
||||
<pre>Because we rely on strong decoupling and separation into self contained components, there is not much need for a common quasi-global namespace. Operations needing the cooperation of another subsystem will be delegated or even dispatched, consequently implementation code needs only the service acces points from "direct cooperation partner" subsystems. Hierarchical scopes besides classes are needed only when multiple subsystems share a set of common abstractions. Interface and Implementation use separate namespaces.
|
||||
|
||||
!common definitions
|
||||
|
|
@ -1179,6 +1249,8 @@ These large scale interfaces reside in special namespaces "~XXX_interface&q
|
|||
!contract checks and test code
|
||||
From experiences with other middle scale projects, I prefer having the test code in a separate tree (because test code easily doubles the number of source files). But of course it should be placed into the same namespace as the code being checked, or (better?) into a nested namespace "test". It is esp. desirable to have good coverage on the contracts of the subsystem interfaces and mayor components (while it is not always feasible or advisable to cover every implementation detail).
|
||||
|
||||
&rarr; see also [[testsuite documentation in the main wiki|index.html#TestSuite]]
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
<div title="InterfacesSession" modifier="Ichthyostega" modified="200708081535" created="200708080639" changecount="7">
|
||||
|
|
@ -1220,6 +1292,12 @@ This Design strives to achieve a StrongSeparation between the low-level Structur
|
|||
[[Admin]]
|
||||
<<fullscreen>></pre>
|
||||
</div>
|
||||
<div title="ManagementAssetRelation" modifier="Ichthyostega" created="200708100337" tags="impl" changecount="2">
|
||||
<pre>Problem is: when removing an Asset, all corresponding MObjects need to disappear. This means, besides the obvious Ref-Link (MObject refering to an asset) we need backlinks or a sort of registry. And still worse: we need to remove the affetcted MObject from the object network in the EDL and rebuild the Fixture...
|
||||
|
||||
{{red{to be considered in more detail later}}}
|
||||
</pre>
|
||||
</div>
|
||||
<div title="MarkupPreHead" modifier="Ichthyostega" modified="200708080243" created="200706172303" changecount="1">
|
||||
<pre><!--{{{-->
|
||||
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml'/>
|
||||
|
|
@ -1227,6 +1305,39 @@ This Design strives to achieve a StrongSeparation between the low-level Structur
|
|||
|
||||
<style type="text/css">#contentWrapper {display:none;}</style><div id="SplashScreen" style="border: 3px solid #ccc; display: block; text-align: center; width: 320px; margin: 100px auto; padding: 50px; color:#000; font-size: 28px; font-family:Tahoma; background-color:#eee;">loading <b>Cinelerra Renderengine</b> devel doku<blink> ...</blink><br><br><span style="font-size: 14px; color:red;">Requires Javascript.</span></div></pre>
|
||||
</div>
|
||||
<div title="MemoryManagement" modifier="Ichthyostega" modified="200708100408" created="200708100225" tags="impl decision discuss" changecount="8">
|
||||
<pre>Of course: Cinelerra currently leaks memory and crashes regularilly. For the newly written code, besides retaining the same performance level, a main goal is to use methods and techniques known to support the writing of quality code. So, besides the MultithreadConsiderations, a solid strategy for managing the ownership of allocated memory blocks is necessary right from start.
|
||||
|
||||
!Problems
|
||||
# Memory management needs to work correct in a //fault tolerant environment//. That means that we need to be prepared to //handle on a non-local scale// some sorts of error conditions (without aborting the application). To be more precise: some error condition arises locally, which leads to a local abort and just the disabling/failing of some subsystem without affecting the application as a whole. This can happen on a regular base (e.g. rendering fails) and thus is __no excuse for leaking memory__
|
||||
# Some (not all) parts of the core application are non-deterministic. That means, we can't tie the memory management to any assumptions on behalf of the execution path
|
||||
|
||||
!C++ solution
|
||||
First of all -- this doesn't concern //every// allocation. It rather means there are certain //dangerous areas// which need to be identified. And as always, instead of carrying the inherent complexities of the problem into the solution, we should rather look for a common solution pattern which helps factoring out the complexity.
|
||||
|
||||
For the case in question this seems to be the ''resource allocation is construction'' pattern. Which boils down to basically never using bare pointers when concerned with ownership. Instead, ownership should be handled by smart-pointers.
|
||||
|
||||
!!usage scenarios
|
||||
# __existence is being used__: Objects just live for being referred to in a object network. In this case, use refcounting smart-pointers for every ref. (note: problem with cyclic refs)
|
||||
# __entity bound ownership__: Objects can be tied to some long living entity in the program, which holds the smart-pointer
|
||||
#* if the existence of these ref-holding entity can be //guaranteed// (like a contract), then the other users can build a object network with conventional pointers
|
||||
#* otherwise, when the ref-holding entity //can disappear// in a regular program state, we need weak-refs and checking (because by our postulate the controlled resource needs to be destructed immediately, otherwise we would have the first case, existence == being used)
|
||||
|
||||
!!!dangerous uses
|
||||
* the render nodes &rarr; [[detail analysis|ManagementRenderNodes]] {{red{TODO}}}
|
||||
* the MObjects in the EDL &rarr; [[detail analysis|ManagementMObjects]] {{red{TODO}}}
|
||||
* Asset - MObject relationship. &rarr; [[detail analysis|ManagementAssetRelation]] {{red{TODO}}}
|
||||
|
||||
!!!rather harmless
|
||||
* Frames (buffers), because they belong to a given [[RenderProcess (=StateProxy)|StateProxy]] and are just passed in into the individual [[ProcNode]]s. This can be handled consistently with conventional methods.
|
||||
* each StateProxy belongs to one top-level call to the [[Controller-Facade|Controller]]
|
||||
* same for the builder tools
|
||||
* the EDL and the defined [[Asset]]s belong together to one Session. If the Session is closed, this means a internal shutdown of the whole ProcLayer, i.e. closing of all GUI representations and terminating all render processes. If these calles are implemented as blocking operations, we can assert that as long as any GUI representation or any render process is running, there is a valid Session and EDL.
|
||||
|
||||
!using Factories
|
||||
And, last but not least, doing all actual allocations is the job of the backend. Exceptions being long-lived objects, like the Session or the EDL, which are created once and don't bear the danger of causing memory pressure. Besides that, the ProcLayer code shouldn't issue "new" and "delete", rather it should use some central [[Factories]] for all allocation and freeing, so we can redirect these calls down to the backend, which may use pooling or special placement allocators or the like. The rationale is, for modern hardware/architectures, care has to be taken with heap allocations, esp. with many small objects and irregular usage patterns.
|
||||
</pre>
|
||||
</div>
|
||||
<div title="OpenGL" modifier="Ichthyostega" modified="200706220359" created="200706220345" tags="def discuss" changecount="3">
|
||||
<pre>Cinelerra2 introduced OpenGL support for rendering previews. I must admit, I am very unhappy with this, because
|
||||
* it just supports some hardware
|
||||
|
|
@ -1838,6 +1949,13 @@ Closely related to this is the not-so-obvious problem how to understand the comm
|
|||
* is it really necessary to have fixed global tracks?
|
||||
* is it really helpful to feed "source tracks" into global processing busses/channels?
|
||||
Users accustomed with modern GUI applications typically expect that //everything is a object// and can be pulled around and manipulated individually. This seems natural at start, but raises the problem of providing a efficient workflow for handling larger projects and editing tasks. So, if we don't have a hard wired multitrack+bus architecture, we need some sort of templating to get the standard editing use case done efficiently.
|
||||
</pre>
|
||||
</div>
|
||||
<div title="ProcLayer" modifier="Ichthyostega" modified="200708100338" created="200708100333" tags="def" changecount="2">
|
||||
<pre>The middle Layer of our current Architecture plan, i.e. the layer managing all processing and manipulation, while the actual data handling is done in the backend and the user interaction belongs to the GUI Layer.
|
||||
|
||||
&rarr; see the [[Overview]]
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
<div title="ProcNode" modifier="MichaelPloujnikov" modified="200706271500" created="200706220409" tags="def" changecount="3">
|
||||
|
|
|
|||
|
|
@ -646,7 +646,12 @@ Error: #f88</pre>
|
|||
<div title="DefaultTiddlers" modifier="CehTeh" modified="200707102306" created="200707102301" changecount="2">
|
||||
<pre>[[SupportLibrary]]</pre>
|
||||
</div>
|
||||
<div title="ErrorHandling" modifier="CehTeh" modified="200708101307" created="200707152252" tags="excludeMissing" changecount="5">
|
||||
<div title="ErrorHandling" modifier="Ichthyostega" modified="200708140629" created="200708140628" changecount="2">
|
||||
<pre>We distinguish the way how to cope with Errors, i.e. the ErrorHandlingPolicy, and the actual implementation
|
||||
* for code with C semantics &rarr; ErrorHandling-C
|
||||
* for C++ code &rarr; ErrorHandling-Cpp</pre>
|
||||
</div>
|
||||
<div title="ErrorHandling-C" modifier="Ichthyostega" modified="200708140628" created="200707152252" tags="excludeMissing" changecount="1">
|
||||
<pre>! Proposal:
|
||||
We need some centralized way to handle errors and doing hard aborts.
|
||||
|
||||
|
|
@ -700,6 +705,19 @@ thus a {{{CINELERRA_ERROR_DEFINE(NFOO, "Foo not found")}}} will result
|
|||
!! Allocation
|
||||
The next point is allocation failures. These are possible by C/C++ standard but don't actually happen anymore in Linux (except in few rare cases). Instead of gracefully handling this errors I'll add a {{{CINELERRA_DIE(message)}}} macro to this library later. This macro will just do (NoBug) logging and then doing a hard abort. It should be a macro because we want to preserve file/line location for logging.
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
<div title="ErrorHandling-Cpp" modifier="Ichthyostega" created="200708140640" changecount="1">
|
||||
<pre>Basically, the C++ error handling techniques are layered on top of the [[C solution|ErrorHandling-C]].
|
||||
!Proposal:
|
||||
We use a common base class for all our application specific exceptions. These exceptions can be thought of as a classification of error situations, thus the hierarchical approach. The purpose of throwing such a //classified exception// is
|
||||
* to do a controlled partial failure
|
||||
* to trigger automatic cleanup without the need to implement the details
|
||||
|
||||
!!Requirements for the Exception Interface
|
||||
* a means for capturing and transporting detail informations
|
||||
* the possibility to link to the ''root cause'' of an exception, even after having passed several subsystem barriers.
|
||||
* getting standardized error messages automatically
|
||||
</pre>
|
||||
</div>
|
||||
<div title="FullScreenPlugin" modifier="CehTeh" modified="200706110313" created="200607241016" tags="systemConfig lewcidExtension" server.type="file" server.host="file:///home/ct/.homepage/home.html" server.page.revision="200706110313">
|
||||
|
|
|
|||
Loading…
Reference in a new issue