Lumiera renaming -- source code
This commit is contained in:
parent
fbacb4cdb1
commit
e737b9ef1b
104 changed files with 866 additions and 866 deletions
|
|
@ -26,13 +26,13 @@
|
|||
#include "common/util.hpp"
|
||||
|
||||
using util::isnil;
|
||||
using cinelerra::error::Invalid;
|
||||
using lumiera::error::Invalid;
|
||||
|
||||
namespace backend_interface
|
||||
{
|
||||
|
||||
/** storage for the SingletonFactory
|
||||
* (actually a cinelerra::test::MockInjector) */
|
||||
* (actually a lumiera::test::MockInjector) */
|
||||
Singleton<MediaAccessFacade> MediaAccessFacade::instance;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ namespace backend_interface
|
|||
* information from this file, NULL if the
|
||||
* file is not acessible.
|
||||
*/
|
||||
virtual FileHandle queryFile (const char* name) throw(cinelerra::error::Invalid);
|
||||
virtual FileHandle queryFile (const char* name) throw(lumiera::error::Invalid);
|
||||
|
||||
/** request for information about the n-th channel
|
||||
* of the file refered by FileHandle.
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
using util::isnil;
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
|
||||
/** This internal pointer to the single instance is deliberately
|
||||
|
|
@ -52,7 +52,7 @@ namespace cinelerra
|
|||
|
||||
/** perform initialization on first access.
|
||||
* A call is placed in static initialization code
|
||||
* included in cinelerra.h; thus it will happen
|
||||
* included in lumiera.h; thus it will happen
|
||||
* probably very early.
|
||||
*/
|
||||
Appconfig::Appconfig()
|
||||
|
|
@ -65,7 +65,7 @@ namespace cinelerra
|
|||
INFO(config, "Basic application configuration triggered.");
|
||||
|
||||
// install our own handler for undeclared exceptions
|
||||
std::set_unexpected (cinelerra::error::cinelerra_unexpectedException);
|
||||
std::set_unexpected (lumiera::error::lumiera_unexpectedException);
|
||||
|
||||
(*configParam_)["version"] = STRINGIFY (LUMIERA_VERSION);
|
||||
}
|
||||
|
|
@ -89,10 +89,10 @@ namespace cinelerra
|
|||
catch (...)
|
||||
{
|
||||
ERROR(config, "error while accessing configuration parameter \"%s\".", key.c_str());
|
||||
throw cinelerra::error::Fatal ();
|
||||
throw lumiera::error::Fatal ();
|
||||
} }
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef CINELERRA_APPCONFIG_H
|
||||
#define CINELERRA_APPCONFIG_H
|
||||
#ifndef LUMIERA_APPCONFIG_H
|
||||
#define LUMIERA_APPCONFIG_H
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
using std::string;
|
||||
using boost::scoped_ptr;
|
||||
|
|
@ -104,5 +104,5 @@ namespace cinelerra
|
|||
|
||||
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Error - Cinelerra Exception Interface
|
||||
Error - Lumiera Exception Interface
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
|
@ -33,7 +33,7 @@ using util::isnil;
|
|||
using std::exception;
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
|
||||
namespace error
|
||||
|
|
@ -46,23 +46,23 @@ namespace cinelerra
|
|||
*/
|
||||
inline const string default_usermsg (Error* exception_obj) throw()
|
||||
{
|
||||
return string("Sorry, Cinelerra encountered an internal error. (")
|
||||
return string("Sorry, Lumiera encountered an internal error. (")
|
||||
+ typeid(*exception_obj).name() + ")";
|
||||
}
|
||||
|
||||
|
||||
/* constants to be used as error IDs */
|
||||
CINELERRA_ERROR_DEFINE (LOGIC , "internal logic broken");
|
||||
CINELERRA_ERROR_DEFINE (FATAL , "floundered");
|
||||
CINELERRA_ERROR_DEFINE (CONFIG , "misconfiguration");
|
||||
CINELERRA_ERROR_DEFINE (STATE , "unforseen state");
|
||||
CINELERRA_ERROR_DEFINE (INVALID , "invalid input or parameters");
|
||||
CINELERRA_ERROR_DEFINE (EXTERNAL , "failure in external service");
|
||||
CINELERRA_ERROR_DEFINE (ASSERTION, "assertion failure");
|
||||
LUMIERA_ERROR_DEFINE (LOGIC , "internal logic broken");
|
||||
LUMIERA_ERROR_DEFINE (FATAL , "floundered");
|
||||
LUMIERA_ERROR_DEFINE (CONFIG , "misconfiguration");
|
||||
LUMIERA_ERROR_DEFINE (STATE , "unforseen state");
|
||||
LUMIERA_ERROR_DEFINE (INVALID , "invalid input or parameters");
|
||||
LUMIERA_ERROR_DEFINE (EXTERNAL , "failure in external service");
|
||||
LUMIERA_ERROR_DEFINE (ASSERTION, "assertion failure");
|
||||
|
||||
} // namespace error
|
||||
|
||||
CINELERRA_ERROR_DEFINE (EXCEPTION, "generic cinelerra exception");
|
||||
LUMIERA_ERROR_DEFINE (EXCEPTION, "generic Lumiera exception");
|
||||
|
||||
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ namespace cinelerra
|
|||
desc_ (description),
|
||||
cause_ ("")
|
||||
{
|
||||
cinelerra_error_set (this->id_);
|
||||
lumiera_error_set (this->id_);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ namespace cinelerra
|
|||
desc_ (description),
|
||||
cause_ (extractCauseMsg(cause))
|
||||
{
|
||||
cinelerra_error_set (this->id_);
|
||||
lumiera_error_set (this->id_);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ namespace cinelerra
|
|||
|
||||
|
||||
/** Description of the problem, including the internal char constant
|
||||
* in accordance to cinelerra's error identification scheme.
|
||||
* in accordance to Lumiera's error identification scheme.
|
||||
* If a root cause can be obtained, this will be included in the
|
||||
* generated output as well.
|
||||
*/
|
||||
|
|
@ -167,15 +167,15 @@ namespace cinelerra
|
|||
namespace error
|
||||
{
|
||||
|
||||
void cinelerra_unexpectedException () throw()
|
||||
void lumiera_unexpectedException () throw()
|
||||
{
|
||||
const char* is_halted
|
||||
= "### Cinelerra halted due to an unexpected Error ###";
|
||||
= "### Lumiera halted due to an unexpected Error ###";
|
||||
|
||||
std::cerr << "\n" << is_halted << "\n\n";
|
||||
ERROR (NOBUG_ON, "%s", is_halted);
|
||||
|
||||
if (const char * errorstate = cinelerra_error ())
|
||||
if (const char * errorstate = lumiera_error ())
|
||||
ERROR (NOBUG_ON, "last registered error was....\n%s", errorstate);
|
||||
|
||||
std::terminate();
|
||||
|
|
@ -183,7 +183,7 @@ namespace cinelerra
|
|||
|
||||
void assertion_terminate (const string& location)
|
||||
{
|
||||
throw Fatal (location, CINELERRA_ERROR_ASSERTION)
|
||||
throw Fatal (location, LUMIERA_ERROR_ASSERTION)
|
||||
.setUsermsg("Program terminated because of violating "
|
||||
"an internal consistency check.");
|
||||
}
|
||||
|
|
@ -191,4 +191,4 @@ namespace cinelerra
|
|||
|
||||
} // namespace error
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
ERROR.hpp - Cinelerra Exception Interface
|
||||
ERROR.hpp - Lumiera Exception Interface
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
|
@ -21,26 +21,26 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef CINELERRA_ERROR_HPP_
|
||||
#define CINELERRA_ERROR_HPP_
|
||||
#ifndef LUMIERA_ERROR_HPP_
|
||||
#define LUMIERA_ERROR_HPP_
|
||||
|
||||
#include <string>
|
||||
#include "nobugcfg.h"
|
||||
#include "lib/error.h"
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
using std::string;
|
||||
|
||||
|
||||
|
||||
/** error-ID for unspecified exceptions */
|
||||
CINELERRA_ERROR_DECLARE(EXCEPTION);
|
||||
LUMIERA_ERROR_DECLARE(EXCEPTION);
|
||||
|
||||
/**
|
||||
* Interface and Baseclass of all Exceptions thrown
|
||||
* from within cinelerra (C++) code. Common operations
|
||||
* from within Lumiera (C++) code. Common operations
|
||||
* for getting an diagnostic message and for obtaining
|
||||
* the root cause, i.e. the first exception encountered
|
||||
* in a chain of exceptions.
|
||||
|
|
@ -48,9 +48,9 @@ namespace cinelerra
|
|||
class Error : public std::exception
|
||||
{
|
||||
public:
|
||||
Error (string description="", const char* id=CINELERRA_ERROR_EXCEPTION) throw();
|
||||
Error (string description="", const char* id=LUMIERA_ERROR_EXCEPTION) throw();
|
||||
Error (std::exception& cause,
|
||||
string description="", const char* id=CINELERRA_ERROR_EXCEPTION) throw();
|
||||
string description="", const char* id=LUMIERA_ERROR_EXCEPTION) throw();
|
||||
|
||||
Error (const Error&) throw();
|
||||
virtual ~Error () throw() {};
|
||||
|
|
@ -58,7 +58,7 @@ namespace cinelerra
|
|||
/** yield a diagnostic message characterizing the problem */
|
||||
virtual const char* what () const throw();
|
||||
|
||||
/** the internal cinelerra-error-ID (was set as C-errorstate in ctor) */
|
||||
/** the internal Lumiera-error-ID (was set as C-errorstate in ctor) */
|
||||
const char* getID () const throw() { return this->id_; }
|
||||
|
||||
/** extract the message to be displayed for the user */
|
||||
|
|
@ -80,7 +80,7 @@ namespace cinelerra
|
|||
|
||||
|
||||
private:
|
||||
const char* id_; ///< an CINELERRA_ERROR id, which is set as errorstate on construction
|
||||
const char* id_; ///< an LUMIERA_ERROR id, which is set as errorstate on construction
|
||||
string msg_; ///< friendly message intended for users (to be localized)
|
||||
string desc_; ///< detailed description of the error situation for the developers
|
||||
mutable string what_; ///< buffer for generating the detailed description on demand
|
||||
|
|
@ -105,68 +105,68 @@ namespace cinelerra
|
|||
* can be considered a severe design flaw; we can just
|
||||
* add some diagnostics prior to halting.
|
||||
*/
|
||||
void cinelerra_unexpectedException () throw();
|
||||
void lumiera_unexpectedException () throw();
|
||||
|
||||
/** throw an error::Fatal indicating "assertion failure" */
|
||||
void assertion_terminate (const string& location);
|
||||
|
||||
|
||||
/* constants to be used as error IDs */
|
||||
CINELERRA_ERROR_DECLARE (LOGIC ); ///< contradiction to internal logic assumptions detected
|
||||
CINELERRA_ERROR_DECLARE (FATAL ); ///< unable to cope with, internal logic floundered
|
||||
CINELERRA_ERROR_DECLARE (CONFIG ); ///< execution aborted due to misconfiguration
|
||||
CINELERRA_ERROR_DECLARE (STATE ); ///< unforeseen internal state
|
||||
CINELERRA_ERROR_DECLARE (INVALID ); ///< invalid input or parameters encountered
|
||||
CINELERRA_ERROR_DECLARE (EXTERNAL ); ///< failure in external service the application relies on
|
||||
CINELERRA_ERROR_DECLARE (ASSERTION); ///< assertion failure
|
||||
LUMIERA_ERROR_DECLARE (LOGIC ); ///< contradiction to internal logic assumptions detected
|
||||
LUMIERA_ERROR_DECLARE (FATAL ); ///< unable to cope with, internal logic floundered
|
||||
LUMIERA_ERROR_DECLARE (CONFIG ); ///< execution aborted due to misconfiguration
|
||||
LUMIERA_ERROR_DECLARE (STATE ); ///< unforeseen internal state
|
||||
LUMIERA_ERROR_DECLARE (INVALID ); ///< invalid input or parameters encountered
|
||||
LUMIERA_ERROR_DECLARE (EXTERNAL ); ///< failure in external service the application relies on
|
||||
LUMIERA_ERROR_DECLARE (ASSERTION); ///< assertion failure
|
||||
|
||||
/** Macro for creating derived exception classes properly
|
||||
* integrated into cinelerra's exception hierarchy. Using
|
||||
* integrated into Lumiera's exception hierarchy. Using
|
||||
* this macro asures that the new class will get the full
|
||||
* set of constructors and behaviour common to all exception
|
||||
* classes, so it should be used when creating an derived
|
||||
* exception type for more then stricly local purposes
|
||||
*/
|
||||
#define CINELERRA_EXCEPTION_DECLARE(CLASS, PARENT, _ID_) \
|
||||
class CLASS : public PARENT \
|
||||
{ \
|
||||
public: \
|
||||
CLASS (std::string description="", \
|
||||
const char* id=_ID_) throw() \
|
||||
: PARENT (description, id) {} \
|
||||
\
|
||||
CLASS (std::exception& cause, \
|
||||
std::string description="", \
|
||||
const char* id=_ID_) throw() \
|
||||
: PARENT (cause, description, id) {} \
|
||||
#define LUMIERA_EXCEPTION_DECLARE(CLASS, PARENT, _ID_) \
|
||||
class CLASS : public PARENT \
|
||||
{ \
|
||||
public: \
|
||||
CLASS (std::string description="", \
|
||||
const char* id=_ID_) throw() \
|
||||
: PARENT (description, id) {} \
|
||||
\
|
||||
CLASS (std::exception& cause, \
|
||||
std::string description="", \
|
||||
const char* id=_ID_) throw() \
|
||||
: PARENT (cause, description, id) {} \
|
||||
};
|
||||
|
||||
//---------------------------CLASS-----PARENT--ID----------------------
|
||||
CINELERRA_EXCEPTION_DECLARE (Logic, Error, CINELERRA_ERROR_LOGIC);
|
||||
CINELERRA_EXCEPTION_DECLARE (Fatal, Logic, CINELERRA_ERROR_FATAL);
|
||||
CINELERRA_EXCEPTION_DECLARE (Config, Error, CINELERRA_ERROR_CONFIG);
|
||||
CINELERRA_EXCEPTION_DECLARE (State, Error, CINELERRA_ERROR_STATE);
|
||||
CINELERRA_EXCEPTION_DECLARE (Invalid, Error, CINELERRA_ERROR_INVALID);
|
||||
CINELERRA_EXCEPTION_DECLARE (External, Error, CINELERRA_ERROR_EXTERNAL);
|
||||
//-------------------------CLASS-----PARENT--ID----------------------
|
||||
LUMIERA_EXCEPTION_DECLARE (Logic, Error, LUMIERA_ERROR_LOGIC);
|
||||
LUMIERA_EXCEPTION_DECLARE (Fatal, Logic, LUMIERA_ERROR_FATAL);
|
||||
LUMIERA_EXCEPTION_DECLARE (Config, Error, LUMIERA_ERROR_CONFIG);
|
||||
LUMIERA_EXCEPTION_DECLARE (State, Error, LUMIERA_ERROR_STATE);
|
||||
LUMIERA_EXCEPTION_DECLARE (Invalid, Error, LUMIERA_ERROR_INVALID);
|
||||
LUMIERA_EXCEPTION_DECLARE (External, Error, LUMIERA_ERROR_EXTERNAL);
|
||||
|
||||
|
||||
} // namespace error
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
||||
|
||||
|
||||
/******************************************************
|
||||
* if NoBug is used, redefine some macros
|
||||
* to rather throw Cinelerra Errors instead of aborting
|
||||
* to rather throw Lumiera Errors instead of aborting
|
||||
*/
|
||||
#ifdef NOBUG_ABORT
|
||||
#undef NOBUG_ABORT
|
||||
#define CIN_NOBUG_LOCATION \
|
||||
std::string (NOBUG_BASENAME(__FILE__)) +":"+ NOBUG_STRINGIZE(__LINE__) + ", function " + __func__
|
||||
#define NOBUG_ABORT \
|
||||
cinelerra::error::assertion_terminate (CIN_NOBUG_LOCATION);
|
||||
lumiera::error::assertion_terminate (CIN_NOBUG_LOCATION);
|
||||
#endif
|
||||
|
||||
|
||||
#endif // CINELERRA_ERROR_HPP_
|
||||
#endif // LUMIERA_ERROR_HPP_
|
||||
|
|
|
|||
|
|
@ -21,14 +21,14 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef CINELERRA_FACTORY_H
|
||||
#define CINELERRA_FACTORY_H
|
||||
#ifndef LUMIERA_FACTORY_H
|
||||
#define LUMIERA_FACTORY_H
|
||||
|
||||
#include <tr1/memory>
|
||||
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace factory
|
||||
{
|
||||
|
|
@ -141,5 +141,5 @@ namespace cinelerra
|
|||
using factory::Factory;
|
||||
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -23,21 +23,21 @@
|
|||
|
||||
|
||||
|
||||
#ifndef CINELERRA_MULTITHREAD_H
|
||||
#define CINELERRA_MULTITHREAD_H
|
||||
#ifndef LUMIERA_MULTITHREAD_H
|
||||
#define LUMIERA_MULTITHREAD_H
|
||||
|
||||
#include "nobugcfg.h"
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
|
||||
/**
|
||||
* Interface/Policy for managing parallelism issues.
|
||||
* Basically everything is forwarded to the corresponding backend functions,
|
||||
* because managing threads and locking belongs to the cinelerra backend layer.
|
||||
* because managing threads and locking belongs to the Lumiera backend layer.
|
||||
*
|
||||
* @todo actually implement this policy using the cinelerra databackend.
|
||||
* @todo actually implement this policy using the Lumiera databackend.
|
||||
*/
|
||||
struct Thread
|
||||
{
|
||||
|
|
@ -52,5 +52,5 @@ namespace cinelerra
|
|||
};
|
||||
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
** e.g. sometimes we want to include a hook for injecting Test Mock instances.
|
||||
**
|
||||
** You'll find the default Policies in singletonfactory.hpp and the default
|
||||
** definition of type cinelerra::singleton in singletonpreconfigure.hpp
|
||||
** definition of type lumiera::singleton in singletonpreconfigure.hpp
|
||||
**
|
||||
** @see SingletonFactory
|
||||
** @see singleton::StaticCreate
|
||||
|
|
@ -40,8 +40,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef CINELERRA_SINGLETON_H
|
||||
#define CINELERRA_SINGLETON_H
|
||||
#ifndef LUMIERA_SINGLETON_H
|
||||
#define LUMIERA_SINGLETON_H
|
||||
|
||||
|
||||
#include "common/singletonpolicies.hpp"
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ This code is heavily inspired by
|
|||
|
||||
|
||||
|
||||
#ifndef CINELERRA_SINGLETONFACTORY_H
|
||||
#define CINELERRA_SINGLETONFACTORY_H
|
||||
#ifndef LUMIERA_SINGLETONFACTORY_H
|
||||
#define LUMIERA_SINGLETONFACTORY_H
|
||||
|
||||
|
||||
#include "common/singletonpolicies.hpp" ///< several Policies usable together with SingletonFactory
|
||||
|
|
@ -43,7 +43,7 @@ This code is heavily inspired by
|
|||
//#include <boost/bind.hpp>
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
|
||||
/**
|
||||
|
|
@ -136,5 +136,5 @@ namespace cinelerra
|
|||
///// It seems this would either cost us much of the flexibility or get complicated
|
||||
///// to a point where we could as well implement our own Depenency Injection Manager.
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ This code is heavily inspired by
|
|||
|
||||
|
||||
|
||||
#ifndef CINELERRA_SINGLETONPOLICIES_H
|
||||
#define CINELERRA_SINGLETONPOLICIES_H
|
||||
#ifndef LUMIERA_SINGLETONPOLICIES_H
|
||||
#define LUMIERA_SINGLETONPOLICIES_H
|
||||
|
||||
#include "common/multithread.hpp"
|
||||
#include "common/error.hpp"
|
||||
|
|
@ -40,11 +40,11 @@ This code is heavily inspired by
|
|||
#include <vector>
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace singleton
|
||||
{
|
||||
/* == several Policies usable in conjunction with cinelerra::Singleton == */
|
||||
/* === several Policies usable in conjunction with lumiera::Singleton === */
|
||||
|
||||
/**
|
||||
* Policy placing the Singleton instance into a statically allocated buffer
|
||||
|
|
@ -133,13 +133,13 @@ namespace cinelerra
|
|||
|
||||
/**
|
||||
* Policy for handling multithreaded access to the singleton instance
|
||||
* @todo actually implement this policy using the cinelerra databackend.
|
||||
* @todo actually implement this policy using the Lumiera databackend.
|
||||
*/
|
||||
template<class S>
|
||||
struct Multithreaded
|
||||
{
|
||||
typedef volatile S VolatileType;
|
||||
typedef cinelerra::Thread::Lock<S> Lock;
|
||||
typedef lumiera::Thread::Lock<S> Lock;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -156,5 +156,5 @@ namespace cinelerra
|
|||
|
||||
} // namespace singleton
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
** One reason why one wants special Singleton behaviour is testing: Without
|
||||
** altering the executable, for running some tests we need to inject a Test Mock
|
||||
** in place of some service object, so we can verify the behaviour of the code
|
||||
** <i>using</i> this service. For this, we mix cinelerra::test::MockInjector
|
||||
** <i>using</i> this service. For this, we mix lumiera::test::MockInjector
|
||||
** into the actual Singleton type.
|
||||
**
|
||||
** @note we declare the specialisations into the target namespace
|
||||
|
|
@ -41,13 +41,13 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef CINELERRA_SINGLETONPRECONFIGURE_H
|
||||
#define CINELERRA_SINGLETONPRECONFIGURE_H
|
||||
#ifndef LUMIERA_SINGLETONPRECONFIGURE_H
|
||||
#define LUMIERA_SINGLETONPRECONFIGURE_H
|
||||
|
||||
#include "common/test/mockinjector.hpp"
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
/**
|
||||
* Default Singleton configuration
|
||||
|
|
@ -67,15 +67,15 @@ namespace cinelerra
|
|||
namespace test
|
||||
{
|
||||
class TestSingletonO;
|
||||
using cinelerra::Singleton;
|
||||
using lumiera::Singleton;
|
||||
|
||||
} // namespace test
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
||||
namespace backend_interface
|
||||
{
|
||||
class MediaAccessFacade;
|
||||
using cinelerra::Singleton;
|
||||
using lumiera::Singleton;
|
||||
|
||||
} // namespace backend_interface
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ namespace backend_interface
|
|||
/* Specialisation Definitions */
|
||||
/* ************************** */
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
|
||||
using test::MockInjector;
|
||||
|
|
@ -104,7 +104,7 @@ namespace cinelerra
|
|||
: public MockInjector<backend_interface::MediaAccessFacade>
|
||||
{ };
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
|
||||
|
||||
#ifndef CINELERRA_TEST_MOCKINJECTOR_H
|
||||
#define CINELERRA_TEST_MOCKINJECTOR_H
|
||||
#ifndef LUMIERA_TEST_MOCKINJECTOR_H
|
||||
#define LUMIERA_TEST_MOCKINJECTOR_H
|
||||
|
||||
|
||||
#include "common/singletonfactory.hpp"
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace test
|
||||
{
|
||||
|
|
@ -90,5 +90,5 @@ namespace cinelerra
|
|||
|
||||
} // namespace test
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ namespace test
|
|||
TRACE(test, "Test-Suite( groupID=%s )\n", groupID.c_str () );
|
||||
|
||||
if (!testcases.getGroup(groupID))
|
||||
throw cinelerra::error::Invalid ();
|
||||
throw lumiera::error::Invalid ();
|
||||
//throw "empty testsuite"; /////////// TODO Errorhandling!
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ namespace test
|
|||
{
|
||||
PTestMap tests = testcases.getGroup(groupID_);
|
||||
if (!tests)
|
||||
throw cinelerra::error::Invalid (); ///////// TODO: pass error description
|
||||
throw lumiera::error::Invalid (); ///////// TODO: pass error description
|
||||
|
||||
if (0 < cmdline.size())
|
||||
{
|
||||
|
|
@ -209,7 +209,7 @@ namespace test
|
|||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cout << "PLANNED ============= " << cinelerra_error() << "\n";
|
||||
std::cout << "PLANNED ============= " << lumiera_error() << "\n";
|
||||
}
|
||||
std::cout << "END\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include <limits>
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
|
||||
// TODO: dummy values; should be adjusted when switching to the real time implementation provided by the backend
|
||||
|
|
@ -34,4 +34,4 @@ namespace cinelerra
|
|||
const Time Time::MIN = -std::numeric_limits<long>::max();
|
||||
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
|
|
|||
|
|
@ -21,13 +21,13 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef CINELERRA_TIME_H
|
||||
#define CINELERRA_TIME_H
|
||||
#ifndef LUMIERA_TIME_H
|
||||
#define LUMIERA_TIME_H
|
||||
|
||||
#include <boost/operators.hpp>
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
|
||||
|
||||
|
|
@ -56,5 +56,5 @@ namespace cinelerra
|
|||
|
||||
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -47,19 +47,19 @@ This code is heavily inspired by
|
|||
**
|
||||
** Interface for using this facility is the template Types(.....) for up to 20 Type parameters
|
||||
**
|
||||
** @see cinelerra::visitor::Applicable usage example
|
||||
** @see lumiera::visitor::Applicable usage example
|
||||
** @see typelisttest.cpp
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CINELERRA_TYPELIST_H
|
||||
#define CINELERRA_TYPELIST_H
|
||||
#ifndef LUMIERA_TYPELIST_H
|
||||
#define LUMIERA_TYPELIST_H
|
||||
|
||||
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace typelist
|
||||
{
|
||||
|
|
@ -116,5 +116,5 @@ namespace cinelerra
|
|||
|
||||
} // namespace typelist
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "common/visitor.hpp"
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace visitor
|
||||
{
|
||||
|
|
@ -32,4 +32,4 @@ namespace cinelerra
|
|||
|
||||
} // namespace visitor
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ Credits for many further implementation ideas go to
|
|||
|
||||
/** @file visitor.hpp
|
||||
** A library implementation of the <b>Visitor Pattern</b> taylored specifically
|
||||
** to cinelerra's needs within the Proc Layer. Visitor enables <b>double dispatch</b>
|
||||
** to Lumiera's needs within the Proc Layer. Visitor enables <b>double dispatch</b>
|
||||
** calls, based both on the concrete type of some target object and the concrete type of
|
||||
** a tool object being applied to this target. The code carrying out this tool application
|
||||
** (and thus triggering the double dispatch) need not know any of these concret types and is
|
||||
|
|
@ -73,8 +73,8 @@ Credits for many further implementation ideas go to
|
|||
|
||||
|
||||
|
||||
#ifndef CINELERRA_VISITOR_H
|
||||
#define CINELERRA_VISITOR_H
|
||||
#ifndef LUMIERA_VISITOR_H
|
||||
#define LUMIERA_VISITOR_H
|
||||
|
||||
#include "common/visitorpolicies.hpp"
|
||||
#include "common/visitordispatcher.hpp"
|
||||
|
|
@ -82,7 +82,7 @@ Credits for many further implementation ideas go to
|
|||
#include "common/typelist.hpp"
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace visitor
|
||||
{
|
||||
|
|
@ -229,5 +229,5 @@ namespace cinelerra
|
|||
|
||||
} // namespace visitor
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
|
||||
|
||||
#ifndef CINELERRA_VISITORDISPATCHER_H
|
||||
#define CINELERRA_VISITORDISPATCHER_H
|
||||
#ifndef LUMIERA_VISITORDISPATCHER_H
|
||||
#define LUMIERA_VISITORDISPATCHER_H
|
||||
|
||||
#include "common/error.hpp"
|
||||
#include "common/util.hpp"
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
#include <vector>
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace visitor
|
||||
{
|
||||
|
|
@ -211,5 +211,5 @@ namespace cinelerra
|
|||
|
||||
} // namespace visitor
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -22,20 +22,20 @@
|
|||
|
||||
|
||||
/** @file visitorpolicies.hpp
|
||||
** Policies usable for configuring the cinelerra::visitor::Tool for different kinds of error handling.
|
||||
** Policies usable for configuring the lumiera::visitor::Tool for different kinds of error handling.
|
||||
** @see buildertool.hpp for another flavor (calling and catch-all-function)
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef CINELERRA_VISITORPOLICIES_H
|
||||
#define CINELERRA_VISITORPOLICIES_H
|
||||
#ifndef LUMIERA_VISITORPOLICIES_H
|
||||
#define LUMIERA_VISITORPOLICIES_H
|
||||
|
||||
#include "common/error.hpp"
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace visitor
|
||||
{
|
||||
|
|
@ -65,7 +65,7 @@ namespace cinelerra
|
|||
RET
|
||||
onUnknown (TAR&)
|
||||
{
|
||||
throw cinelerra::error::Config("unable to decide what tool operation to call");
|
||||
throw lumiera::error::Config("unable to decide what tool operation to call");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -73,5 +73,5 @@ namespace cinelerra
|
|||
|
||||
} // namespace visitor
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@
|
|||
* @param self is a pointer to the condition variable to be initialized
|
||||
* @return self as given
|
||||
*/
|
||||
CinelerraCondition
|
||||
cinelerra_condition_init (CinelerraCondition self)
|
||||
LumieraCondition
|
||||
lumiera_condition_init (LumieraCondition self)
|
||||
{
|
||||
if (self)
|
||||
{
|
||||
|
|
@ -47,15 +47,15 @@ cinelerra_condition_init (CinelerraCondition self)
|
|||
* @param self is a pointer to the condition variable to be destroyed
|
||||
* @return self as given
|
||||
*/
|
||||
CinelerraCondition
|
||||
cinelerra_condition_destroy (CinelerraCondition self)
|
||||
LumieraCondition
|
||||
lumiera_condition_destroy (LumieraCondition self)
|
||||
{
|
||||
if (self)
|
||||
{
|
||||
if (pthread_mutex_destroy (&self->mutex))
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
else if (pthread_cond_destroy (&self->cond))
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef CINELERRA_CONDITION_H
|
||||
#define CINELERRA_CONDITION_H
|
||||
#ifndef LUMIERA_CONDITION_H
|
||||
#define LUMIERA_CONDITION_H
|
||||
|
||||
#include "lib/locking.h"
|
||||
|
||||
|
|
@ -33,21 +33,21 @@
|
|||
* Condition variables.
|
||||
*
|
||||
*/
|
||||
struct cinelerra_condition_struct
|
||||
struct lumiera_condition_struct
|
||||
{
|
||||
pthread_cond_t cond;
|
||||
pthread_mutex_t mutex;
|
||||
};
|
||||
typedef struct cinelerra_condition_struct cinelerra_condition;
|
||||
typedef cinelerra_condition* CinelerraCondition;
|
||||
typedef struct lumiera_condition_struct lumiera_condition;
|
||||
typedef lumiera_condition* LumieraCondition;
|
||||
|
||||
|
||||
CinelerraCondition
|
||||
cinelerra_condition_init (CinelerraCondition self);
|
||||
LumieraCondition
|
||||
lumiera_condition_init (LumieraCondition self);
|
||||
|
||||
|
||||
CinelerraCondition
|
||||
cinelerra_condition_destroy (CinelerraCondition self);
|
||||
LumieraCondition
|
||||
lumiera_condition_destroy (LumieraCondition self);
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -55,14 +55,14 @@ cinelerra_condition_destroy (CinelerraCondition self);
|
|||
* @param self condition variable to be signaled, must be given, all errors are fatal
|
||||
*/
|
||||
static inline void
|
||||
cinelerra_condition_signal (CinelerraCondition self)
|
||||
lumiera_condition_signal (LumieraCondition self)
|
||||
{
|
||||
REQUIRE (self);
|
||||
if (pthread_mutex_lock (&self->mutex))
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
pthread_cond_signal (&self->cond);
|
||||
if (pthread_mutex_unlock (&self->mutex))
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -70,14 +70,14 @@ cinelerra_condition_signal (CinelerraCondition self)
|
|||
* @param self condition variable to be signaled, must be given, all errors are fatal
|
||||
*/
|
||||
static inline void
|
||||
cinelerra_condition_broadcast (CinelerraCondition self)
|
||||
lumiera_condition_broadcast (LumieraCondition self)
|
||||
{
|
||||
REQUIRE (self);
|
||||
if (pthread_mutex_lock (&self->mutex))
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
pthread_cond_broadcast (&self->cond);
|
||||
if (pthread_mutex_unlock (&self->mutex))
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -87,44 +87,44 @@ cinelerra_condition_broadcast (CinelerraCondition self)
|
|||
/**
|
||||
* conditionacquirer used to manage the state of a condition variable.
|
||||
*/
|
||||
struct cinelerra_conditionacquirer_struct
|
||||
struct lumiera_conditionacquirer_struct
|
||||
{
|
||||
CinelerraCondition cond;
|
||||
enum cinelerra_lockstate state;
|
||||
LumieraCondition cond;
|
||||
enum lumiera_lockstate state;
|
||||
};
|
||||
typedef struct cinelerra_conditionacquirer_struct cinelerra_conditionacquirer;
|
||||
typedef struct cinelerra_conditionacquirer_struct* CinelerraConditionacquirer;
|
||||
typedef struct lumiera_conditionacquirer_struct lumiera_conditionacquirer;
|
||||
typedef struct lumiera_conditionacquirer_struct* LumieraConditionacquirer;
|
||||
|
||||
/* helper function for nobug */
|
||||
static inline void
|
||||
cinelerra_conditionacquirer_ensureunlocked (CinelerraConditionacquirer self)
|
||||
lumiera_conditionacquirer_ensureunlocked (LumieraConditionacquirer self)
|
||||
{
|
||||
ENSURE (self->state == CINELERRA_UNLOCKED, "forgot to unlock the condition mutex");
|
||||
ENSURE (self->state == LUMIERA_UNLOCKED, "forgot to unlock the condition mutex");
|
||||
}
|
||||
|
||||
/* override with a macro to use the cleanup checker */
|
||||
#define cinelerra_conditionacquirer \
|
||||
cinelerra_conditionacquirer NOBUG_CLEANUP(cinelerra_conditionacquirer_ensureunlocked)
|
||||
#define lumiera_conditionacquirer \
|
||||
lumiera_conditionacquirer NOBUG_CLEANUP(lumiera_conditionacquirer_ensureunlocked)
|
||||
|
||||
|
||||
/**
|
||||
* initialize a conditionacquirer state
|
||||
* @param self conditionacquirer to be initialized, must be an automatic variable
|
||||
* @param cond associated condition variable
|
||||
* @param state initial state of the mutex, either CINELERRA_LOCKED or CINELERRA_UNLOCKED
|
||||
* @param state initial state of the mutex, either LUMIERA_LOCKED or LUMIERA_UNLOCKED
|
||||
* @return self as given
|
||||
* errors are fatal
|
||||
*/
|
||||
static inline CinelerraConditionacquirer
|
||||
cinelerra_conditionacquirer_init (CinelerraConditionacquirer self, CinelerraCondition cond, enum cinelerra_lockstate state)
|
||||
static inline LumieraConditionacquirer
|
||||
lumiera_conditionacquirer_init (LumieraConditionacquirer self, LumieraCondition cond, enum lumiera_lockstate state)
|
||||
{
|
||||
REQUIRE (self);
|
||||
REQUIRE (cond);
|
||||
self->cond = cond;
|
||||
self->state = state;
|
||||
if (state == CINELERRA_LOCKED)
|
||||
if (state == LUMIERA_LOCKED)
|
||||
if (pthread_mutex_lock (&cond->mutex))
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
|
@ -135,15 +135,15 @@ cinelerra_conditionacquirer_init (CinelerraConditionacquirer self, CinelerraCond
|
|||
* @param self conditionacquirer associated with a condition variable
|
||||
*/
|
||||
static inline void
|
||||
cinelerra_conditionacquirer_lock (CinelerraConditionacquirer self)
|
||||
lumiera_conditionacquirer_lock (LumieraConditionacquirer self)
|
||||
{
|
||||
REQUIRE (self);
|
||||
REQUIRE (self->state == CINELERRA_UNLOCKED, "mutex already locked");
|
||||
REQUIRE (self->state == LUMIERA_UNLOCKED, "mutex already locked");
|
||||
|
||||
if (pthread_mutex_lock (&self->cond->mutex))
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
|
||||
self->state = CINELERRA_LOCKED;
|
||||
self->state = LUMIERA_LOCKED;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -153,10 +153,10 @@ cinelerra_conditionacquirer_lock (CinelerraConditionacquirer self)
|
|||
* @param self conditionacquirer associated with a condition variable
|
||||
*/
|
||||
static inline void
|
||||
cinelerra_conditionacquirer_wait (CinelerraConditionacquirer self)
|
||||
lumiera_conditionacquirer_wait (LumieraConditionacquirer self)
|
||||
{
|
||||
REQUIRE (self);
|
||||
REQUIRE (self->state == CINELERRA_LOCKED, "mutex must be locked");
|
||||
REQUIRE (self->state == LUMIERA_LOCKED, "mutex must be locked");
|
||||
pthread_cond_wait (&self->cond->cond, &self->cond->mutex);
|
||||
}
|
||||
|
||||
|
|
@ -167,13 +167,13 @@ cinelerra_conditionacquirer_wait (CinelerraConditionacquirer self)
|
|||
* @param self conditionacquirer associated with a condition variable
|
||||
*/
|
||||
static inline int
|
||||
cinelerra_conditionacquirer_unlock (CinelerraConditionacquirer self)
|
||||
lumiera_conditionacquirer_unlock (LumieraConditionacquirer self)
|
||||
{
|
||||
REQUIRE (self);
|
||||
REQUIRE (self->state == CINELERRA_LOCKED, "mutex was not locked");
|
||||
REQUIRE (self->state == LUMIERA_LOCKED, "mutex was not locked");
|
||||
if (pthread_mutex_unlock (&self->cond->mutex))
|
||||
CINELERRA_DIE;
|
||||
self->state = CINELERRA_UNLOCKED;
|
||||
LUMIERA_DIE;
|
||||
self->state = LUMIERA_UNLOCKED;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -182,10 +182,10 @@ cinelerra_conditionacquirer_unlock (CinelerraConditionacquirer self)
|
|||
* @param self conditionacquirer associated with the condition variable to be signaled
|
||||
*/
|
||||
static inline void
|
||||
cinelerra_conditionacquirer_signal (CinelerraConditionacquirer self)
|
||||
lumiera_conditionacquirer_signal (LumieraConditionacquirer self)
|
||||
{
|
||||
REQUIRE (self);
|
||||
REQUIRE (self->state == CINELERRA_LOCKED, "mutex was not locked");
|
||||
REQUIRE (self->state == LUMIERA_LOCKED, "mutex was not locked");
|
||||
pthread_cond_signal (&self->cond->cond);
|
||||
}
|
||||
|
||||
|
|
@ -195,10 +195,10 @@ cinelerra_conditionacquirer_signal (CinelerraConditionacquirer self)
|
|||
* @param self conditionacquirer associated with the condition variable to be signaled
|
||||
*/
|
||||
static inline int
|
||||
cinelerra_conditionacquirer_broadcast (CinelerraConditionacquirer self)
|
||||
lumiera_conditionacquirer_broadcast (LumieraConditionacquirer self)
|
||||
{
|
||||
REQUIRE (self);
|
||||
REQUIRE (self->state == CINELERRA_LOCKED, "mutex was not locked");
|
||||
REQUIRE (self->state == LUMIERA_LOCKED, "mutex was not locked");
|
||||
pthread_cond_broadcast (&self->cond->cond);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
error.c - Cinelerra Error handling
|
||||
error.c - Lumiera Error handling
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Christian Thaeter <ct@pipapo.org>
|
||||
|
|
@ -24,41 +24,41 @@
|
|||
#include "lib/error.h"
|
||||
|
||||
/**
|
||||
* @file C Error handling in Cinelerra.
|
||||
* @file C Error handling in Lumiera.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
predefined errors
|
||||
*/
|
||||
CINELERRA_ERROR_DEFINE (ERRNO, "errno");
|
||||
LUMIERA_ERROR_DEFINE (ERRNO, "errno");
|
||||
|
||||
|
||||
/* Thread local storage */
|
||||
static pthread_key_t cinelerra_error_tls;
|
||||
static pthread_once_t cinelerra_error_initialized = PTHREAD_ONCE_INIT;
|
||||
static pthread_key_t lumiera_error_tls;
|
||||
static pthread_once_t lumiera_error_initialized = PTHREAD_ONCE_INIT;
|
||||
|
||||
static void
|
||||
cinelerra_error_tls_init (void)
|
||||
lumiera_error_tls_init (void)
|
||||
{
|
||||
pthread_key_create (&cinelerra_error_tls, NULL);
|
||||
pthread_key_create (&lumiera_error_tls, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set error state for the current thread.
|
||||
* If the error state of the current thread was cleared, then set it, else preserve the old state.
|
||||
* @param nerr name of the error with 'CINELERRA_ERROR_' prefix (example: CINELERRA_ERROR_NO_MEMORY)
|
||||
* @param nerr name of the error with 'LUMIERA_ERROR_' prefix (example: LUMIERA_ERROR_NO_MEMORY)
|
||||
* @return old state, that is NULL for success, when the state was cleared and a pointer to a pending
|
||||
* error when the error state was already set
|
||||
*/
|
||||
const char*
|
||||
cinelerra_error_set (const char * nerr)
|
||||
lumiera_error_set (const char * nerr)
|
||||
{
|
||||
pthread_once (&cinelerra_error_initialized, cinelerra_error_tls_init);
|
||||
pthread_once (&lumiera_error_initialized, lumiera_error_tls_init);
|
||||
|
||||
const char* err = pthread_getspecific (cinelerra_error_tls);
|
||||
const char* err = pthread_getspecific (lumiera_error_tls);
|
||||
if (!err)
|
||||
pthread_setspecific (cinelerra_error_tls, nerr);
|
||||
pthread_setspecific (lumiera_error_tls, nerr);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
@ -71,12 +71,12 @@ cinelerra_error_set (const char * nerr)
|
|||
* @return pointer to any pending error of this thread, NULL if no error is pending
|
||||
*/
|
||||
const char*
|
||||
cinelerra_error ()
|
||||
lumiera_error ()
|
||||
{
|
||||
pthread_once (&cinelerra_error_initialized, cinelerra_error_tls_init);
|
||||
pthread_once (&lumiera_error_initialized, lumiera_error_tls_init);
|
||||
|
||||
const char* err = pthread_getspecific (cinelerra_error_tls);
|
||||
const char* err = pthread_getspecific (lumiera_error_tls);
|
||||
if (err)
|
||||
pthread_setspecific (cinelerra_error_tls, NULL);
|
||||
pthread_setspecific (lumiera_error_tls, NULL);
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
error.h - Cinelerra Error handling
|
||||
error.h - Lumiera Error handling
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Christian Thaeter <ct@pipapo.org>
|
||||
|
|
@ -18,8 +18,8 @@
|
|||
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
|
||||
#ifndef LUMIERA_ERROR_H
|
||||
#define LUMIERA_ERROR_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
@ -31,7 +31,7 @@ extern "C" {
|
|||
#include <stdlib.h>
|
||||
|
||||
/**
|
||||
* @file C Error handling in Cinelerra, header.
|
||||
* @file C Error handling in Lumiera, header.
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -39,46 +39,46 @@ extern "C" {
|
|||
* Abort unconditionally with a 'Fatal Error!' message.
|
||||
* This macro is used whenever the program end up in a invalid state from which no runtime recovery is possible
|
||||
*/
|
||||
#define CINELERRA_DIE do { NOBUG_ERROR(NOBUG_ON, "Fatal Error!"); abort(); } while(0)
|
||||
#define LUMIERA_DIE do { NOBUG_ERROR(NOBUG_ON, "Fatal Error!"); abort(); } while(0)
|
||||
|
||||
/**
|
||||
* Forward declare an error constant.
|
||||
* This macro eases the error declaration in header files
|
||||
* @param err name of the error without the 'CINELERRA_ERROR_' prefix (example: NO_MEMORY)
|
||||
* @param err name of the error without the 'LUMIERA_ERROR_' prefix (example: NO_MEMORY)
|
||||
*/
|
||||
#define CINELERRA_ERROR_DECLARE(err) \
|
||||
extern const char* CINELERRA_ERROR_##err
|
||||
#define LUMIERA_ERROR_DECLARE(err) \
|
||||
extern const char* LUMIERA_ERROR_##err
|
||||
|
||||
/**
|
||||
* Definition and initialization of an error constant.
|
||||
* This macro eases the error definition in implementation files
|
||||
* @param err name of the error without the 'CINELERRA_ERROR_' prefix (example: NO_MEMORY)
|
||||
* @param err name of the error without the 'LUMIERA_ERROR_' prefix (example: NO_MEMORY)
|
||||
* @param msg message describing the error in plain english (example: "memory allocation failed")
|
||||
*/
|
||||
#define CINELERRA_ERROR_DEFINE(err, msg) \
|
||||
const char* CINELERRA_ERROR_##err = "CINELERRA_ERROR_" #err ":" msg
|
||||
#define LUMIERA_ERROR_DEFINE(err, msg) \
|
||||
const char* LUMIERA_ERROR_##err = "LUMIERA_ERROR_" #err ":" msg
|
||||
|
||||
/** Helper macro to raise an error for the current thread.
|
||||
* This macro eases setting an error. It adds NoBug logging support to the low level error handling.
|
||||
* @param flag NoBug flag describing the subsystem where the error was raised
|
||||
* @param err name of the error without the 'CINELERRA_ERROR_' prefix (example: NO_MEMORY)
|
||||
* @param err name of the error without the 'LUMIERA_ERROR_' prefix (example: NO_MEMORY)
|
||||
*/
|
||||
#define CINELERRA_ERROR_SET(flag, err) \
|
||||
(({ERROR (flag, "%s", strchr(CINELERRA_ERROR_##err, ':')+1);}), \
|
||||
cinelerra_error_set(CINELERRA_ERROR_##err))
|
||||
#define LUMIERA_ERROR_SET(flag, err) \
|
||||
(({ERROR (flag, "%s", strchr(LUMIERA_ERROR_##err, ':')+1);}), \
|
||||
lumiera_error_set(LUMIERA_ERROR_##err))
|
||||
|
||||
const char*
|
||||
cinelerra_error_set (const char * err);
|
||||
lumiera_error_set (const char * err);
|
||||
|
||||
const char*
|
||||
cinelerra_error ();
|
||||
lumiera_error ();
|
||||
|
||||
/*
|
||||
predefined errors
|
||||
*/
|
||||
CINELERRA_ERROR_DECLARE (ERRNO);
|
||||
LUMIERA_ERROR_DECLARE (ERRNO);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
#endif /* CINELERRA_ERROR_H */
|
||||
#endif /* LUMIERA_ERROR_H */
|
||||
|
|
|
|||
|
|
@ -26,5 +26,5 @@
|
|||
*/
|
||||
|
||||
|
||||
CINELERRA_ERROR_DEFINE(FRAMERATE_ILLEGAL_TIME, "invalid time given");
|
||||
CINELERRA_ERROR_DEFINE(FRAMERATE_ILLEGAL_FRAME, "invalid frame given");
|
||||
LUMIERA_ERROR_DEFINE(FRAMERATE_ILLEGAL_TIME, "invalid time given");
|
||||
LUMIERA_ERROR_DEFINE(FRAMERATE_ILLEGAL_FRAME, "invalid frame given");
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef CINELERRA_FRAMERATE_H
|
||||
#define CINELERRA_FRAMERATE_H
|
||||
#ifndef LUMIERA_FRAMERATE_H
|
||||
#define LUMIERA_FRAMERATE_H
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
|
|
@ -36,37 +36,37 @@
|
|||
* framerates are defined as a rational number
|
||||
* for example NTSC with 30000/1001fps
|
||||
*/
|
||||
struct cinelerra_framerate_struct
|
||||
struct lumiera_framerate_struct
|
||||
{
|
||||
unsigned n; //numerator
|
||||
unsigned d; //denominator
|
||||
};
|
||||
|
||||
typedef struct cinelerra_framerate_struct cinelerra_framerate;
|
||||
typedef cinelerra_framerate* CinelerraFramerate;
|
||||
typedef struct lumiera_framerate_struct lumiera_framerate;
|
||||
typedef lumiera_framerate* LumieraFramerate;
|
||||
|
||||
typedef signed long cinelerra_framepos;
|
||||
typedef signed long lumiera_framepos;
|
||||
|
||||
CINELERRA_ERROR_DECLARE(FRAMERATE_ILLEGAL_TIME);
|
||||
CINELERRA_ERROR_DECLARE(FRAMERATE_ILLEGAL_FRAME);
|
||||
LUMIERA_ERROR_DECLARE(FRAMERATE_ILLEGAL_TIME);
|
||||
LUMIERA_ERROR_DECLARE(FRAMERATE_ILLEGAL_FRAME);
|
||||
|
||||
#define CINELERRA_FRAMEPOS_ERROR LONG_MIN
|
||||
#define LUMIERA_FRAMEPOS_ERROR LONG_MIN
|
||||
|
||||
/**
|
||||
* Get the frame number of a given time at a given frame rate.
|
||||
* frame indexing starts with 1
|
||||
* @param framerate is a pointer to the framerate used, defined as rational number. Must be given.
|
||||
* @param time is a pointer to a cinelerra_time which shall be converted.
|
||||
* @return frame at the given time or CINELERRA_FRAMEPOS_ERROR on error.
|
||||
* @param time is a pointer to a lumiera_time which shall be converted.
|
||||
* @return frame at the given time or LUMIERA_FRAMEPOS_ERROR on error.
|
||||
*/
|
||||
static inline cinelerra_framepos
|
||||
cinelerra_framerate_frame_get_time (const CinelerraFramerate framerate, CinelerraTime time)
|
||||
static inline lumiera_framepos
|
||||
lumiera_framerate_frame_get_time (const LumieraFramerate framerate, LumieraTime time)
|
||||
{
|
||||
REQUIRE (framerate);
|
||||
if (!time || time->tv_sec == (time_t)-1)
|
||||
{
|
||||
cinelerra_error_set(CINELERRA_ERROR_FRAMERATE_ILLEGAL_TIME);
|
||||
return CINELERRA_FRAMEPOS_ERROR;
|
||||
lumiera_error_set(LUMIERA_ERROR_FRAMERATE_ILLEGAL_TIME);
|
||||
return LUMIERA_FRAMEPOS_ERROR;
|
||||
}
|
||||
|
||||
/* we add a magic microsecond for rounding, because of integer truncation frames may be calculated at most 1us earlier,
|
||||
|
|
@ -79,21 +79,21 @@ cinelerra_framerate_frame_get_time (const CinelerraFramerate framerate, Cinelerr
|
|||
* Get the start time for a frame.
|
||||
* frame indexing starts with 1
|
||||
* @param framerate is a pointer to the framerate used, defined as rational number. Must be given.
|
||||
* @param time is a pointer to a cinelerra_time which shall take the result.
|
||||
* @param time is a pointer to a lumiera_time which shall take the result.
|
||||
* @param frame frame number to be converted to time. This frame number must be greater than 0.
|
||||
* @return the pointer given in time or NULL on error (or when it was given as time).
|
||||
*/
|
||||
static inline CinelerraTime
|
||||
cinelerra_framerate_time_get_time_frame (const CinelerraFramerate framerate,
|
||||
CinelerraTime time,
|
||||
cinelerra_framepos frame)
|
||||
static inline LumieraTime
|
||||
lumiera_framerate_time_get_time_frame (const LumieraFramerate framerate,
|
||||
LumieraTime time,
|
||||
lumiera_framepos frame)
|
||||
{
|
||||
REQUIRE (framerate);
|
||||
if (time)
|
||||
{
|
||||
if (frame < 1)
|
||||
{
|
||||
cinelerra_error_set(CINELERRA_ERROR_FRAMERATE_ILLEGAL_FRAME);
|
||||
lumiera_error_set(LUMIERA_ERROR_FRAMERATE_ILLEGAL_FRAME);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef CINELERRA_LOCKING_H
|
||||
#define CINELERRA_LOCKING_H
|
||||
#ifndef LUMIERA_LOCKING_H
|
||||
#define LUMIERA_LOCKING_H
|
||||
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
|
|
@ -37,12 +37,12 @@
|
|||
*
|
||||
*
|
||||
*/
|
||||
enum cinelerra_lockstate
|
||||
enum lumiera_lockstate
|
||||
{
|
||||
CINELERRA_UNLOCKED,
|
||||
CINELERRA_LOCKED,
|
||||
CINELERRA_RDLOCKED,
|
||||
CINELERRA_WRLOCKED
|
||||
LUMIERA_UNLOCKED,
|
||||
LUMIERA_LOCKED,
|
||||
LUMIERA_RDLOCKED,
|
||||
LUMIERA_WRLOCKED
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@
|
|||
* @param self is a pointer to the mutex to be initialized
|
||||
* @return self as given
|
||||
*/
|
||||
CinelerraMutex
|
||||
cinelerra_mutex_init (CinelerraMutex self)
|
||||
LumieraMutex
|
||||
lumiera_mutex_init (LumieraMutex self)
|
||||
{
|
||||
if (self)
|
||||
{
|
||||
|
|
@ -46,13 +46,13 @@ cinelerra_mutex_init (CinelerraMutex self)
|
|||
* @param self is a pointer to the mutex to be destroyed
|
||||
* @return self as given
|
||||
*/
|
||||
CinelerraMutex
|
||||
cinelerra_mutex_destroy (CinelerraMutex self)
|
||||
LumieraMutex
|
||||
lumiera_mutex_destroy (LumieraMutex self)
|
||||
{
|
||||
if (self)
|
||||
{
|
||||
if (pthread_mutex_destroy (&self->mutex))
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef CINELERRA_MUTEX_H
|
||||
#define CINELERRA_MUTEX_H
|
||||
#ifndef LUMIERA_MUTEX_H
|
||||
#define LUMIERA_MUTEX_H
|
||||
|
||||
#include "lib/locking.h"
|
||||
|
||||
|
|
@ -33,58 +33,58 @@
|
|||
* Mutex.
|
||||
*
|
||||
*/
|
||||
struct cinelerra_mutex_struct
|
||||
struct lumiera_mutex_struct
|
||||
{
|
||||
pthread_mutex_t mutex;
|
||||
};
|
||||
typedef struct cinelerra_mutex_struct cinelerra_mutex;
|
||||
typedef cinelerra_mutex* CinelerraMutex;
|
||||
typedef struct lumiera_mutex_struct lumiera_mutex;
|
||||
typedef lumiera_mutex* LumieraMutex;
|
||||
|
||||
|
||||
CinelerraMutex
|
||||
cinelerra_mutex_init (CinelerraMutex self);
|
||||
LumieraMutex
|
||||
lumiera_mutex_init (LumieraMutex self);
|
||||
|
||||
|
||||
CinelerraMutex
|
||||
cinelerra_mutex_destroy (CinelerraMutex self);
|
||||
LumieraMutex
|
||||
lumiera_mutex_destroy (LumieraMutex self);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* mutexacquirer used to manage the state of a mutex variable.
|
||||
*/
|
||||
struct cinelerra_mutexacquirer_struct
|
||||
struct lumiera_mutexacquirer_struct
|
||||
{
|
||||
CinelerraMutex mutex;
|
||||
enum cinelerra_lockstate state;
|
||||
LumieraMutex mutex;
|
||||
enum lumiera_lockstate state;
|
||||
};
|
||||
typedef struct cinelerra_mutexacquirer_struct cinelerra_mutexacquirer;
|
||||
typedef struct cinelerra_mutexacquirer_struct* CinelerraMutexacquirer;
|
||||
typedef struct lumiera_mutexacquirer_struct lumiera_mutexacquirer;
|
||||
typedef struct lumiera_mutexacquirer_struct* LumieraMutexacquirer;
|
||||
|
||||
/* helper function for nobug */
|
||||
static inline void
|
||||
cinelerra_mutexacquirer_ensureunlocked (CinelerraMutexacquirer self)
|
||||
lumiera_mutexacquirer_ensureunlocked (LumieraMutexacquirer self)
|
||||
{
|
||||
ENSURE (self->state == CINELERRA_UNLOCKED, "forgot to unlock mutex");
|
||||
ENSURE (self->state == LUMIERA_UNLOCKED, "forgot to unlock mutex");
|
||||
}
|
||||
|
||||
/* override with a macro to use the cleanup checker */
|
||||
#define cinelerra_mutexacquirer \
|
||||
cinelerra_mutexacquirer NOBUG_CLEANUP(cinelerra_mutexacquirer_ensureunlocked)
|
||||
#define lumiera_mutexacquirer \
|
||||
lumiera_mutexacquirer NOBUG_CLEANUP(lumiera_mutexacquirer_ensureunlocked)
|
||||
|
||||
|
||||
/**
|
||||
* initialize a mutexacquirer state without mutex.
|
||||
* @param self mutexacquirer to be initialized, must be an automatic variable
|
||||
* @return self as given
|
||||
* This initialization is used when cinelerra_mutexacquirer_try_mutex shall be used later
|
||||
* This initialization is used when lumiera_mutexacquirer_try_mutex shall be used later
|
||||
*/
|
||||
static inline CinelerraMutexacquirer
|
||||
cinelerra_mutexacquirer_init (CinelerraMutexacquirer self)
|
||||
static inline LumieraMutexacquirer
|
||||
lumiera_mutexacquirer_init (LumieraMutexacquirer self)
|
||||
{
|
||||
REQUIRE (self);
|
||||
self->mutex = NULL;
|
||||
self->state = CINELERRA_UNLOCKED;
|
||||
self->state = LUMIERA_UNLOCKED;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
|
@ -93,20 +93,20 @@ cinelerra_mutexacquirer_init (CinelerraMutexacquirer self)
|
|||
* initialize a mutexacquirer state
|
||||
* @param self mutexacquirer to be initialized, must be an automatic variable
|
||||
* @param mutex associated mutex
|
||||
* @param state initial state of the mutex, either CINELERRA_LOCKED or CINELERRA_UNLOCKED
|
||||
* @param state initial state of the mutex, either LUMIERA_LOCKED or LUMIERA_UNLOCKED
|
||||
* @return self as given
|
||||
* errors are fatal
|
||||
*/
|
||||
static inline CinelerraMutexacquirer
|
||||
cinelerra_mutexacquirer_init_mutex (CinelerraMutexacquirer self, CinelerraMutex mutex, enum cinelerra_lockstate state)
|
||||
static inline LumieraMutexacquirer
|
||||
lumiera_mutexacquirer_init_mutex (LumieraMutexacquirer self, LumieraMutex mutex, enum lumiera_lockstate state)
|
||||
{
|
||||
REQUIRE (self);
|
||||
REQUIRE (mutex);
|
||||
self->mutex = mutex;
|
||||
self->state = state;
|
||||
if (state == CINELERRA_LOCKED)
|
||||
if (state == LUMIERA_LOCKED)
|
||||
if (pthread_mutex_lock (&mutex->mutex))
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
|
@ -118,25 +118,25 @@ cinelerra_mutexacquirer_init_mutex (CinelerraMutexacquirer self, CinelerraMutex
|
|||
* @param self mutexacquirer associated with a mutex variable
|
||||
*/
|
||||
static inline void
|
||||
cinelerra_mutexacquirer_lock (CinelerraMutexacquirer self)
|
||||
lumiera_mutexacquirer_lock (LumieraMutexacquirer self)
|
||||
{
|
||||
REQUIRE (self);
|
||||
REQUIRE (self->state == CINELERRA_UNLOCKED, "mutex already locked");
|
||||
REQUIRE (self->state == LUMIERA_UNLOCKED, "mutex already locked");
|
||||
|
||||
if (pthread_mutex_lock (&self->mutex->mutex))
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
|
||||
self->state = CINELERRA_LOCKED;
|
||||
self->state = LUMIERA_LOCKED;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get the state of a lock.
|
||||
* @param self mutexacquirer associated with a mutex variable
|
||||
* @return CINELERRA_LOCKED when the mutex is locked by this thead
|
||||
* @return LUMIERA_LOCKED when the mutex is locked by this thead
|
||||
*/
|
||||
static inline enum cinelerra_lockstate
|
||||
cinelerra_mutexacquirer_state (CinelerraMutexacquirer self)
|
||||
static inline enum lumiera_lockstate
|
||||
lumiera_mutexacquirer_state (LumieraMutexacquirer self)
|
||||
{
|
||||
REQUIRE (self);
|
||||
return self->state;
|
||||
|
|
@ -148,23 +148,23 @@ cinelerra_mutexacquirer_state (CinelerraMutexacquirer self)
|
|||
* must not already be locked
|
||||
* @param self mutexacquirer associated with a mutex variable
|
||||
* @param mutex pointer to a mutex which should be tried
|
||||
* @return CINELERRA_LOCKED when the mutex got locked
|
||||
* @return LUMIERA_LOCKED when the mutex got locked
|
||||
*/
|
||||
static inline enum cinelerra_lockstate
|
||||
cinelerra_mutexacquirer_try_mutex (CinelerraMutexacquirer self, CinelerraMutex mutex)
|
||||
static inline enum lumiera_lockstate
|
||||
lumiera_mutexacquirer_try_mutex (LumieraMutexacquirer self, LumieraMutex mutex)
|
||||
{
|
||||
REQUIRE (self);
|
||||
REQUIRE (self->state == CINELERRA_UNLOCKED, "mutex already locked");
|
||||
REQUIRE (self->state == LUMIERA_UNLOCKED, "mutex already locked");
|
||||
|
||||
self->mutex=mutex;
|
||||
switch (pthread_mutex_trylock (&self->mutex->mutex))
|
||||
{
|
||||
case 0:
|
||||
return self->state = CINELERRA_LOCKED;
|
||||
return self->state = LUMIERA_LOCKED;
|
||||
case EBUSY:
|
||||
return CINELERRA_UNLOCKED;
|
||||
return LUMIERA_UNLOCKED;
|
||||
default:
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -175,13 +175,13 @@ cinelerra_mutexacquirer_try_mutex (CinelerraMutexacquirer self, CinelerraMutex m
|
|||
* @param self mutexacquirer associated with a mutex variable
|
||||
*/
|
||||
static inline void
|
||||
cinelerra_mutexacquirer_unlock (CinelerraMutexacquirer self)
|
||||
lumiera_mutexacquirer_unlock (LumieraMutexacquirer self)
|
||||
{
|
||||
REQUIRE (self);
|
||||
REQUIRE (self->state == CINELERRA_LOCKED, "mutex was not locked");
|
||||
REQUIRE (self->state == LUMIERA_LOCKED, "mutex was not locked");
|
||||
if (pthread_mutex_unlock (&self->mutex->mutex))
|
||||
CINELERRA_DIE;
|
||||
self->state = CINELERRA_UNLOCKED;
|
||||
LUMIERA_DIE;
|
||||
self->state = LUMIERA_UNLOCKED;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
164
src/lib/plugin.c
164
src/lib/plugin.c
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
plugin.c - Cinelerra Plugin loader
|
||||
plugin.c - Lumiera Plugin loader
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Christian Thaeter <ct@pipapo.org>
|
||||
|
|
@ -34,48 +34,48 @@
|
|||
|
||||
|
||||
/* TODO should be set by the build system to the actual plugin path */
|
||||
#define CINELERRA_PLUGIN_PATH "~/.cinelerra3/plugins:/usr/local/lib/cinelerra3/plugins:.libs"
|
||||
#define LUMIERA_PLUGIN_PATH "~/.lumiera/plugins:/usr/local/lib/lumiera/plugins:.libs"
|
||||
|
||||
NOBUG_DEFINE_FLAG (cinelerra_plugin);
|
||||
NOBUG_DEFINE_FLAG (lumiera_plugin);
|
||||
|
||||
/* errors */
|
||||
CINELERRA_ERROR_DEFINE(PLUGIN_DLOPEN, "Could not open plugin");
|
||||
CINELERRA_ERROR_DEFINE(PLUGIN_HOOK, "Hook function failed");
|
||||
CINELERRA_ERROR_DEFINE(PLUGIN_NFILE, "No such plugin");
|
||||
CINELERRA_ERROR_DEFINE(PLUGIN_NIFACE, "No such interface");
|
||||
CINELERRA_ERROR_DEFINE(PLUGIN_REVISION, "Interface revision too old");
|
||||
LUMIERA_ERROR_DEFINE(PLUGIN_DLOPEN, "Could not open plugin");
|
||||
LUMIERA_ERROR_DEFINE(PLUGIN_HOOK, "Hook function failed");
|
||||
LUMIERA_ERROR_DEFINE(PLUGIN_NFILE, "No such plugin");
|
||||
LUMIERA_ERROR_DEFINE(PLUGIN_NIFACE, "No such interface");
|
||||
LUMIERA_ERROR_DEFINE(PLUGIN_REVISION, "Interface revision too old");
|
||||
|
||||
/*
|
||||
supported (planned) plugin types and their file extensions
|
||||
*/
|
||||
|
||||
enum cinelerra_plugin_type
|
||||
enum lumiera_plugin_type
|
||||
{
|
||||
CINELERRA_PLUGIN_NULL,
|
||||
CINELERRA_PLUGIN_DYNLIB,
|
||||
CINELERRA_PLUGIN_CSOURCE
|
||||
LUMIERA_PLUGIN_NULL,
|
||||
LUMIERA_PLUGIN_DYNLIB,
|
||||
LUMIERA_PLUGIN_CSOURCE
|
||||
};
|
||||
|
||||
static const struct
|
||||
{
|
||||
const char* const ext;
|
||||
enum cinelerra_plugin_type type;
|
||||
} cinelerra_plugin_extensions [] =
|
||||
enum lumiera_plugin_type type;
|
||||
} lumiera_plugin_extensions [] =
|
||||
{
|
||||
{"so", CINELERRA_PLUGIN_DYNLIB},
|
||||
{"o", CINELERRA_PLUGIN_DYNLIB},
|
||||
{"c", CINELERRA_PLUGIN_CSOURCE},
|
||||
{"so", LUMIERA_PLUGIN_DYNLIB},
|
||||
{"o", LUMIERA_PLUGIN_DYNLIB},
|
||||
{"c", LUMIERA_PLUGIN_CSOURCE},
|
||||
/* extend here */
|
||||
{NULL, CINELERRA_PLUGIN_NULL}
|
||||
{NULL, LUMIERA_PLUGIN_NULL}
|
||||
};
|
||||
|
||||
|
||||
struct cinelerra_plugin
|
||||
struct lumiera_plugin
|
||||
{
|
||||
/* short name as queried ("effects/audio/normalize") used for sorting/finding */
|
||||
const char* name;
|
||||
|
||||
/* long names as looked up ("/usr/local/lib/cinelerra3/plugins/effects/audio/normalize.so") */
|
||||
/* long names as looked up ("/usr/local/lib/lumiera/plugins/effects/audio/normalize.so") */
|
||||
const char* pathname;
|
||||
|
||||
/* use count for all interfaces of this plugin */
|
||||
|
|
@ -85,7 +85,7 @@ struct cinelerra_plugin
|
|||
time_t last;
|
||||
|
||||
/* kind of plugin */
|
||||
enum cinelerra_plugin_type type;
|
||||
enum lumiera_plugin_type type;
|
||||
|
||||
/* dlopen handle */
|
||||
void* handle;
|
||||
|
|
@ -93,19 +93,19 @@ struct cinelerra_plugin
|
|||
|
||||
|
||||
/* global plugin registry */
|
||||
void* cinelerra_plugin_registry = NULL;
|
||||
void* lumiera_plugin_registry = NULL;
|
||||
|
||||
/* plugin operations are protected by one big mutex */
|
||||
pthread_mutex_t cinelerra_plugin_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
pthread_mutex_t lumiera_plugin_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
/**
|
||||
* the compare function for the registry tree.
|
||||
* Compares the names of two struct cinelerra_plugin.
|
||||
* Compares the names of two struct lumiera_plugin.
|
||||
* @return 0 if a and b are equal, just like strcmp. */
|
||||
static int
|
||||
cinelerra_plugin_name_cmp (const void* a, const void* b)
|
||||
lumiera_plugin_name_cmp (const void* a, const void* b)
|
||||
{
|
||||
return strcmp (((struct cinelerra_plugin*) a)->name, ((struct cinelerra_plugin*) b)->name);
|
||||
return strcmp (((struct lumiera_plugin*) a)->name, ((struct lumiera_plugin*) b)->name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -113,21 +113,21 @@ cinelerra_plugin_name_cmp (const void* a, const void* b)
|
|||
* always succeeds or aborts
|
||||
*/
|
||||
void
|
||||
cinelerra_init_plugin (void)
|
||||
lumiera_init_plugin (void)
|
||||
{
|
||||
NOBUG_INIT_FLAG (cinelerra_plugin);
|
||||
NOBUG_INIT_FLAG (lumiera_plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find and set pathname for the plugin.
|
||||
* Searches through given path for given plugin, trying to find the file's location in the filesystem.
|
||||
* If found, self->pathname will be set to the found plugin file.
|
||||
* @param self The cinelerra_plugin to open look for.
|
||||
* @param self The lumiera_plugin to open look for.
|
||||
* @param path The path to search trough (paths seperated by ":")
|
||||
* @return 0 on success. -1 on error, or if plugin not found in path.
|
||||
*/
|
||||
int
|
||||
cinelerra_plugin_lookup (struct cinelerra_plugin* self, const char* path)
|
||||
lumiera_plugin_lookup (struct lumiera_plugin* self, const char* path)
|
||||
{
|
||||
if (!path)
|
||||
return -1;
|
||||
|
|
@ -146,22 +146,22 @@ cinelerra_plugin_lookup (struct cinelerra_plugin* self, const char* path)
|
|||
for (char* tok = strtok_r (tpath, ":", &tmp); tok; tok = strtok_r (NULL, ":", &tmp))
|
||||
{
|
||||
/*for each extension*/
|
||||
for (int i = 0; cinelerra_plugin_extensions[i].ext; ++i)
|
||||
for (int i = 0; lumiera_plugin_extensions[i].ext; ++i)
|
||||
{
|
||||
/* path/name.extension */
|
||||
int r = snprintf(pathname, 1024, "%s/%s.%s", tok, self->name, cinelerra_plugin_extensions[i].ext);
|
||||
int r = snprintf(pathname, 1024, "%s/%s.%s", tok, self->name, lumiera_plugin_extensions[i].ext);
|
||||
if (r >= 1024)
|
||||
return -1; /*TODO error handling, name too long*/
|
||||
|
||||
TRACE (cinelerra_plugin, "trying %s", pathname);
|
||||
TRACE (lumiera_plugin, "trying %s", pathname);
|
||||
|
||||
if (!access(pathname, R_OK))
|
||||
{
|
||||
/* got it */
|
||||
TRACE (cinelerra_plugin, "found %s", pathname);
|
||||
TRACE (lumiera_plugin, "found %s", pathname);
|
||||
self->pathname = strdup (pathname);
|
||||
if (!self->pathname) CINELERRA_DIE;
|
||||
self->type = cinelerra_plugin_extensions[i].type;
|
||||
if (!self->pathname) LUMIERA_DIE;
|
||||
self->type = lumiera_plugin_extensions[i].type;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -181,44 +181,44 @@ cinelerra_plugin_lookup (struct cinelerra_plugin* self, const char* path)
|
|||
* @return handle to the interface or NULL in case of a error. The application shall cast this handle to
|
||||
* the actual interface type.
|
||||
*/
|
||||
struct cinelerra_interface*
|
||||
cinelerra_interface_open (const char* name, const char* interface, size_t min_revision)
|
||||
struct lumiera_interface*
|
||||
lumiera_interface_open (const char* name, const char* interface, size_t min_revision)
|
||||
{
|
||||
//REQUIRE (min_revision > sizeof(struct cinelerra_interface), "try to use an empty interface eh?");
|
||||
//REQUIRE (min_revision > sizeof(struct lumiera_interface), "try to use an empty interface eh?");
|
||||
REQUIRE (interface, "interface name must be given");
|
||||
|
||||
pthread_mutex_lock (&cinelerra_plugin_mutex);
|
||||
pthread_mutex_lock (&lumiera_plugin_mutex);
|
||||
|
||||
struct cinelerra_plugin plugin;
|
||||
struct cinelerra_plugin** found;
|
||||
struct lumiera_plugin plugin;
|
||||
struct lumiera_plugin** found;
|
||||
|
||||
plugin.name = name; /* for searching */
|
||||
|
||||
found = tsearch (&plugin, &cinelerra_plugin_registry, cinelerra_plugin_name_cmp);
|
||||
if (!found) CINELERRA_DIE;
|
||||
found = tsearch (&plugin, &lumiera_plugin_registry, lumiera_plugin_name_cmp);
|
||||
if (!found) LUMIERA_DIE;
|
||||
|
||||
if (*found == &plugin)
|
||||
{
|
||||
NOTICE (cinelerra_plugin, "new plugin");
|
||||
NOTICE (lumiera_plugin, "new plugin");
|
||||
|
||||
/* now really create new item */
|
||||
*found = malloc (sizeof (struct cinelerra_plugin));
|
||||
if (!*found) CINELERRA_DIE;
|
||||
*found = malloc (sizeof (struct lumiera_plugin));
|
||||
if (!*found) LUMIERA_DIE;
|
||||
|
||||
if (name) /* NULL is main app, no lookup needed */
|
||||
{
|
||||
/*lookup for $CINELERRA_PLUGIN_PATH*/
|
||||
/*lookup for $LUMIERA_PLUGIN_PATH*/
|
||||
(*found)->name = strdup (name);
|
||||
if (!(*found)->name) CINELERRA_DIE;
|
||||
if (!(*found)->name) LUMIERA_DIE;
|
||||
|
||||
if (!!cinelerra_plugin_lookup (*found, getenv("CINELERRA_PLUGIN_PATH"))
|
||||
#ifdef CINELERRA_PLUGIN_PATH
|
||||
/* else lookup for -DCINELERRA_PLUGIN_PATH */
|
||||
&& !!cinelerra_plugin_lookup (*found, CINELERRA_PLUGIN_PATH)
|
||||
if (!!lumiera_plugin_lookup (*found, getenv("LUMIERA_PLUGIN_PATH"))
|
||||
#ifdef LUMIERA_PLUGIN_PATH
|
||||
/* else lookup for -DLUMIERA_PLUGIN_PATH */
|
||||
&& !!lumiera_plugin_lookup (*found, LUMIERA_PLUGIN_PATH)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_NFILE);
|
||||
LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_NFILE);
|
||||
goto elookup;
|
||||
}
|
||||
}
|
||||
|
|
@ -233,46 +233,46 @@ cinelerra_interface_open (const char* name, const char* interface, size_t min_re
|
|||
PLANNED("if .so like then dlopen; else if .c like tcc compile");
|
||||
TODO("factor dlopen and dlsym out");
|
||||
|
||||
TRACE(cinelerra_plugin, "trying to open %s", (*found)->pathname);
|
||||
TRACE(lumiera_plugin, "trying to open %s", (*found)->pathname);
|
||||
|
||||
(*found)->handle = dlopen ((*found)->pathname, RTLD_LAZY|RTLD_LOCAL);
|
||||
if (!(*found)->handle)
|
||||
{
|
||||
ERROR (cinelerra_plugin, "dlopen failed: %s", dlerror());
|
||||
CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_DLOPEN);
|
||||
ERROR (lumiera_plugin, "dlopen failed: %s", dlerror());
|
||||
LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_DLOPEN);
|
||||
goto edlopen;
|
||||
}
|
||||
|
||||
/* if the plugin defines a 'cinelerra_plugin_init' function, we call it, must return 0 on success */
|
||||
int (*init)(void) = dlsym((*found)->handle, "cinelerra_plugin_init");
|
||||
/* if the plugin defines a 'lumiera_plugin_init' function, we call it, must return 0 on success */
|
||||
int (*init)(void) = dlsym((*found)->handle, "lumiera_plugin_init");
|
||||
if (init && init())
|
||||
{
|
||||
//ERROR (cinelerra_plugin, "cinelerra_plugin_init failed: %s: %s", name, interface);
|
||||
CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_HOOK);
|
||||
//ERROR (lumiera_plugin, "lumiera_plugin_init failed: %s: %s", name, interface);
|
||||
LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_HOOK);
|
||||
goto einit;
|
||||
}
|
||||
}
|
||||
/* we have the plugin, now get the interface descriptor */
|
||||
struct cinelerra_interface* ret;
|
||||
struct lumiera_interface* ret;
|
||||
|
||||
dlerror();
|
||||
ret = dlsym ((*found)->handle, interface);
|
||||
|
||||
const char *dlerr = dlerror();
|
||||
TRACE(cinelerra_plugin, "%s", dlerr);
|
||||
TODO ("need some way to tell 'interface not provided by plugin', maybe cinelerra_plugin_error()?");
|
||||
TRACE(lumiera_plugin, "%s", dlerr);
|
||||
TODO ("need some way to tell 'interface not provided by plugin', maybe lumiera_plugin_error()?");
|
||||
if (dlerr)
|
||||
{
|
||||
//ERROR (cinelerra_plugin, "plugin %s doesnt provide interface %s", name, interface);
|
||||
CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_NIFACE);
|
||||
//ERROR (lumiera_plugin, "plugin %s doesnt provide interface %s", name, interface);
|
||||
LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_NIFACE);
|
||||
goto edlsym;
|
||||
}
|
||||
|
||||
/* is the interface older than required? */
|
||||
if (ret->size < min_revision)
|
||||
{
|
||||
ERROR (cinelerra_plugin, "plugin %s provides older interface %s revision than required", name, interface);
|
||||
CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_REVISION);
|
||||
ERROR (lumiera_plugin, "plugin %s provides older interface %s revision than required", name, interface);
|
||||
LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_REVISION);
|
||||
goto erevision;
|
||||
}
|
||||
|
||||
|
|
@ -281,8 +281,8 @@ cinelerra_interface_open (const char* name, const char* interface, size_t min_re
|
|||
/* if the interface provides a 'open' function, call it now, must return 0 on success */
|
||||
if (ret->open && ret->open())
|
||||
{
|
||||
ERROR (cinelerra_plugin, "open hook indicated an error");
|
||||
CINELERRA_ERROR_SET (cinelerra_plugin, PLUGIN_HOOK);
|
||||
ERROR (lumiera_plugin, "open hook indicated an error");
|
||||
LUMIERA_ERROR_SET (lumiera_plugin, PLUGIN_HOOK);
|
||||
goto eopen;
|
||||
}
|
||||
|
||||
|
|
@ -290,7 +290,7 @@ cinelerra_interface_open (const char* name, const char* interface, size_t min_re
|
|||
(*found)->last = time (NULL);
|
||||
ret->use_count++;
|
||||
|
||||
pthread_mutex_unlock (&cinelerra_plugin_mutex);
|
||||
pthread_mutex_unlock (&lumiera_plugin_mutex);
|
||||
return ret;
|
||||
|
||||
/* Error cleanup */
|
||||
|
|
@ -304,8 +304,8 @@ cinelerra_interface_open (const char* name, const char* interface, size_t min_re
|
|||
free ((char*)(*found)->name);
|
||||
free (*found);
|
||||
*found = &plugin;
|
||||
tdelete (&plugin, &cinelerra_plugin_registry, cinelerra_plugin_name_cmp);
|
||||
pthread_mutex_unlock (&cinelerra_plugin_mutex);
|
||||
tdelete (&plugin, &lumiera_plugin_registry, lumiera_plugin_name_cmp);
|
||||
pthread_mutex_unlock (&lumiera_plugin_mutex);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -315,17 +315,17 @@ cinelerra_interface_open (const char* name, const char* interface, size_t min_re
|
|||
* @param ptr interface to be closed
|
||||
*/
|
||||
void
|
||||
cinelerra_interface_close (void* ptr)
|
||||
lumiera_interface_close (void* ptr)
|
||||
{
|
||||
TRACE (cinelerra_plugin, "%p", ptr);
|
||||
TRACE (lumiera_plugin, "%p", ptr);
|
||||
if(!ptr)
|
||||
return;
|
||||
|
||||
struct cinelerra_interface* self = (struct cinelerra_interface*) ptr;
|
||||
struct lumiera_interface* self = (struct lumiera_interface*) ptr;
|
||||
|
||||
pthread_mutex_lock (&cinelerra_plugin_mutex);
|
||||
pthread_mutex_lock (&lumiera_plugin_mutex);
|
||||
|
||||
struct cinelerra_plugin* plugin = self->plugin;
|
||||
struct lumiera_plugin* plugin = self->plugin;
|
||||
|
||||
plugin->use_count--;
|
||||
self->use_count--;
|
||||
|
|
@ -339,16 +339,16 @@ cinelerra_interface_close (void* ptr)
|
|||
{
|
||||
TODO ("we dont want to close here, instead store time of recent use and make a expire run, already planned in my head");
|
||||
|
||||
/* if the plugin defines a 'cinelerra_plugin_destroy' function, we call it */
|
||||
int (*destroy)(void) = dlsym(plugin->handle, "cinelerra_plugin_destroy");
|
||||
/* if the plugin defines a 'lumiera_plugin_destroy' function, we call it */
|
||||
int (*destroy)(void) = dlsym(plugin->handle, "lumiera_plugin_destroy");
|
||||
if (destroy)
|
||||
destroy();
|
||||
|
||||
/* and now cleanup */
|
||||
tdelete (plugin, &cinelerra_plugin_registry, cinelerra_plugin_name_cmp);
|
||||
tdelete (plugin, &lumiera_plugin_registry, lumiera_plugin_name_cmp);
|
||||
free ((char*)plugin->name);
|
||||
dlclose(plugin->handle);
|
||||
free (plugin);
|
||||
}
|
||||
pthread_mutex_unlock (&cinelerra_plugin_mutex);
|
||||
pthread_mutex_unlock (&lumiera_plugin_mutex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
#ifndef CINELERRA_PLUGIN_H
|
||||
#define CINELERRA_PLUGIN_H
|
||||
#ifndef LUMIERA_PLUGIN_H
|
||||
#define LUMIERA_PLUGIN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
@ -37,55 +37,55 @@ extern "C" {
|
|||
*/
|
||||
|
||||
|
||||
NOBUG_DECLARE_FLAG (cinelerra_plugin);
|
||||
NOBUG_DECLARE_FLAG (lumiera_plugin);
|
||||
|
||||
/* tool macros*/
|
||||
#define CINELERRA_INTERFACE_TYPE(name, version) struct cinelerra_interface_##name##_##version
|
||||
#define CINELERRA_INTERFACE_CAST(name, version) (CINELERRA_INTERFACE_TYPE(name, version)*)
|
||||
#define LUMIERA_INTERFACE_TYPE(name, version) struct lumiera_interface_##name##_##version
|
||||
#define LUMIERA_INTERFACE_CAST(name, version) (LUMIERA_INTERFACE_TYPE(name, version)*)
|
||||
|
||||
/* Interface definition */
|
||||
#define CINELERRA_INTERFACE(name, version, ...) \
|
||||
CINELERRA_INTERFACE_TYPE(name, version) \
|
||||
#define LUMIERA_INTERFACE(name, version, ...) \
|
||||
LUMIERA_INTERFACE_TYPE(name, version) \
|
||||
{ \
|
||||
struct cinelerra_interface interface_header_; \
|
||||
struct lumiera_interface interface_header_; \
|
||||
__VA_ARGS__ \
|
||||
}
|
||||
|
||||
#define CINELERRA_INTERFACE_PROTO(ret, name, params) ret (*name) params;
|
||||
#define LUMIERA_INTERFACE_PROTO(ret, name, params) ret (*name) params;
|
||||
|
||||
/* Interface instantiation */
|
||||
#define CINELERRA_INTERFACE_IMPLEMENT(iname, version, name, open, close, ...) \
|
||||
CINELERRA_INTERFACE_TYPE(iname, version) name##_##version = \
|
||||
{ \
|
||||
{ \
|
||||
version, \
|
||||
sizeof(CINELERRA_INTERFACE_TYPE(iname, version)), \
|
||||
NULL, \
|
||||
0, \
|
||||
open, \
|
||||
close \
|
||||
}, \
|
||||
__VA_ARGS__ \
|
||||
#define LUMIERA_INTERFACE_IMPLEMENT(iname, version, name, open, close, ...) \
|
||||
LUMIERA_INTERFACE_TYPE(iname, version) name##_##version = \
|
||||
{ \
|
||||
{ \
|
||||
version, \
|
||||
sizeof(LUMIERA_INTERFACE_TYPE(iname, version)), \
|
||||
NULL, \
|
||||
0, \
|
||||
open, \
|
||||
close \
|
||||
}, \
|
||||
__VA_ARGS__ \
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* internally used */
|
||||
struct cinelerra_plugin;
|
||||
struct lumiera_plugin;
|
||||
|
||||
/**
|
||||
* This is the header for any interface exported by plugins.
|
||||
* Real interfaces append their functions at the end. There are few standard functions on each Interface
|
||||
* Every function is required to be implemnted.
|
||||
*/
|
||||
struct cinelerra_interface
|
||||
struct lumiera_interface
|
||||
{
|
||||
/// interface version number
|
||||
unsigned version;
|
||||
/// size of the full structure is used to determine the revision (adding a new function increments the size)
|
||||
size_t size;
|
||||
/// back reference to plugin
|
||||
struct cinelerra_plugin* plugin;
|
||||
struct lumiera_plugin* plugin;
|
||||
/// incremented for each user of this interface and decremented when closed
|
||||
unsigned use_count;
|
||||
|
||||
|
|
@ -96,15 +96,15 @@ struct cinelerra_interface
|
|||
};
|
||||
|
||||
void
|
||||
cinelerra_init_plugin (void);
|
||||
lumiera_init_plugin (void);
|
||||
|
||||
|
||||
struct cinelerra_interface*
|
||||
cinelerra_interface_open (const char* plugin, const char* name, size_t min_revision);
|
||||
struct lumiera_interface*
|
||||
lumiera_interface_open (const char* plugin, const char* name, size_t min_revision);
|
||||
|
||||
|
||||
void
|
||||
cinelerra_interface_close (void* self);
|
||||
lumiera_interface_close (void* self);
|
||||
|
||||
/**
|
||||
* Tries to unload a plugin.
|
||||
|
|
@ -113,24 +113,24 @@ cinelerra_interface_close (void* self);
|
|||
* @return 0 on success, else the number if users which keeping the plugin loaded
|
||||
*/
|
||||
int
|
||||
cinelerra_plugin_unload (const char* plugin);
|
||||
lumiera_plugin_unload (const char* plugin);
|
||||
|
||||
/**
|
||||
* Tries to unload plugins which are not in use.
|
||||
* Calls cinelerra_plugin_unload() for each Plugin which is not used for more than age seconds.
|
||||
* Calls lumiera_plugin_unload() for each Plugin which is not used for more than age seconds.
|
||||
* This function might be infrequently called by the scheduler to remove things which are not needed.
|
||||
* @param age timeout in seconds when to unload plugins
|
||||
*/
|
||||
void
|
||||
cinelerra_plugin_expire (time_t age);
|
||||
lumiera_plugin_expire (time_t age);
|
||||
|
||||
CINELERRA_ERROR_DECLARE(PLUGIN_DLOPEN);
|
||||
CINELERRA_ERROR_DECLARE(PLUGIN_HOOK);
|
||||
CINELERRA_ERROR_DECLARE(PLUGIN_NFILE);
|
||||
CINELERRA_ERROR_DECLARE(PLUGIN_NIFACE);
|
||||
CINELERRA_ERROR_DECLARE(PLUGIN_REVISION);
|
||||
LUMIERA_ERROR_DECLARE(PLUGIN_DLOPEN);
|
||||
LUMIERA_ERROR_DECLARE(PLUGIN_HOOK);
|
||||
LUMIERA_ERROR_DECLARE(PLUGIN_NFILE);
|
||||
LUMIERA_ERROR_DECLARE(PLUGIN_NIFACE);
|
||||
LUMIERA_ERROR_DECLARE(PLUGIN_REVISION);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
#endif /* CINELERRA_PLUGIN_H */
|
||||
#endif /* LUMIERA_PLUGIN_H */
|
||||
|
|
|
|||
|
|
@ -40,17 +40,17 @@
|
|||
* @param dtor destructor function which will be called on obj when the last strong reference gets deleted
|
||||
* @return self as given
|
||||
*/
|
||||
CinelerraReference
|
||||
cinelerra_reference_strong_init_once (CinelerraReference self, void* obj, void (*dtor)(void*))
|
||||
LumieraReference
|
||||
lumiera_reference_strong_init_once (LumieraReference self, void* obj, void (*dtor)(void*))
|
||||
{
|
||||
CinelerraReftarget target = malloc (sizeof(cinelerra_reftarget));
|
||||
if (!target) CINELERRA_DIE;
|
||||
LumieraReftarget target = malloc (sizeof(lumiera_reftarget));
|
||||
if (!target) LUMIERA_DIE;
|
||||
|
||||
target->object = obj;
|
||||
target->dtor = dtor;
|
||||
target->strong_cnt = 1;
|
||||
target->weak_cnt = 0;
|
||||
cinelerra_mutex_init (&target->lock);
|
||||
lumiera_mutex_init (&target->lock);
|
||||
|
||||
self->object = obj;
|
||||
self->target = target;
|
||||
|
|
@ -66,16 +66,16 @@ cinelerra_reference_strong_init_once (CinelerraReference self, void* obj, void (
|
|||
* @return self as given
|
||||
* destroying a reference is not thread safe as far as 2 threads try to concurrently destroy it!
|
||||
*/
|
||||
CinelerraReference
|
||||
cinelerra_reference_destroy (CinelerraReference self)
|
||||
LumieraReference
|
||||
lumiera_reference_destroy (LumieraReference self)
|
||||
{
|
||||
CinelerraReftarget target = self->target;
|
||||
LumieraReftarget target = self->target;
|
||||
|
||||
/* defensive, lets detect errors if anything still tries to use this reference */
|
||||
self->target = NULL;
|
||||
|
||||
cinelerra_mutexacquirer lock;
|
||||
cinelerra_mutexacquirer_init_mutex (&lock, &target->lock, CINELERRA_LOCKED);
|
||||
lumiera_mutexacquirer lock;
|
||||
lumiera_mutexacquirer_init_mutex (&lock, &target->lock, LUMIERA_LOCKED);
|
||||
|
||||
if (self->object)
|
||||
{
|
||||
|
|
@ -89,8 +89,8 @@ cinelerra_reference_destroy (CinelerraReference self)
|
|||
if (!target->weak_cnt)
|
||||
{
|
||||
/* no weak refs either, destroy it */
|
||||
cinelerra_mutexacquirer_unlock (&lock);
|
||||
cinelerra_mutex_destroy (&target->lock);
|
||||
lumiera_mutexacquirer_unlock (&lock);
|
||||
lumiera_mutex_destroy (&target->lock);
|
||||
free (target);
|
||||
return self;
|
||||
}
|
||||
|
|
@ -102,13 +102,13 @@ cinelerra_reference_destroy (CinelerraReference self)
|
|||
if (!--target->weak_cnt && !target->strong_cnt)
|
||||
{
|
||||
/* was last weak reference, and no strong refs left */
|
||||
cinelerra_mutexacquirer_unlock (&lock);
|
||||
cinelerra_mutex_destroy (&target->lock);
|
||||
lumiera_mutexacquirer_unlock (&lock);
|
||||
lumiera_mutex_destroy (&target->lock);
|
||||
free (target);
|
||||
return self;
|
||||
}
|
||||
}
|
||||
cinelerra_mutexacquirer_unlock (&lock);
|
||||
lumiera_mutexacquirer_unlock (&lock);
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
@ -118,11 +118,11 @@ cinelerra_reference_destroy (CinelerraReference self)
|
|||
* @return self as strong reference (always for strong references) or NULL if source is an invalidated weak reference,
|
||||
* in the later case the reference is constructed as weak reference barely to allow it be destroyed
|
||||
*/
|
||||
CinelerraReference
|
||||
cinelerra_reference_strong_init (CinelerraReference self, CinelerraReference source)
|
||||
LumieraReference
|
||||
lumiera_reference_strong_init (LumieraReference self, LumieraReference source)
|
||||
{
|
||||
cinelerra_mutexacquirer lock;
|
||||
cinelerra_mutexacquirer_init_mutex (&lock, &source->target->lock, CINELERRA_LOCKED);
|
||||
lumiera_mutexacquirer lock;
|
||||
lumiera_mutexacquirer_init_mutex (&lock, &source->target->lock, LUMIERA_LOCKED);
|
||||
|
||||
self->object = source->target->object;
|
||||
self->target = source->target;
|
||||
|
|
@ -136,7 +136,7 @@ cinelerra_reference_strong_init (CinelerraReference self, CinelerraReference sou
|
|||
++self->target->weak_cnt;
|
||||
self = NULL;
|
||||
}
|
||||
cinelerra_mutexacquirer_unlock (&lock);
|
||||
lumiera_mutexacquirer_unlock (&lock);
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
@ -145,11 +145,11 @@ cinelerra_reference_strong_init (CinelerraReference self, CinelerraReference sou
|
|||
* @param source reference to copy
|
||||
* @return self (always for strong references) or NULL if self is an invalidated weak reference
|
||||
*/
|
||||
CinelerraReference
|
||||
cinelerra_reference_weak_init (CinelerraReference self, CinelerraReference source)
|
||||
LumieraReference
|
||||
lumiera_reference_weak_init (LumieraReference self, LumieraReference source)
|
||||
{
|
||||
cinelerra_mutexacquirer lock;
|
||||
cinelerra_mutexacquirer_init_mutex (&lock, &source->target->lock, CINELERRA_LOCKED);
|
||||
lumiera_mutexacquirer lock;
|
||||
lumiera_mutexacquirer_init_mutex (&lock, &source->target->lock, LUMIERA_LOCKED);
|
||||
|
||||
self->object = NULL;
|
||||
self->target = source->target;
|
||||
|
|
@ -159,7 +159,7 @@ cinelerra_reference_weak_init (CinelerraReference self, CinelerraReference sourc
|
|||
/* already invalidated */
|
||||
self = NULL;
|
||||
|
||||
cinelerra_mutexacquirer_unlock (&lock);
|
||||
lumiera_mutexacquirer_unlock (&lock);
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
@ -169,14 +169,14 @@ cinelerra_reference_weak_init (CinelerraReference self, CinelerraReference sourc
|
|||
* do nothing if the referene is already weak
|
||||
* @return self or NULL if the final strong reference got removed,
|
||||
*/
|
||||
CinelerraReference
|
||||
cinelerra_reference_weaken (restrict CinelerraReference self)
|
||||
LumieraReference
|
||||
lumiera_reference_weaken (restrict LumieraReference self)
|
||||
{
|
||||
/* is this a strong reference? */
|
||||
if (self->object)
|
||||
{
|
||||
cinelerra_mutexacquirer lock;
|
||||
cinelerra_mutexacquirer_init_mutex (&lock, &self->target->lock, CINELERRA_LOCKED);
|
||||
lumiera_mutexacquirer lock;
|
||||
lumiera_mutexacquirer_init_mutex (&lock, &self->target->lock, LUMIERA_LOCKED);
|
||||
|
||||
self->object = NULL;
|
||||
++self->target->weak_cnt;
|
||||
|
|
@ -187,7 +187,7 @@ cinelerra_reference_weaken (restrict CinelerraReference self)
|
|||
self->target->object = NULL;
|
||||
self = NULL;
|
||||
}
|
||||
cinelerra_mutexacquirer_unlock (&lock);
|
||||
lumiera_mutexacquirer_unlock (&lock);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
@ -198,14 +198,14 @@ cinelerra_reference_weaken (restrict CinelerraReference self)
|
|||
* only references of object which are not already destroyed can be strengthened
|
||||
* @return self when successful, NULL when the object was already destroyed, 'self' stays a dead weak reference in that case
|
||||
*/
|
||||
CinelerraReference
|
||||
cinelerra_reference_strengthen (CinelerraReference self)
|
||||
LumieraReference
|
||||
lumiera_reference_strengthen (LumieraReference self)
|
||||
{
|
||||
/* is this a weak reference? */
|
||||
if (!self->object)
|
||||
{
|
||||
cinelerra_mutexacquirer lock;
|
||||
cinelerra_mutexacquirer_init_mutex (&lock, &self->target->lock, CINELERRA_LOCKED);
|
||||
lumiera_mutexacquirer lock;
|
||||
lumiera_mutexacquirer_init_mutex (&lock, &self->target->lock, LUMIERA_LOCKED);
|
||||
|
||||
if (self->target->object)
|
||||
{
|
||||
|
|
@ -215,7 +215,7 @@ cinelerra_reference_strengthen (CinelerraReference self)
|
|||
}
|
||||
else
|
||||
self = NULL;
|
||||
cinelerra_mutexacquirer_unlock (&lock);
|
||||
lumiera_mutexacquirer_unlock (&lock);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef CINELERRA_REFERENCES_H
|
||||
#define CINELERRA_REFERENCES_H
|
||||
#ifndef LUMIERA_REFERENCES_H
|
||||
#define LUMIERA_REFERENCES_H
|
||||
|
||||
#include <nobug.h>
|
||||
|
||||
|
|
@ -29,77 +29,77 @@
|
|||
*/
|
||||
|
||||
|
||||
typedef struct cinelerra_reference_struct cinelerra_reference;
|
||||
typedef cinelerra_reference* CinelerraReference;
|
||||
typedef struct lumiera_reference_struct lumiera_reference;
|
||||
typedef lumiera_reference* LumieraReference;
|
||||
|
||||
#include "lib/error.h"
|
||||
#include "lib/mutex.h"
|
||||
|
||||
/* Implementation detail */
|
||||
struct cinelerra_reftarget_struct
|
||||
struct lumiera_reftarget_struct
|
||||
{
|
||||
void* object;
|
||||
void (*dtor)(void*);
|
||||
unsigned strong_cnt; /*when strong becomes 0 obj is destroyed, if weak is 0 destroy target too*/
|
||||
unsigned weak_cnt; /*when weak becomes 0 and !obj and lock strong is 0, destroy target */
|
||||
cinelerra_mutex lock;
|
||||
lumiera_mutex lock;
|
||||
};
|
||||
typedef struct cinelerra_reftarget_struct cinelerra_reftarget;
|
||||
typedef cinelerra_reftarget* CinelerraReftarget;
|
||||
typedef struct lumiera_reftarget_struct lumiera_reftarget;
|
||||
typedef lumiera_reftarget* LumieraReftarget;
|
||||
|
||||
|
||||
/**
|
||||
* A reference pointing to some other object
|
||||
*/
|
||||
struct cinelerra_reference_struct
|
||||
struct lumiera_reference_struct
|
||||
{
|
||||
void* object; /*set for strong, NULL for weak*/
|
||||
CinelerraReftarget target;
|
||||
LumieraReftarget target;
|
||||
};
|
||||
|
||||
#define cinelerra_reference \
|
||||
cinelerra_reference NOBUG_CLEANUP(cinelerra_reference_ensuredestroyed)
|
||||
#define lumiera_reference \
|
||||
lumiera_reference NOBUG_CLEANUP(lumiera_reference_ensuredestroyed)
|
||||
|
||||
/* helper function for nobug */
|
||||
static inline void
|
||||
cinelerra_reference_ensuredestroyed (CinelerraReference self)
|
||||
lumiera_reference_ensuredestroyed (LumieraReference self)
|
||||
{
|
||||
ENSURE (!self->target, "forgot to destroy reference");
|
||||
}
|
||||
|
||||
|
||||
CinelerraReference
|
||||
cinelerra_reference_strong_init_once (CinelerraReference self, void* obj, void (*dtor)(void*));
|
||||
LumieraReference
|
||||
lumiera_reference_strong_init_once (LumieraReference self, void* obj, void (*dtor)(void*));
|
||||
|
||||
|
||||
CinelerraReference
|
||||
cinelerra_reference_destroy (CinelerraReference self);
|
||||
LumieraReference
|
||||
lumiera_reference_destroy (LumieraReference self);
|
||||
|
||||
/**
|
||||
* Get object from a strong reference.
|
||||
* @return pointer to object, NULL if applied to a weak reference
|
||||
*/
|
||||
static inline void*
|
||||
cinelerra_reference_get (CinelerraReference self)
|
||||
lumiera_reference_get (LumieraReference self)
|
||||
{
|
||||
ENSURE (self->target, "illegal reference (not initialized or already destroyed?)");
|
||||
return self->object;
|
||||
}
|
||||
|
||||
|
||||
CinelerraReference
|
||||
cinelerra_reference_strong_init (CinelerraReference self, CinelerraReference source);
|
||||
LumieraReference
|
||||
lumiera_reference_strong_init (LumieraReference self, LumieraReference source);
|
||||
|
||||
|
||||
CinelerraReference
|
||||
cinelerra_reference_weak_init (CinelerraReference self, CinelerraReference source);
|
||||
LumieraReference
|
||||
lumiera_reference_weak_init (LumieraReference self, LumieraReference source);
|
||||
|
||||
|
||||
CinelerraReference
|
||||
cinelerra_reference_weaken (restrict CinelerraReference self);
|
||||
LumieraReference
|
||||
lumiera_reference_weaken (restrict LumieraReference self);
|
||||
|
||||
|
||||
CinelerraReference
|
||||
cinelerra_reference_strengthen (CinelerraReference self);
|
||||
LumieraReference
|
||||
lumiera_reference_strengthen (LumieraReference self);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@
|
|||
#include <errno.h>
|
||||
#include "lib/rwlock.h"
|
||||
|
||||
CINELERRA_ERROR_DEFINE(RWLOCK_AGAIN, "maximum number of readlocks exceed");
|
||||
CINELERRA_ERROR_DEFINE(RWLOCK_DEADLOCK, "deadlock detected");
|
||||
LUMIERA_ERROR_DEFINE(RWLOCK_AGAIN, "maximum number of readlocks exceed");
|
||||
LUMIERA_ERROR_DEFINE(RWLOCK_DEADLOCK, "deadlock detected");
|
||||
|
||||
/**
|
||||
* @file Read/write locks.
|
||||
|
|
@ -36,8 +36,8 @@ CINELERRA_ERROR_DEFINE(RWLOCK_DEADLOCK, "deadlock detected");
|
|||
* @param self is a pointer to the rwlock to be initialized
|
||||
* @return self as given
|
||||
*/
|
||||
CinelerraRWLock
|
||||
cinelerra_rwlock_init (CinelerraRWLock self)
|
||||
LumieraRWLock
|
||||
lumiera_rwlock_init (LumieraRWLock self)
|
||||
{
|
||||
if (self)
|
||||
{
|
||||
|
|
@ -51,13 +51,13 @@ cinelerra_rwlock_init (CinelerraRWLock self)
|
|||
* @param self is a pointer to the rwlock to be initialized
|
||||
* @return self on success or NULL at error
|
||||
*/
|
||||
CinelerraRWLock
|
||||
cinelerra_rwlock_destroy (CinelerraRWLock self)
|
||||
LumieraRWLock
|
||||
lumiera_rwlock_destroy (LumieraRWLock self)
|
||||
{
|
||||
if (self)
|
||||
{
|
||||
if (pthread_rwlock_destroy (&self->rwlock))
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
@ -69,44 +69,44 @@ cinelerra_rwlock_destroy (CinelerraRWLock self)
|
|||
* initialize a rwlockacquirer state
|
||||
* @param self rwlockacquirer to be initialized, must be an automatic variable
|
||||
* @param rwlock associated rwlock
|
||||
* @param state initial state of the mutex, either CINELERRA_RDLOCKED, CINELERRA_WRLOCKED or CINELERRA_UNLOCKED
|
||||
* @param state initial state of the mutex, either LUMIERA_RDLOCKED, LUMIERA_WRLOCKED or LUMIERA_UNLOCKED
|
||||
* @return self as given or NULL on error
|
||||
*/
|
||||
CinelerraRWLockacquirer
|
||||
cinelerra_rwlockacquirer_init (CinelerraRWLockacquirer self, CinelerraRWLock rwlock, enum cinelerra_lockstate state)
|
||||
LumieraRWLockacquirer
|
||||
lumiera_rwlockacquirer_init (LumieraRWLockacquirer self, LumieraRWLock rwlock, enum lumiera_lockstate state)
|
||||
{
|
||||
REQUIRE (self);
|
||||
REQUIRE (rwlock);
|
||||
REQUIRE (state != CINELERRA_LOCKED, "illegal state for rwlock");
|
||||
REQUIRE (state != LUMIERA_LOCKED, "illegal state for rwlock");
|
||||
self->rwlock = rwlock;
|
||||
self->state = state;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case CINELERRA_RDLOCKED:
|
||||
case LUMIERA_RDLOCKED:
|
||||
switch (pthread_rwlock_rdlock (&rwlock->rwlock))
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case EAGAIN:
|
||||
cinelerra_error_set (CINELERRA_ERROR_RWLOCK_AGAIN);
|
||||
lumiera_error_set (LUMIERA_ERROR_RWLOCK_AGAIN);
|
||||
return NULL;
|
||||
case EDEADLK:
|
||||
cinelerra_error_set (CINELERRA_ERROR_RWLOCK_DEADLOCK);
|
||||
lumiera_error_set (LUMIERA_ERROR_RWLOCK_DEADLOCK);
|
||||
return NULL;
|
||||
default:
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
}
|
||||
case CINELERRA_WRLOCKED:
|
||||
case LUMIERA_WRLOCKED:
|
||||
switch (pthread_rwlock_wrlock (&rwlock->rwlock))
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case EDEADLK:
|
||||
cinelerra_error_set (CINELERRA_ERROR_RWLOCK_DEADLOCK);
|
||||
lumiera_error_set (LUMIERA_ERROR_RWLOCK_DEADLOCK);
|
||||
return NULL;
|
||||
default:
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
|
|
@ -121,27 +121,27 @@ cinelerra_rwlockacquirer_init (CinelerraRWLockacquirer self, CinelerraRWLock rwl
|
|||
* @param self rwlockacquirer associated with a rwlock
|
||||
* @return self as given or NULL on error
|
||||
*/
|
||||
CinelerraRWLockacquirer
|
||||
cinelerra_rwlockacquirer_rdlock (CinelerraRWLockacquirer self)
|
||||
LumieraRWLockacquirer
|
||||
lumiera_rwlockacquirer_rdlock (LumieraRWLockacquirer self)
|
||||
{
|
||||
REQUIRE (self);
|
||||
REQUIRE (self->state == CINELERRA_UNLOCKED, "rwlock already locked");
|
||||
REQUIRE (self->state == LUMIERA_UNLOCKED, "rwlock already locked");
|
||||
|
||||
switch (pthread_rwlock_rdlock (&self->rwlock->rwlock))
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case EAGAIN:
|
||||
cinelerra_error_set (CINELERRA_ERROR_RWLOCK_AGAIN);
|
||||
lumiera_error_set (LUMIERA_ERROR_RWLOCK_AGAIN);
|
||||
return NULL;
|
||||
case EDEADLK:
|
||||
cinelerra_error_set (CINELERRA_ERROR_RWLOCK_DEADLOCK);
|
||||
lumiera_error_set (LUMIERA_ERROR_RWLOCK_DEADLOCK);
|
||||
return NULL;
|
||||
default:
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
}
|
||||
|
||||
self->state = CINELERRA_RDLOCKED;
|
||||
self->state = LUMIERA_RDLOCKED;
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
@ -152,24 +152,24 @@ cinelerra_rwlockacquirer_rdlock (CinelerraRWLockacquirer self)
|
|||
* @param self rwlockacquirer associated with a rwlock
|
||||
* @return self as given or NULL on error
|
||||
*/
|
||||
CinelerraRWLockacquirer
|
||||
cinelerra_rwlockacquirer_wrlock (CinelerraRWLockacquirer self)
|
||||
LumieraRWLockacquirer
|
||||
lumiera_rwlockacquirer_wrlock (LumieraRWLockacquirer self)
|
||||
{
|
||||
REQUIRE (self);
|
||||
REQUIRE (self->state == CINELERRA_UNLOCKED, "rwlock already locked");
|
||||
REQUIRE (self->state == LUMIERA_UNLOCKED, "rwlock already locked");
|
||||
|
||||
switch (pthread_rwlock_wrlock (&self->rwlock->rwlock))
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case EDEADLK:
|
||||
cinelerra_error_set (CINELERRA_ERROR_RWLOCK_DEADLOCK);
|
||||
lumiera_error_set (LUMIERA_ERROR_RWLOCK_DEADLOCK);
|
||||
return NULL;
|
||||
default:
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
}
|
||||
|
||||
self->state = CINELERRA_WRLOCKED;
|
||||
self->state = LUMIERA_WRLOCKED;
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef CINELERRA_RWLOCK_H
|
||||
#define CINELERRA_RWLOCK_H
|
||||
#ifndef LUMIERA_RWLOCK_H
|
||||
#define LUMIERA_RWLOCK_H
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#error "This header must be included with _GNU_SOURCE or _POSIX_C_SOURCE >= 200112L defined"
|
||||
|
|
@ -31,8 +31,8 @@
|
|||
|
||||
#include "lib/locking.h"
|
||||
|
||||
CINELERRA_ERROR_DECLARE(RWLOCK_AGAIN);
|
||||
CINELERRA_ERROR_DECLARE(RWLOCK_DEADLOCK);
|
||||
LUMIERA_ERROR_DECLARE(RWLOCK_AGAIN);
|
||||
LUMIERA_ERROR_DECLARE(RWLOCK_DEADLOCK);
|
||||
|
||||
/**
|
||||
* @file Read/write locks, header.
|
||||
|
|
@ -43,20 +43,20 @@ CINELERRA_ERROR_DECLARE(RWLOCK_DEADLOCK);
|
|||
* RWLock.
|
||||
*
|
||||
*/
|
||||
struct cinelerra_rwlock_struct
|
||||
struct lumiera_rwlock_struct
|
||||
{
|
||||
pthread_rwlock_t rwlock;
|
||||
};
|
||||
typedef struct cinelerra_rwlock_struct cinelerra_rwlock;
|
||||
typedef cinelerra_rwlock* CinelerraRWLock;
|
||||
typedef struct lumiera_rwlock_struct lumiera_rwlock;
|
||||
typedef lumiera_rwlock* LumieraRWLock;
|
||||
|
||||
|
||||
CinelerraRWLock
|
||||
cinelerra_rwlock_init (CinelerraRWLock self);
|
||||
LumieraRWLock
|
||||
lumiera_rwlock_init (LumieraRWLock self);
|
||||
|
||||
|
||||
CinelerraRWLock
|
||||
cinelerra_rwlock_destroy (CinelerraRWLock self);
|
||||
LumieraRWLock
|
||||
lumiera_rwlock_destroy (LumieraRWLock self);
|
||||
|
||||
|
||||
|
||||
|
|
@ -64,35 +64,35 @@ cinelerra_rwlock_destroy (CinelerraRWLock self);
|
|||
/**
|
||||
* rwlockacquirer used to manage the state of a rwlock variable.
|
||||
*/
|
||||
struct cinelerra_rwlockacquirer_struct
|
||||
struct lumiera_rwlockacquirer_struct
|
||||
{
|
||||
CinelerraRWLock rwlock;
|
||||
enum cinelerra_lockstate state;
|
||||
LumieraRWLock rwlock;
|
||||
enum lumiera_lockstate state;
|
||||
};
|
||||
typedef struct cinelerra_rwlockacquirer_struct cinelerra_rwlockacquirer;
|
||||
typedef struct cinelerra_rwlockacquirer_struct* CinelerraRWLockacquirer;
|
||||
typedef struct lumiera_rwlockacquirer_struct lumiera_rwlockacquirer;
|
||||
typedef struct lumiera_rwlockacquirer_struct* LumieraRWLockacquirer;
|
||||
|
||||
/* helper function for nobug */
|
||||
static inline void
|
||||
cinelerra_rwlockacquirer_ensureunlocked (CinelerraRWLockacquirer self)
|
||||
lumiera_rwlockacquirer_ensureunlocked (LumieraRWLockacquirer self)
|
||||
{
|
||||
ENSURE (self->state == CINELERRA_UNLOCKED, "forgot to unlock the rwlock mutex");
|
||||
ENSURE (self->state == LUMIERA_UNLOCKED, "forgot to unlock the rwlock mutex");
|
||||
}
|
||||
|
||||
/* override with a macro to use the cleanup checker */
|
||||
#define cinelerra_rwlockacquirer \
|
||||
cinelerra_rwlockacquirer NOBUG_CLEANUP(cinelerra_rwlockacquirer_ensureunlocked)
|
||||
#define lumiera_rwlockacquirer \
|
||||
lumiera_rwlockacquirer NOBUG_CLEANUP(lumiera_rwlockacquirer_ensureunlocked)
|
||||
|
||||
|
||||
CinelerraRWLockacquirer
|
||||
cinelerra_rwlockacquirer_init (CinelerraRWLockacquirer self, CinelerraRWLock rwlock, enum cinelerra_lockstate state);
|
||||
LumieraRWLockacquirer
|
||||
lumiera_rwlockacquirer_init (LumieraRWLockacquirer self, LumieraRWLock rwlock, enum lumiera_lockstate state);
|
||||
|
||||
CinelerraRWLockacquirer
|
||||
cinelerra_rwlockacquirer_rdlock (CinelerraRWLockacquirer self);
|
||||
LumieraRWLockacquirer
|
||||
lumiera_rwlockacquirer_rdlock (LumieraRWLockacquirer self);
|
||||
|
||||
|
||||
CinelerraRWLockacquirer
|
||||
cinelerra_rwlockacquirer_wrlock (CinelerraRWLockacquirer self);
|
||||
LumieraRWLockacquirer
|
||||
lumiera_rwlockacquirer_wrlock (LumieraRWLockacquirer self);
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -101,13 +101,13 @@ cinelerra_rwlockacquirer_wrlock (CinelerraRWLockacquirer self);
|
|||
* @param self rwlockacquirer associated with a rwlock variable
|
||||
*/
|
||||
static inline void
|
||||
cinelerra_rwlockacquirer_unlock (CinelerraRWLockacquirer self)
|
||||
lumiera_rwlockacquirer_unlock (LumieraRWLockacquirer self)
|
||||
{
|
||||
REQUIRE (self);
|
||||
REQUIRE (self->state != CINELERRA_UNLOCKED, "rwlock was not locked");
|
||||
REQUIRE (self->state != LUMIERA_UNLOCKED, "rwlock was not locked");
|
||||
if (pthread_rwlock_unlock (&self->rwlock->rwlock))
|
||||
CINELERRA_DIE;
|
||||
self->state = CINELERRA_UNLOCKED;
|
||||
LUMIERA_DIE;
|
||||
self->state = LUMIERA_UNLOCKED;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,6 @@
|
|||
|
||||
#include "lib/error.h"
|
||||
|
||||
CINELERRA_ERROR_DEFINE(TIME_OVERFLOW, "Time overflow");
|
||||
CINELERRA_ERROR_DEFINE(TIME_UNDERFLOW, "Time underflow");
|
||||
CINELERRA_ERROR_DEFINE(TIME_NEGATIVE, "Time negative");
|
||||
LUMIERA_ERROR_DEFINE(TIME_OVERFLOW, "Time overflow");
|
||||
LUMIERA_ERROR_DEFINE(TIME_UNDERFLOW, "Time underflow");
|
||||
LUMIERA_ERROR_DEFINE(TIME_NEGATIVE, "Time negative");
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@
|
|||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef CINELERRA_TIME_H
|
||||
#define CINELERRA_TIME_H
|
||||
#ifndef LUMIERA_TIME_H
|
||||
#define LUMIERA_TIME_H
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
|
@ -35,31 +35,31 @@
|
|||
|
||||
timehandling is a delicate business, be careful of precision errors accumulating
|
||||
|
||||
cinelerra_time is starting from zero, never becomes negative.
|
||||
lumiera_time is starting from zero, never becomes negative.
|
||||
|
||||
TODO explain how to use time
|
||||
|
||||
*/
|
||||
|
||||
/* over or underflow (tried to make a movie which has negative length? or more than some hundreds days?) */
|
||||
CINELERRA_ERROR_DECLARE(TIME_OVERFLOW);
|
||||
CINELERRA_ERROR_DECLARE(TIME_UNDERFLOW);
|
||||
CINELERRA_ERROR_DECLARE(TIME_NEGATIVE);
|
||||
LUMIERA_ERROR_DECLARE(TIME_OVERFLOW);
|
||||
LUMIERA_ERROR_DECLARE(TIME_UNDERFLOW);
|
||||
LUMIERA_ERROR_DECLARE(TIME_NEGATIVE);
|
||||
|
||||
/*
|
||||
Note: we measure time starting from zero,
|
||||
time never becomes negative
|
||||
(I didnt checked if the time types are signed)
|
||||
*/
|
||||
typedef struct timeval cinelerra_time;
|
||||
typedef cinelerra_time* CinelerraTime;
|
||||
typedef struct timeval lumiera_time;
|
||||
typedef lumiera_time* LumieraTime;
|
||||
|
||||
/**
|
||||
* normalize time after operations.
|
||||
* used internally
|
||||
*/
|
||||
static inline void
|
||||
cinelerra_time_normalize (CinelerraTime time)
|
||||
lumiera_time_normalize (LumieraTime time)
|
||||
{
|
||||
REQUIRE (time);
|
||||
if (time->tv_usec >= 1000000)
|
||||
|
|
@ -75,8 +75,8 @@ cinelerra_time_normalize (CinelerraTime time)
|
|||
* @param time Time to clear
|
||||
* @return time as given
|
||||
*/
|
||||
static inline CinelerraTime
|
||||
cinelerra_time_clear (CinelerraTime time)
|
||||
static inline LumieraTime
|
||||
lumiera_time_clear (LumieraTime time)
|
||||
{
|
||||
if(time)
|
||||
{
|
||||
|
|
@ -91,14 +91,14 @@ cinelerra_time_clear (CinelerraTime time)
|
|||
* @param time Time to put current time into.
|
||||
* @return time as given
|
||||
*/
|
||||
static inline CinelerraTime
|
||||
cinelerra_time_current (CinelerraTime time)
|
||||
static inline LumieraTime
|
||||
lumiera_time_current (LumieraTime time)
|
||||
{
|
||||
if (time)
|
||||
{
|
||||
/* gettime should never ever fail in a correct program */
|
||||
if (gettimeofday (time, NULL))
|
||||
CINELERRA_DIE;
|
||||
LUMIERA_DIE;
|
||||
}
|
||||
return time;
|
||||
}
|
||||
|
|
@ -110,8 +110,8 @@ cinelerra_time_current (CinelerraTime time)
|
|||
* @return time as given upon success, NULL if double time given was negative or given time didn't point
|
||||
* anywhere
|
||||
*/
|
||||
static inline CinelerraTime
|
||||
cinelerra_time_set_double (CinelerraTime time, double fp)
|
||||
static inline LumieraTime
|
||||
lumiera_time_set_double (LumieraTime time, double fp)
|
||||
{
|
||||
if (time)
|
||||
{
|
||||
|
|
@ -125,7 +125,7 @@ cinelerra_time_set_double (CinelerraTime time, double fp)
|
|||
{
|
||||
time->tv_sec = (time_t)-1;
|
||||
time->tv_usec = (suseconds_t)-1;
|
||||
cinelerra_error_set(CINELERRA_ERROR_TIME_NEGATIVE);
|
||||
lumiera_error_set(LUMIERA_ERROR_TIME_NEGATIVE);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
|
@ -138,14 +138,14 @@ cinelerra_time_set_double (CinelerraTime time, double fp)
|
|||
* @param usec Microseconds to set
|
||||
* @param Time as given
|
||||
*/
|
||||
static inline CinelerraTime
|
||||
cinelerra_time_init (CinelerraTime time, time_t sec, suseconds_t usec)
|
||||
static inline LumieraTime
|
||||
lumiera_time_init (LumieraTime time, time_t sec, suseconds_t usec)
|
||||
{
|
||||
if (time)
|
||||
{
|
||||
time->tv_sec = sec;
|
||||
time->tv_usec = usec;
|
||||
cinelerra_time_normalize (time);
|
||||
lumiera_time_normalize (time);
|
||||
}
|
||||
return time;
|
||||
}
|
||||
|
|
@ -156,7 +156,7 @@ cinelerra_time_init (CinelerraTime time, time_t sec, suseconds_t usec)
|
|||
* @return Seconds elapsed, -1 on error
|
||||
*/
|
||||
static inline time_t
|
||||
cinelerra_time_sec (CinelerraTime time)
|
||||
lumiera_time_sec (LumieraTime time)
|
||||
{
|
||||
if (time)
|
||||
return time->tv_sec;
|
||||
|
|
@ -170,7 +170,7 @@ cinelerra_time_sec (CinelerraTime time)
|
|||
* @return Microseconds elapsed, -1 on error
|
||||
*/
|
||||
static inline suseconds_t
|
||||
cinelerra_time_usec (CinelerraTime time)
|
||||
lumiera_time_usec (LumieraTime time)
|
||||
{
|
||||
if (time)
|
||||
return time->tv_usec;
|
||||
|
|
@ -184,7 +184,7 @@ cinelerra_time_usec (CinelerraTime time)
|
|||
* @return Floating point representation of time. NAN on error.
|
||||
*/
|
||||
static inline double
|
||||
cinelerra_time_double_get (CinelerraTime time)
|
||||
lumiera_time_double_get (LumieraTime time)
|
||||
{
|
||||
if (time)
|
||||
{
|
||||
|
|
@ -204,8 +204,8 @@ cinelerra_time_double_get (CinelerraTime time)
|
|||
* @param src Time-source to copy from
|
||||
* @return dest as given
|
||||
*/
|
||||
static inline CinelerraTime
|
||||
cinelerra_time_copy (CinelerraTime dest, const CinelerraTime src)
|
||||
static inline LumieraTime
|
||||
lumiera_time_copy (LumieraTime dest, const LumieraTime src)
|
||||
{
|
||||
if (dest && src)
|
||||
{
|
||||
|
|
@ -221,8 +221,8 @@ cinelerra_time_copy (CinelerraTime dest, const CinelerraTime src)
|
|||
* @param src Time to add to dest
|
||||
* @return dest as given, or NULL on overflow.
|
||||
*/
|
||||
static inline CinelerraTime
|
||||
cinelerra_time_add (CinelerraTime dest, const CinelerraTime src)
|
||||
static inline LumieraTime
|
||||
lumiera_time_add (LumieraTime dest, const LumieraTime src)
|
||||
{
|
||||
if (dest && src)
|
||||
{
|
||||
|
|
@ -231,11 +231,11 @@ cinelerra_time_add (CinelerraTime dest, const CinelerraTime src)
|
|||
dest->tv_sec += src->tv_sec;
|
||||
dest->tv_usec += src->tv_usec;
|
||||
|
||||
cinelerra_time_normalize (dest);
|
||||
lumiera_time_normalize (dest);
|
||||
|
||||
if (dest->tv_sec < t)
|
||||
{
|
||||
cinelerra_error_set (CINELERRA_ERROR_TIME_OVERFLOW);
|
||||
lumiera_error_set (LUMIERA_ERROR_TIME_OVERFLOW);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
@ -248,8 +248,8 @@ cinelerra_time_add (CinelerraTime dest, const CinelerraTime src)
|
|||
* @param src Time to subtract from dest
|
||||
* @return dest as given, or NULL on underflow.
|
||||
*/
|
||||
static inline CinelerraTime
|
||||
cinelerra_time_sub (CinelerraTime dest, const CinelerraTime src)
|
||||
static inline LumieraTime
|
||||
lumiera_time_sub (LumieraTime dest, const LumieraTime src)
|
||||
{
|
||||
if (dest && src)
|
||||
{
|
||||
|
|
@ -264,11 +264,11 @@ cinelerra_time_sub (CinelerraTime dest, const CinelerraTime src)
|
|||
dest->tv_usec += 1000000 - src->tv_usec;
|
||||
}
|
||||
|
||||
cinelerra_time_normalize (dest);
|
||||
lumiera_time_normalize (dest);
|
||||
|
||||
if (dest->tv_sec > t)
|
||||
{
|
||||
cinelerra_error_set (CINELERRA_ERROR_TIME_UNDERFLOW);
|
||||
lumiera_error_set (LUMIERA_ERROR_TIME_UNDERFLOW);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
CINELERRA.h - global definitions and common types
|
||||
LUMIERA.h - global definitions and common types
|
||||
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
*/
|
||||
|
||||
#ifndef CINELERRA_H
|
||||
#define CINELERRA_H
|
||||
#ifndef LUMIERA_H
|
||||
#define LUMIERA_H
|
||||
|
||||
|
||||
|
||||
|
|
@ -54,13 +54,13 @@ extern "C" {
|
|||
#include "common/error.hpp"
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
/* additional global configuration goes here... */
|
||||
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
||||
#endif /* ===================== (End) C++-Part ================= */
|
||||
|
||||
#endif /*CINELERRA_H*/
|
||||
#endif /*LUMIERA_H*/
|
||||
|
|
@ -23,11 +23,11 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
#include "cinelerra.h"
|
||||
#include "lumiera.h"
|
||||
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
using cinelerra::Appconfig;
|
||||
using lumiera::Appconfig;
|
||||
|
||||
|
||||
int main (int argc, char* argv[])
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
** 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
|
||||
** included by lumiera.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
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
/*
|
||||
* hello.c - demonstrates how to build a standalone tool (C source)
|
||||
* integrated into the SCons based build system of Cinelerra
|
||||
* integrated into the SCons based build system of Lumiera
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
printf("hello cinelerra world");
|
||||
printf("hello lumiera world");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@
|
|||
** @see mobject.hpp usage example
|
||||
*/
|
||||
|
||||
#ifndef CINELERRA_PRE_HPP
|
||||
#define CINELERRA_PRE_HPP
|
||||
#ifndef LUMIERA_PRE_HPP
|
||||
#define LUMIERA_PRE_HPP
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
|
@ -44,8 +44,8 @@
|
|||
#include <boost/format.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
#include "cinelerra.h"
|
||||
#include "lumiera.h"
|
||||
|
||||
|
||||
|
||||
#endif /*CINELERRA_PRE_HPP*/
|
||||
#endif /*LUMIERA_PRE_HPP*/
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ namespace asset
|
|||
|
||||
/**change the enablement status of this asset. */
|
||||
bool
|
||||
Asset::enable (bool on) throw(cinelerra::error::State)
|
||||
Asset::enable (bool on) throw(lumiera::error::State)
|
||||
{
|
||||
if (on == this->enabled)
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ namespace asset
|
|||
/** origin or authorship id.
|
||||
* Can be a project abbreviation, a package id or just the authors nickname or UID.
|
||||
* This allows for the compnent name to be more generic (e.g. "blur").
|
||||
* Default for all assets provided by the core cinelerra-3 codebase is "cin3".
|
||||
* Default for all assets provided by the core Lumiera codebase is "lumi".
|
||||
*/
|
||||
const string org;
|
||||
|
||||
|
|
@ -284,7 +284,7 @@ namespace asset
|
|||
* @return \c false if the state could not be changed
|
||||
* due to parent objects being disabled
|
||||
*/
|
||||
bool enable (bool on=true) throw(cinelerra::error::State);
|
||||
bool enable (bool on=true) throw(lumiera::error::State);
|
||||
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ namespace asset
|
|||
DB () : table() { }
|
||||
~DB () {clear();}
|
||||
|
||||
friend class cinelerra::singleton::StaticCreate<DB>;
|
||||
friend class lumiera::singleton::StaticCreate<DB>;
|
||||
|
||||
|
||||
public:
|
||||
|
|
@ -125,7 +125,7 @@ namespace asset
|
|||
|
||||
table.clear();
|
||||
}
|
||||
catch (cinelerra::Error& EX)
|
||||
catch (lumiera::Error& EX)
|
||||
{
|
||||
WARN (oper, "Problems while clearing Asset registry: %s", EX.what());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ namespace asset
|
|||
}
|
||||
|
||||
|
||||
cinelerra::Time
|
||||
lumiera::Time
|
||||
Media::getLength() const
|
||||
{
|
||||
return len_;
|
||||
|
|
@ -177,7 +177,7 @@ namespace asset
|
|||
MediaFactory::PType
|
||||
MediaFactory::operator() (const string& file, const Category& cat)
|
||||
{
|
||||
Asset::Ident key(extractName(file), cat, "cin3", 1);
|
||||
Asset::Ident key(extractName(file), cat, "lumi", 1);
|
||||
return operator() (key, file);
|
||||
}
|
||||
|
||||
|
|
@ -220,21 +220,21 @@ namespace asset
|
|||
* but rather part or a multichannel (compound) media
|
||||
*/
|
||||
shared_ptr<asset::Clip>
|
||||
MediaFactory::operator() (asset::Media& mediaref) throw(cinelerra::error::Invalid)
|
||||
MediaFactory::operator() (asset::Media& mediaref) throw(lumiera::error::Invalid)
|
||||
{
|
||||
if (mediaref.checkCompound())
|
||||
throw cinelerra::error::Invalid (str(format("Attempt to create a asset::Clip from the media %s, "
|
||||
"which is not toplevel but rather part or a compound "
|
||||
"(multichannel) media. Found parent Media %s.")
|
||||
% string(mediaref)
|
||||
% string(*mediaref.checkCompound()))
|
||||
,CINELERRA_ERROR_PART_OF_COMPOUND
|
||||
);
|
||||
throw lumiera::error::Invalid (str(format("Attempt to create a asset::Clip from the media %s, "
|
||||
"which is not toplevel but rather part or a compound "
|
||||
"(multichannel) media. Found parent Media %s.")
|
||||
% string(mediaref)
|
||||
% string(*mediaref.checkCompound()))
|
||||
,LUMIERA_ERROR_PART_OF_COMPOUND
|
||||
);
|
||||
asset::Clip* pC = new asset::Clip (mediaref);
|
||||
return AssetManager::instance().getPtr (*pC);
|
||||
}
|
||||
|
||||
CINELERRA_ERROR_DEFINE (PART_OF_COMPOUND, "part of compound used as toplevel element");
|
||||
LUMIERA_ERROR_DEFINE (PART_OF_COMPOUND, "part of compound used as toplevel element");
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ namespace asset
|
|||
class MediaFactory;
|
||||
class ProcPatt;
|
||||
|
||||
using cinelerra::Time;
|
||||
using lumiera::Time;
|
||||
|
||||
|
||||
template<>
|
||||
|
|
@ -137,7 +137,7 @@ namespace asset
|
|||
/**
|
||||
* Factory specialized for creating Media Asset objects.
|
||||
*/
|
||||
class MediaFactory : public cinelerra::Factory<asset::Media>
|
||||
class MediaFactory : public lumiera::Factory<asset::Media>
|
||||
{
|
||||
public:
|
||||
typedef shared_ptr<asset::Media> PType;
|
||||
|
|
@ -151,11 +151,11 @@ namespace asset
|
|||
PType operator() (const char* file, asset::Kind);
|
||||
|
||||
shared_ptr<asset::Clip>
|
||||
operator() (asset::Media& mediaref) throw(cinelerra::error::Invalid);
|
||||
operator() (asset::Media& mediaref) throw(lumiera::error::Invalid);
|
||||
|
||||
};
|
||||
|
||||
CINELERRA_ERROR_DECLARE (PART_OF_COMPOUND);
|
||||
LUMIERA_ERROR_DECLARE (PART_OF_COMPOUND);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace asset
|
|||
/**
|
||||
* Factory specialized for createing Metadata Asset objects.
|
||||
*/
|
||||
class MetaFactory : public cinelerra::Factory<asset::Meta>
|
||||
class MetaFactory : public lumiera::Factory<asset::Meta>
|
||||
{
|
||||
public:
|
||||
typedef shared_ptr<asset::Meta> PType;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace asset
|
|||
/**
|
||||
* Factory specialized for createing Processor Asset objects.
|
||||
*/
|
||||
class ProcFactory : public cinelerra::Factory<asset::Proc>
|
||||
class ProcFactory : public lumiera::Factory<asset::Proc>
|
||||
{
|
||||
public:
|
||||
typedef shared_ptr<asset::Proc> PType;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ namespace asset
|
|||
/**
|
||||
* Factory specialized for createing Structural Asset objects.
|
||||
*/
|
||||
class StructFactory : public cinelerra::Factory<asset::Struct>
|
||||
class StructFactory : public lumiera::Factory<asset::Struct>
|
||||
{
|
||||
public:
|
||||
typedef shared_ptr<asset::Struct> PType;
|
||||
|
|
|
|||
|
|
@ -48,19 +48,19 @@ namespace asset
|
|||
* try to access the "real" media it stands for.
|
||||
*/
|
||||
Media::PMedia
|
||||
Unknown::getOrg() throw(cinelerra::error::Invalid)
|
||||
Unknown::getOrg() throw(lumiera::error::Invalid)
|
||||
{
|
||||
UNIMPLEMENTED ("how to get at the original media from a »Unknown« placeholder");
|
||||
if (1==0)
|
||||
throw cinelerra::error::Invalid (str(format("Unable to locate original media "
|
||||
"for ID=%s, filename=\"%s\".")
|
||||
% string(this->ident)
|
||||
% string(this->getFilename()))
|
||||
,CINELERRA_ERROR_ORIG_NOT_FOUND
|
||||
);
|
||||
throw lumiera::error::Invalid (str(format("Unable to locate original media "
|
||||
"for ID=%s, filename=\"%s\".")
|
||||
% string(this->ident)
|
||||
% string(this->getFilename()))
|
||||
,LUMIERA_ERROR_ORIG_NOT_FOUND
|
||||
);
|
||||
}
|
||||
|
||||
CINELERRA_ERROR_DEFINE (ORIG_NOT_FOUND, "Media refered by placeholder not found");
|
||||
LUMIERA_ERROR_DEFINE (ORIG_NOT_FOUND, "Media refered by placeholder not found");
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace asset
|
|||
{
|
||||
|
||||
|
||||
const cinelerra::Time DUMMY_TIME (25); ///< @todo solve konfig management
|
||||
const lumiera::Time DUMMY_TIME (25); ///< @todo solve konfig management
|
||||
|
||||
/**
|
||||
* Placeholder Asset for unknown or unavailable media source.
|
||||
|
|
@ -47,11 +47,11 @@ namespace asset
|
|||
friend class MediaFactory;
|
||||
|
||||
public:
|
||||
virtual Media::PMedia getOrg() throw(cinelerra::error::Invalid);
|
||||
virtual Media::PMedia getOrg() throw(lumiera::error::Invalid);
|
||||
|
||||
};
|
||||
|
||||
CINELERRA_ERROR_DECLARE (ORIG_NOT_FOUND);
|
||||
LUMIERA_ERROR_DECLARE (ORIG_NOT_FOUND);
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ using boost::format;
|
|||
using boost::bind;
|
||||
using util::for_each;
|
||||
|
||||
using cinelerra::Singleton;
|
||||
using cinelerra::Thread;
|
||||
using lumiera::Singleton;
|
||||
using lumiera::Thread;
|
||||
|
||||
|
||||
namespace asset
|
||||
|
|
@ -49,23 +49,23 @@ namespace asset
|
|||
* AssetManager error responses, caused by querying
|
||||
* invalid Asset IDs from the internal DB.
|
||||
*/
|
||||
class IDErr : public cinelerra::error::Invalid
|
||||
class IDErr : public lumiera::error::Invalid
|
||||
{
|
||||
public:
|
||||
IDErr (const char* eID, format fmt)
|
||||
: cinelerra::error::Invalid(fmt.str(),eID) {}
|
||||
: lumiera::error::Invalid(fmt.str(),eID) {}
|
||||
};
|
||||
|
||||
|
||||
// ------pre-defined-common-error-cases---------------
|
||||
//
|
||||
CINELERRA_ERROR_DEFINE (UNKNOWN_ASSET_ID, "non-registered Asset ID");
|
||||
CINELERRA_ERROR_DEFINE (WRONG_ASSET_KIND, "wrong Asset kind, unable to cast");
|
||||
LUMIERA_ERROR_DEFINE (UNKNOWN_ASSET_ID, "non-registered Asset ID");
|
||||
LUMIERA_ERROR_DEFINE (WRONG_ASSET_KIND, "wrong Asset kind, unable to cast");
|
||||
|
||||
class UnknownID : public IDErr
|
||||
{
|
||||
public:
|
||||
UnknownID (ID<Asset> aID) : IDErr (CINELERRA_ERROR_UNKNOWN_ASSET_ID,
|
||||
UnknownID (ID<Asset> aID) : IDErr (LUMIERA_ERROR_UNKNOWN_ASSET_ID,
|
||||
format("Query for Asset with ID=%d, which up to now "
|
||||
"hasn't been created or encountered.") % aID) {}
|
||||
};
|
||||
|
|
@ -73,7 +73,7 @@ namespace asset
|
|||
class WrongKind : public IDErr
|
||||
{
|
||||
public:
|
||||
WrongKind (Asset::Ident idi) : IDErr (CINELERRA_ERROR_WRONG_ASSET_KIND,
|
||||
WrongKind (Asset::Ident idi) : IDErr (LUMIERA_ERROR_WRONG_ASSET_KIND,
|
||||
format("Request for Asset(%s), specifying an Asset kind, "
|
||||
"that doesn't match the actual type (and can't be "
|
||||
"casted either).") % string(idi)) {}
|
||||
|
|
@ -110,7 +110,7 @@ namespace asset
|
|||
template<class KIND>
|
||||
ID<KIND>
|
||||
AssetManager::reg (KIND* obj, const Asset::Ident& idi)
|
||||
throw(cinelerra::error::Invalid)
|
||||
throw(lumiera::error::Invalid)
|
||||
{
|
||||
typedef shared_ptr<KIND> PType;
|
||||
AssetManager& _aMang (AssetManager::instance());
|
||||
|
|
@ -133,7 +133,7 @@ namespace asset
|
|||
template<class KIND>
|
||||
shared_ptr<KIND>
|
||||
AssetManager::getAsset (const ID<KIND>& id)
|
||||
throw(cinelerra::error::Invalid)
|
||||
throw(lumiera::error::Invalid)
|
||||
{
|
||||
if (shared_ptr<KIND> obj = registry.get (id))
|
||||
return obj;
|
||||
|
|
@ -243,11 +243,11 @@ namespace asset
|
|||
template ID<Asset> AssetManager::reg (Asset* obj, const Asset::Ident& idi);
|
||||
|
||||
|
||||
template shared_ptr<Asset> AssetManager::getAsset (const ID<Asset>& id) throw(cinelerra::error::Invalid);
|
||||
template shared_ptr<Media> AssetManager::getAsset (const ID<Media>& id) throw(cinelerra::error::Invalid);
|
||||
template shared_ptr<Proc> AssetManager::getAsset (const ID<Proc>& id) throw(cinelerra::error::Invalid);
|
||||
template shared_ptr<Struct> AssetManager::getAsset (const ID<Struct>& id) throw(cinelerra::error::Invalid);
|
||||
template shared_ptr<Meta> AssetManager::getAsset (const ID<Meta>& id) throw(cinelerra::error::Invalid);
|
||||
template shared_ptr<Asset> AssetManager::getAsset (const ID<Asset>& id) throw(lumiera::error::Invalid);
|
||||
template shared_ptr<Media> AssetManager::getAsset (const ID<Media>& id) throw(lumiera::error::Invalid);
|
||||
template shared_ptr<Proc> AssetManager::getAsset (const ID<Proc>& id) throw(lumiera::error::Invalid);
|
||||
template shared_ptr<Struct> AssetManager::getAsset (const ID<Struct>& id) throw(lumiera::error::Invalid);
|
||||
template shared_ptr<Meta> AssetManager::getAsset (const ID<Meta>& id) throw(lumiera::error::Invalid);
|
||||
|
||||
template shared_ptr<Asset> AssetManager::getPtr (const Asset& asset);
|
||||
template shared_ptr<Media> AssetManager::getPtr (const Media& asset);
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ namespace asset
|
|||
|
||||
|
||||
public:
|
||||
static cinelerra::Singleton<AssetManager> instance;
|
||||
static lumiera::Singleton<AssetManager> instance;
|
||||
|
||||
/** provide the unique ID for given Asset::Ident tuple */
|
||||
static ID<Asset> getID (const Asset::Ident&);
|
||||
|
|
@ -77,7 +77,7 @@ namespace asset
|
|||
|
||||
/** find and return corresponging object */
|
||||
template<class KIND>
|
||||
shared_ptr<KIND> getAsset (const ID<KIND>& id) throw(cinelerra::error::Invalid);
|
||||
shared_ptr<KIND> getAsset (const ID<KIND>& id) throw(lumiera::error::Invalid);
|
||||
|
||||
|
||||
/** @return true if the given id is registered in the internal asset DB */
|
||||
|
|
@ -101,7 +101,7 @@ namespace asset
|
|||
*/
|
||||
template<class KIND>
|
||||
static ID<KIND> reg (KIND* obj, const Asset::Ident& idi)
|
||||
throw(cinelerra::error::Invalid);
|
||||
throw(lumiera::error::Invalid);
|
||||
|
||||
/** deleter function used by the Asset smart pointers to delete Asset objects */
|
||||
static void destroy (Asset* aa) { delete aa; }
|
||||
|
|
@ -110,13 +110,13 @@ namespace asset
|
|||
|
||||
AssetManager ();
|
||||
|
||||
friend class cinelerra::singleton::StaticCreate<AssetManager>;
|
||||
friend class lumiera::singleton::StaticCreate<AssetManager>;
|
||||
|
||||
};
|
||||
|
||||
|
||||
CINELERRA_ERROR_DECLARE (UNKNOWN_ASSET_ID); ///< use of a non-registered Asset ID.
|
||||
CINELERRA_ERROR_DECLARE (WRONG_ASSET_KIND); ///< Asset ID of wrong Asset kind, unable to cast.
|
||||
LUMIERA_ERROR_DECLARE (UNKNOWN_ASSET_ID); ///< use of a non-registered Asset ID.
|
||||
LUMIERA_ERROR_DECLARE (WRONG_ASSET_KIND); ///< Asset ID of wrong Asset kind, unable to cast.
|
||||
|
||||
} // namespace asset
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ namespace engine
|
|||
* process thus is integrated into the framework
|
||||
* of the Renderengine, while the actual implementation
|
||||
* can be delegated to an external library accessed
|
||||
* through Cinelerra's datat backend.
|
||||
* through Lumiera's data backend.
|
||||
*/
|
||||
class CodecAdapter : public Trafo
|
||||
{};
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ namespace engine
|
|||
/**
|
||||
* Adapter used to integrate an effects processor in the render pipeline.
|
||||
* Effects processors are typically defined in a separate library and
|
||||
* will be loaded at runtime using Cinelerra's plugin interface.
|
||||
* will be loaded at runtime using Lumiera's plugin interface.
|
||||
*/
|
||||
class PluginAdapter : public Trafo
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#ifndef ENGINE_PROCESSOR_H
|
||||
#define ENGINE_PROCESSOR_H
|
||||
|
||||
#include "cinelerra.h"
|
||||
#include "lumiera.h"
|
||||
#include "proc/stateproxy.hpp"
|
||||
|
||||
|
||||
|
|
@ -40,10 +40,10 @@ namespace engine
|
|||
ExitNode * output;
|
||||
|
||||
/** begin of the timerange covered by this processor */
|
||||
cinelerra::Time start;
|
||||
lumiera::Time start;
|
||||
|
||||
/**end (exclusive) of the timerange */
|
||||
cinelerra::Time end;
|
||||
lumiera::Time end;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ namespace mobject
|
|||
* an instantiation of the "Applicable" template parametrized with all
|
||||
* concrete Buildable classes, for which it wants calls to be dispatched.
|
||||
*/
|
||||
typedef cinelerra::visitor::Tool<void, InvokeCatchAllFunction> BuilderTool;
|
||||
typedef lumiera::visitor::Tool<void, InvokeCatchAllFunction> BuilderTool;
|
||||
|
||||
|
||||
template
|
||||
|
|
@ -67,11 +67,11 @@ namespace mobject
|
|||
class TYPELIST // list of all concrete Buildables to be treated
|
||||
>
|
||||
class Applicable
|
||||
: public cinelerra::visitor::Applicable<TOOLImpl, TYPELIST, BuilderTool>
|
||||
: public lumiera::visitor::Applicable<TOOLImpl, TYPELIST, BuilderTool>
|
||||
{ }
|
||||
;
|
||||
|
||||
using cinelerra::typelist::Types; // convienience for the users of "Applicable"
|
||||
using lumiera::typelist::Types; // convienience for the users of "Applicable"
|
||||
|
||||
} // namespace mobject::builder
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ namespace mobject
|
|||
/**
|
||||
* Marker Interface for classes Visitable by Builder tools.
|
||||
*/
|
||||
class Buildable : public cinelerra::visitor::Visitable<builder::BuilderTool>
|
||||
class Buildable : public lumiera::visitor::Visitable<builder::BuilderTool>
|
||||
{ };
|
||||
|
||||
} // namespace mobject
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
#include <list>
|
||||
#include <tr1/memory>
|
||||
|
||||
#include "cinelerra.h"
|
||||
#include "lumiera.h"
|
||||
#include "proc/mobject/builder/buildertool.hpp"
|
||||
#include "proc/mobject/placement.hpp"
|
||||
#include "proc/asset.hpp" // TODO finally not needed?
|
||||
|
|
@ -55,13 +55,13 @@ namespace mobject
|
|||
/**
|
||||
* MObject is the interface class for all "Media Objects".
|
||||
* All the contents and elements that can be placed and
|
||||
* manipulated and finally rendered within Cinelerra's EDL
|
||||
* manipulated and finally rendered within Lumiera's EDL
|
||||
* are MObjects.
|
||||
*/
|
||||
class MObject : public Buildable
|
||||
{
|
||||
protected:
|
||||
typedef cinelerra::Time Time;
|
||||
typedef lumiera::Time Time;
|
||||
|
||||
// TODO: how to represent time intervals best?
|
||||
Time length;
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ namespace mobject
|
|||
class Placement : protected shared_ptr<MO>
|
||||
{
|
||||
protected:
|
||||
typedef cinelerra::Time Time;
|
||||
typedef lumiera::Time Time;
|
||||
typedef session::Track* Track;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ namespace mobject
|
|||
/**
|
||||
* The (current) Session holds all the user
|
||||
* visible content to be edited and manipulated
|
||||
* within the Cinelerra Application. From a users
|
||||
* within the Lumiera Application. From a users
|
||||
* perspective, it is a collection of Media Objects
|
||||
* (--> MObject) placed (--> Placement) onto virtual
|
||||
* Tracks.
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
#define MOBJECT_SESSION_LOCATINGPIN_H
|
||||
|
||||
|
||||
#include "cinelerra.h"
|
||||
#include "lumiera.h"
|
||||
|
||||
#include <utility>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
|
@ -79,7 +79,7 @@ namespace mobject
|
|||
class LocatingPin
|
||||
{
|
||||
protected:
|
||||
typedef cinelerra::Time Time;
|
||||
typedef lumiera::Time Time;
|
||||
typedef session::Track* Track;
|
||||
typedef std::pair<Time,Track> SolutionData; //TODO (ichthyo consideres better passing of solution by subclass)
|
||||
struct LocatingSolution;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <list>
|
||||
|
||||
#include "cinelerra.h"
|
||||
#include "lumiera.h"
|
||||
#include "proc/mobject/explicitplacement.hpp"
|
||||
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ namespace mobject
|
|||
class Segment
|
||||
{
|
||||
protected:
|
||||
typedef cinelerra::Time Time;
|
||||
typedef lumiera::Time Time;
|
||||
|
||||
/** begin of this timeline segment. */
|
||||
Time start;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
#include "common/singleton.hpp"
|
||||
|
||||
|
||||
using cinelerra::Singleton;
|
||||
using lumiera::Singleton;
|
||||
using mobject::session::SessManager;
|
||||
using mobject::session::SessManagerImpl;
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ namespace mobject
|
|||
catch (...)
|
||||
{
|
||||
focusEDL_ = 0;
|
||||
throw cinelerra::error::Fatal ("unexpected exception while clearing EDLs");
|
||||
throw lumiera::error::Fatal ("unexpected exception while clearing EDLs");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace mobject
|
|||
boost::scoped_ptr<SessionImpl> pImpl_;
|
||||
|
||||
SessManagerImpl() throw();
|
||||
friend class cinelerra::singleton::StaticCreate<SessManagerImpl>;
|
||||
friend class lumiera::singleton::StaticCreate<SessManagerImpl>;
|
||||
|
||||
public:
|
||||
virtual void clear () ;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
/*
|
||||
* hello.c - demonstrates how to build a standalone tool (C source)
|
||||
* integrated into the SCons based build system of Cinelerra
|
||||
* integrated into the SCons based build system of Lumiera
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
printf("hello cinelerra world");
|
||||
printf("hello lumiera world");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,12 +15,12 @@ return: 0
|
|||
END
|
||||
|
||||
TEST "query error" get <<END
|
||||
out: CINELERRA_ERROR_TEST:test error
|
||||
out: LUMIERA_ERROR_TEST:test error
|
||||
return: 0
|
||||
END
|
||||
|
||||
TEST "error cleared" get2 <<END
|
||||
out: CINELERRA_ERROR_TEST:test error
|
||||
out: LUMIERA_ERROR_TEST:test error
|
||||
out: (nil)
|
||||
return: 0
|
||||
END
|
||||
|
|
|
|||
|
|
@ -52,18 +52,18 @@ END
|
|||
|
||||
|
||||
TEST "ExceptionError_test" ExceptionError_test <<END
|
||||
out: caught: CINELERRA_ERROR_LIFE_AND_UNIVERSE:and everything? (don't panic)...the answer is: 42
|
||||
out: caught cinelerra::Error: CINELERRA_ERROR_DERIVED:convoluted exception
|
||||
out: caught error::Logic: CINELERRA_ERROR_FATAL:floundered (test-2).
|
||||
out: caught error::Invalid: CINELERRA_ERROR_INVALID:invalid input or parameters (test-3).
|
||||
out: caught cinelerra::Error: CINELERRA_ERROR_EXTERNAL:failure in external service (test-4).
|
||||
out: caught: LUMIERA_ERROR_LIFE_AND_UNIVERSE:and everything? (don't panic)...the answer is: 42
|
||||
out: caught lumiera::Error: LUMIERA_ERROR_DERIVED:convoluted exception
|
||||
out: caught error::Logic: LUMIERA_ERROR_FATAL:floundered (test-2).
|
||||
out: caught error::Invalid: LUMIERA_ERROR_INVALID:invalid input or parameters (test-3).
|
||||
out: caught lumiera::Error: LUMIERA_ERROR_EXTERNAL:failure in external service (test-4).
|
||||
out: caught std::runtime_error: test-5
|
||||
out: caught std::exception: St9exception
|
||||
out: intermediate handler caught: CINELERRA_ERROR_EXTERNAL:failure in external service (test-7).....will rethrow as error::State
|
||||
out: caught cinelerra::Error: CINELERRA_ERROR_STATE:unforseen state -- caused by: CINELERRA_ERROR_EXTERNAL:failure in external service (test-7).
|
||||
out: intermediate handler caught: CINELERRA_ERROR_EXTERNAL:failure in external service (test-8).....will rethrow as error::State
|
||||
out: 2nd intermediate handler caught: CINELERRA_ERROR_STATE:unforseen state -- caused by: CINELERRA_ERROR_EXTERNAL:failure in external service (test-8).....will rethrow as error::Config
|
||||
out: caught cinelerra::Error: CINELERRA_ERROR_CONFIG:misconfiguration -- caused by: CINELERRA_ERROR_EXTERNAL:failure in external service (test-8).
|
||||
out: intermediate handler caught: LUMIERA_ERROR_EXTERNAL:failure in external service (test-7).....will rethrow as error::State
|
||||
out: caught lumiera::Error: LUMIERA_ERROR_STATE:unforseen state -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service (test-7).
|
||||
out: intermediate handler caught: LUMIERA_ERROR_EXTERNAL:failure in external service (test-8).....will rethrow as error::State
|
||||
out: 2nd intermediate handler caught: LUMIERA_ERROR_STATE:unforseen state -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service (test-8).....will rethrow as error::Config
|
||||
out: caught lumiera::Error: LUMIERA_ERROR_CONFIG:misconfiguration -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service (test-8).
|
||||
END
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ TESTING "Component Test Suite: Builder" ./test-components --group=builder
|
|||
|
||||
|
||||
TEST "BuilderTool_test" BuilderTool_test <<END
|
||||
out: media is: Asset(VIDEO:cin3.test-1 v1)
|
||||
out: media is: Asset(VIDEO:lumi.test-1 v1)
|
||||
out: catch-all-function called.
|
||||
END
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
using cinelerra::error::Invalid;
|
||||
using lumiera::error::Invalid;
|
||||
using util::for_each;
|
||||
using util::isnil;
|
||||
using std::cout;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace backend_interface
|
|||
class MediaAccessMock : public MediaAccessFacade
|
||||
{
|
||||
public:
|
||||
FileHandle queryFile (const char* name) throw(cinelerra::error::Invalid);
|
||||
FileHandle queryFile (const char* name) throw(lumiera::error::Invalid);
|
||||
ChanDesc queryChannel (FileHandle, uint chanNo) throw();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ using std::cout;
|
|||
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace test
|
||||
{
|
||||
|
|
@ -46,10 +46,10 @@ namespace cinelerra
|
|||
testAccess("version");
|
||||
}
|
||||
|
||||
/** @test accessing a value from cinelerra::Appconfig */
|
||||
/** @test accessing a value from lumiera::Appconfig */
|
||||
void testAccess (const string& key)
|
||||
{
|
||||
string ver = cinelerra::Appconfig::get(key);
|
||||
string ver = lumiera::Appconfig::get(key);
|
||||
ASSERT ( !util::isnil(ver));
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ using std::cout;
|
|||
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace test
|
||||
{
|
||||
|
|
@ -50,11 +50,11 @@ namespace cinelerra
|
|||
/** local specific error-constant for use in the
|
||||
* construcor of the nested SpecificError class.
|
||||
*/
|
||||
CINELERRA_ERROR_DEFINE(LIFE_AND_UNIVERSE, "and everything?");
|
||||
CINELERRA_ERROR_DEFINE(DERIVED, "convoluted exception");
|
||||
LUMIERA_ERROR_DEFINE(LIFE_AND_UNIVERSE, "and everything?");
|
||||
LUMIERA_ERROR_DEFINE(DERIVED, "convoluted exception");
|
||||
|
||||
/** declare a specific Error class with parent class error::external */
|
||||
CINELERRA_EXCEPTION_DECLARE (DerivedError, error::External, CINELERRA_ERROR_DERIVED);
|
||||
LUMIERA_EXCEPTION_DECLARE (DerivedError, error::External, LUMIERA_ERROR_DERIVED);
|
||||
|
||||
|
||||
/**********************************************************
|
||||
|
|
@ -134,29 +134,29 @@ namespace cinelerra
|
|||
}
|
||||
|
||||
|
||||
/** @test by constructing an cinelerra::Error object,
|
||||
* the corresponding cinelerra_error state is set automatically
|
||||
/** @test by constructing an lumiera::Error object,
|
||||
* the corresponding lumiera_error state is set automatically
|
||||
*/
|
||||
void checkErrorIntegration()
|
||||
{
|
||||
cinelerra_error ();
|
||||
ASSERT (!cinelerra_error ());
|
||||
lumiera_error ();
|
||||
ASSERT (!lumiera_error ());
|
||||
|
||||
Error err1;
|
||||
Error err2("boo",CINELERRA_ERROR_DERIVED);
|
||||
ASSERT (err1.getID () == cinelerra_error ()); // (we didn't clear the first one!)
|
||||
Error err2("boo",LUMIERA_ERROR_DERIVED);
|
||||
ASSERT (err1.getID () == lumiera_error ()); // (we didn't clear the first one!)
|
||||
|
||||
Error err3("boooo",CINELERRA_ERROR_DERIVED);
|
||||
ASSERT (err3.getID () == cinelerra_error ());
|
||||
Error err3("boooo",LUMIERA_ERROR_DERIVED);
|
||||
ASSERT (err3.getID () == lumiera_error ());
|
||||
|
||||
SpecificError err4;
|
||||
ASSERT (err4.getID () == CINELERRA_ERROR_LIFE_AND_UNIVERSE);
|
||||
ASSERT (err4.getID () == cinelerra_error ());
|
||||
ASSERT (err4.getID () == LUMIERA_ERROR_LIFE_AND_UNIVERSE);
|
||||
ASSERT (err4.getID () == lumiera_error ());
|
||||
|
||||
ASSERT (!cinelerra_error ());
|
||||
ASSERT (!lumiera_error ());
|
||||
}
|
||||
|
||||
/** @test the chaining of cinelerra::Exception objects
|
||||
/** @test the chaining of lumiera::Exception objects
|
||||
* and the retrieval of the original root cause.
|
||||
*/
|
||||
void checkRootCauseChaining()
|
||||
|
|
@ -186,7 +186,7 @@ namespace cinelerra
|
|||
* gets installed and invoked, which gives additional diagnostics.*/
|
||||
void terminateUnknown () throw()
|
||||
{
|
||||
cinelerra::Appconfig::instance();
|
||||
lumiera::Appconfig::instance();
|
||||
// will cause initialisation of Appconfig,
|
||||
|
||||
throw Error("You'll never get me, won't you?");
|
||||
|
|
@ -201,7 +201,7 @@ namespace cinelerra
|
|||
{
|
||||
int value;
|
||||
public:
|
||||
SpecificError () : Invalid("don't panic",CINELERRA_ERROR_LIFE_AND_UNIVERSE), value(42) {}
|
||||
SpecificError () : Invalid("don't panic",LUMIERA_ERROR_LIFE_AND_UNIVERSE), value(42) {}
|
||||
int revealIt () { return value; }
|
||||
};
|
||||
|
||||
|
|
@ -220,7 +220,7 @@ namespace cinelerra
|
|||
catch (SpecificError& e) { cout << "caught: " << e.what() << "..the answer is: " << e.revealIt() << "\n"; }
|
||||
catch (error::Logic& e) { cout << "caught error::Logic: " << e.what() << "\n"; }
|
||||
catch (error::Invalid&e) { cout << "caught error::Invalid: " << e.what() << "\n"; }
|
||||
catch (Error& e) { cout << "caught cinelerra::Error: " << e.what() << "\n"; }
|
||||
catch (Error& e) { cout << "caught lumiera::Error: " << e.what() << "\n"; }
|
||||
catch (runtime_error& e) { cout << "caught std::runtime_error: " << e.what() << "\n"; }
|
||||
catch (exception& e) { cout << "caught std::exception: " << e.what() << "\n"; }
|
||||
catch (...) { cout << "caught an unknown exception\n"; }
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ using std::string;
|
|||
using std::cout;
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace test
|
||||
{
|
||||
|
|
@ -323,4 +323,4 @@ namespace cinelerra
|
|||
|
||||
} // namespace test
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ using std::string;
|
|||
using std::cout;
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace test
|
||||
{
|
||||
|
|
@ -100,7 +100,7 @@ namespace cinelerra
|
|||
* further shared-ptrs, invoke a member function and
|
||||
* finally, when leaving the scope, our TargetObj
|
||||
* will be destroyed automatically.
|
||||
* @see cinelerra::Factory
|
||||
* @see lumiera::Factory
|
||||
*/
|
||||
class Factory_test : public Test
|
||||
{
|
||||
|
|
@ -125,4 +125,4 @@ namespace cinelerra
|
|||
|
||||
} // namespace test
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ using std::string;
|
|||
using std::cout;
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace test
|
||||
{
|
||||
|
|
@ -72,9 +72,9 @@ namespace cinelerra
|
|||
/*******************************************************************
|
||||
* @test implement a Singleton class using our Singleton Template.
|
||||
* Expected results: no memory leaks.
|
||||
* @see cinelerra::Singleton
|
||||
* @see cinelerra::singleton::StaticCreate
|
||||
* @see cinelerra::singleton::HeapCreate
|
||||
* @see lumiera::Singleton
|
||||
* @see lumiera::singleton::StaticCreate
|
||||
* @see lumiera::singleton::HeapCreate
|
||||
*/
|
||||
class Singleton_test : public Test
|
||||
{
|
||||
|
|
@ -136,4 +136,4 @@ namespace cinelerra
|
|||
|
||||
} // namespace test
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ using std::string;
|
|||
using std::cout;
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace test
|
||||
{
|
||||
|
|
@ -108,8 +108,8 @@ namespace cinelerra
|
|||
* @test inject a Mock object into the Singleton Factory,
|
||||
* to be returned and used in place of the original object.
|
||||
* Expected results: Mock(s) called, no memory leaks.
|
||||
* @see cinelerra::Singleton
|
||||
* @see cinelerra::singleton::Static
|
||||
* @see lumiera::Singleton
|
||||
* @see lumiera::singleton::Static
|
||||
*/
|
||||
class SingletonTestMock_test : public Test
|
||||
{
|
||||
|
|
@ -214,4 +214,4 @@ namespace cinelerra
|
|||
|
||||
} // namespace test
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef CINELERRA_TEST_TESTTARGETOBJ_H
|
||||
#define CINELERRA_TEST_TESTTARGETOBJ_H
|
||||
#ifndef LUMIERA_TEST_TESTTARGETOBJ_H
|
||||
#define LUMIERA_TEST_TESTTARGETOBJ_H
|
||||
|
||||
|
||||
#include "common/test/run.hpp"
|
||||
|
|
@ -41,7 +41,7 @@ using std::string;
|
|||
using std::cout;
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace test
|
||||
{
|
||||
|
|
@ -107,5 +107,5 @@ namespace cinelerra
|
|||
|
||||
} // namespace test
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ using std::string;
|
|||
using std::cout;
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace typelist
|
||||
{
|
||||
|
|
@ -97,4 +97,4 @@ namespace cinelerra
|
|||
|
||||
} // namespace typelist
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
/** @file visitingtoolconept.cpp
|
||||
** While laying the foundations for EDL and Builder, Ichthyo came accross
|
||||
** the necessity to create a custom implementation of the Visitor Pattern
|
||||
** optimally suited for Cinelerra's needs. This implementation file was
|
||||
** optimally suited for Lumiera's needs. This implementation file was
|
||||
** used for the draft and is self-contained. The final solution was then
|
||||
** extracted as library implementation to visitor.hpp
|
||||
**
|
||||
|
|
@ -60,13 +60,13 @@
|
|||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
using cinelerra::Singleton;
|
||||
using lumiera::Singleton;
|
||||
using boost::format;
|
||||
using std::string;
|
||||
using std::cout;
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace visitor_concept_draft
|
||||
{
|
||||
|
|
@ -459,4 +459,4 @@ namespace cinelerra
|
|||
|
||||
} // namespace visitor_concept_draft
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ using std::string;
|
|||
using std::cout;
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace visitor
|
||||
{
|
||||
|
|
@ -226,4 +226,4 @@ namespace cinelerra
|
|||
|
||||
} // namespace visitor
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ using std::string;
|
|||
using std::cout;
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace visitor
|
||||
{
|
||||
|
|
@ -159,4 +159,4 @@ namespace cinelerra
|
|||
|
||||
} // namespace visitor
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ using util::isnil;
|
|||
using boost::lexical_cast;
|
||||
|
||||
|
||||
namespace cinelerra
|
||||
namespace lumiera
|
||||
{
|
||||
namespace test
|
||||
{
|
||||
|
|
@ -65,4 +65,4 @@ namespace cinelerra
|
|||
|
||||
} // namespace test
|
||||
|
||||
} // namespace cinelerra
|
||||
} // namespace lumiera
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
mainsuite.cpp - "the" cinelerra3 self test suite
|
||||
mainsuite.cpp - "the" Lumiera self test suite
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Christian Thaeter <ct@pipapo.org>
|
||||
|
|
|
|||
|
|
@ -100,14 +100,14 @@ namespace asset
|
|||
aMang.getAsset (ID<asset::Proc>(mm1->getID()));
|
||||
NOTREACHED;
|
||||
}
|
||||
catch (cinelerra::error::Invalid& xxx) {ASSERT (xxx.getID()==CINELERRA_ERROR_WRONG_ASSET_KIND);}
|
||||
catch (lumiera::error::Invalid& xxx) {ASSERT (xxx.getID()==LUMIERA_ERROR_WRONG_ASSET_KIND);}
|
||||
try
|
||||
{ // try accessing nonexistant ID
|
||||
aMang.getAsset (ID<Asset> (1234567890));
|
||||
NOTREACHED;
|
||||
}
|
||||
catch (cinelerra::error::Invalid& xxx) {ASSERT (xxx.getID()==CINELERRA_ERROR_UNKNOWN_ASSET_ID);}
|
||||
cinelerra_error (); // reset errorflag
|
||||
catch (lumiera::error::Invalid& xxx) {ASSERT (xxx.getID()==LUMIERA_ERROR_UNKNOWN_ASSET_ID);}
|
||||
lumiera_error (); // reset errorflag
|
||||
|
||||
|
||||
// checking the Ident-Fields
|
||||
|
|
@ -121,8 +121,8 @@ namespace asset
|
|||
ASSERT (mm3->ident.category == Category (VIDEO ));
|
||||
|
||||
ASSERT (mm1->ident.org == "ichthyo");
|
||||
ASSERT (mm2->ident.org == "cin3");
|
||||
ASSERT (mm3->ident.org == "cin3");
|
||||
ASSERT (mm2->ident.org == "lumi");
|
||||
ASSERT (mm3->ident.org == "lumi");
|
||||
|
||||
ASSERT (mm1->ident.version == 5);
|
||||
ASSERT (mm2->ident.version == 1);
|
||||
|
|
@ -159,19 +159,19 @@ namespace asset
|
|||
ASSERT (key2.name == "testfile2"); // name filled in automatically
|
||||
|
||||
candi = asset::Media::create(string("testfile3.wav"), Category(AUDIO));
|
||||
ASSERT ( checkProperties (candi, Asset::Ident("testfile3", Category(AUDIO), "cin3", 1)
|
||||
ASSERT ( checkProperties (candi, Asset::Ident("testfile3", Category(AUDIO), "lumi", 1)
|
||||
, "testfile3.wav"));
|
||||
|
||||
candi = asset::Media::create("some/path/testfile4.wav", Category(AUDIO));
|
||||
ASSERT ( checkProperties (candi, Asset::Ident("testfile4", Category(AUDIO), "cin3", 1)
|
||||
ASSERT ( checkProperties (candi, Asset::Ident("testfile4", Category(AUDIO), "lumi", 1)
|
||||
, "some/path/testfile4.wav"));
|
||||
|
||||
candi = asset::Media::create("", Category(AUDIO,"sub/bin"));
|
||||
ASSERT ( checkProperties (candi, Asset::Ident("nil", Category(AUDIO,"sub/bin"), "cin3", 1)
|
||||
ASSERT ( checkProperties (candi, Asset::Ident("nil", Category(AUDIO,"sub/bin"), "lumi", 1)
|
||||
, ""));
|
||||
|
||||
candi = asset::Media::create("", AUDIO);
|
||||
ASSERT ( checkProperties (candi, Asset::Ident("nil", Category(AUDIO), "cin3", 1)
|
||||
ASSERT ( checkProperties (candi, Asset::Ident("nil", Category(AUDIO), "lumi", 1)
|
||||
, ""));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ namespace asset
|
|||
|
||||
/***********************************************************************
|
||||
* This test documents the Interface used by MediaFactory when loading
|
||||
* media files for querying cinelerra's backend layer for information
|
||||
* media files for querying Lumiera's backend layer for information
|
||||
* on how the media file is structured.
|
||||
*/
|
||||
class MediaStructureQuery_test : public Test
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ namespace mobject
|
|||
/*******************************************************************
|
||||
* @test create a render process from a given segment of the EDL.
|
||||
* Basically this includes cooperation of all parts of the
|
||||
* Cinelerra Proc Layer. For a prepared test-EDL we invoke the
|
||||
* Lumiera Proc Layer. For a prepared test-EDL we invoke the
|
||||
* controller to create a render process. This includes building
|
||||
* the render pipeline. Finally, we analyze all the created
|
||||
* Structures.
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
#include <iostream>
|
||||
|
||||
//using boost::format;
|
||||
using cinelerra::Time;
|
||||
using lumiera::Time;
|
||||
using util::contains;
|
||||
using std::string;
|
||||
using std::cout;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
#include <iostream>
|
||||
|
||||
//using boost::format;
|
||||
using cinelerra::Time;
|
||||
using lumiera::Time;
|
||||
using util::contains;
|
||||
using std::string;
|
||||
using std::cout;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ namespace mobject
|
|||
asset::Media &
|
||||
createTestMedia ()
|
||||
{
|
||||
// install Mock-Interface to cinelerra backend
|
||||
// install Mock-Interface to Lumiera backend
|
||||
MAF::instance.injectSubclass (new MediaAccessMock);
|
||||
PM media = asset::Media::create("test-2", VIDEO); // query magic filename
|
||||
MAF::instance.injectSubclass (0); // remove Mock-Interface
|
||||
|
|
@ -70,7 +70,7 @@ namespace mobject
|
|||
{ }
|
||||
};
|
||||
|
||||
cinelerra::Singleton<Testbed> testbed_1; // invoke ctor when creating first TestClip...
|
||||
lumiera::Singleton<Testbed> testbed_1; // invoke ctor when creating first TestClip...
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include "lib/error.h"
|
||||
|
||||
|
||||
CINELERRA_ERROR_DEFINE(TEST, "test error");
|
||||
LUMIERA_ERROR_DEFINE(TEST, "test error");
|
||||
|
||||
int
|
||||
main (int argc, char** argv)
|
||||
|
|
@ -35,31 +35,31 @@ main (int argc, char** argv)
|
|||
|
||||
if (!strcmp(argv[1], "set"))
|
||||
{
|
||||
cinelerra_error_set (CINELERRA_ERROR_TEST);
|
||||
lumiera_error_set (LUMIERA_ERROR_TEST);
|
||||
}
|
||||
|
||||
if (!strcmp(argv[1], "get_no"))
|
||||
{
|
||||
const char* err;
|
||||
err = cinelerra_error ();
|
||||
err = lumiera_error ();
|
||||
printf ("%p\n", err);
|
||||
}
|
||||
|
||||
if (!strcmp(argv[1], "get"))
|
||||
{
|
||||
cinelerra_error_set (CINELERRA_ERROR_TEST);
|
||||
lumiera_error_set (LUMIERA_ERROR_TEST);
|
||||
const char* err;
|
||||
err = cinelerra_error ();
|
||||
err = lumiera_error ();
|
||||
printf ("%s\n", err);
|
||||
}
|
||||
|
||||
if (!strcmp(argv[1], "get2"))
|
||||
{
|
||||
cinelerra_error_set (CINELERRA_ERROR_TEST);
|
||||
lumiera_error_set (LUMIERA_ERROR_TEST);
|
||||
const char* err;
|
||||
err = cinelerra_error ();
|
||||
err = lumiera_error ();
|
||||
printf ("%s\n", err);
|
||||
err = cinelerra_error ();
|
||||
err = lumiera_error ();
|
||||
printf ("%p\n", err);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
#include "lib/framerate.h"
|
||||
|
||||
|
||||
CINELERRA_ERROR_DEFINE(TEST, "test error");
|
||||
LUMIERA_ERROR_DEFINE(TEST, "test error");
|
||||
|
||||
int
|
||||
main (int argc, char** argv)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include "lib/references.h"
|
||||
|
||||
|
||||
CINELERRA_ERROR_DEFINE(TEST, "test error");
|
||||
LUMIERA_ERROR_DEFINE(TEST, "test error");
|
||||
|
||||
|
||||
struct example
|
||||
|
|
@ -55,16 +55,16 @@ main (int argc, char** argv)
|
|||
struct example test;
|
||||
test.foo = 123;
|
||||
|
||||
cinelerra_reference hold;
|
||||
lumiera_reference hold;
|
||||
|
||||
cinelerra_reference_strong_init_once (&hold, &test, example_dtor);
|
||||
lumiera_reference_strong_init_once (&hold, &test, example_dtor);
|
||||
|
||||
|
||||
struct example* r = cinelerra_reference_get (&hold);
|
||||
struct example* r = lumiera_reference_get (&hold);
|
||||
|
||||
printf ("got: %d\n", r->foo);
|
||||
|
||||
cinelerra_reference_destroy (&hold);
|
||||
lumiera_reference_destroy (&hold);
|
||||
}
|
||||
else if (!strcmp(argv[1], "nodeinsert"))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@ signaling_thread()
|
|||
int
|
||||
conditionforgotunlock ()
|
||||
{
|
||||
cinelerra_condition c;
|
||||
cinelerra_condition_init (&c);
|
||||
lumiera_condition c;
|
||||
lumiera_condition_init (&c);
|
||||
|
||||
cinelerra_conditionacquirer l;
|
||||
cinelerra_conditionacquirer_init (&l, &c, CINELERRA_LOCKED);
|
||||
lumiera_conditionacquirer l;
|
||||
lumiera_conditionacquirer_init (&l, &c, LUMIERA_LOCKED);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@
|
|||
|
||||
int mutexforgotunlock()
|
||||
{
|
||||
cinelerra_mutex m;
|
||||
cinelerra_mutex_init (&m);
|
||||
lumiera_mutex m;
|
||||
lumiera_mutex_init (&m);
|
||||
|
||||
cinelerra_mutexacquirer l;
|
||||
cinelerra_mutexacquirer_init_mutex (&l, &m, CINELERRA_LOCKED);
|
||||
lumiera_mutexacquirer l;
|
||||
lumiera_mutexacquirer_init_mutex (&l, &m, LUMIERA_LOCKED);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "lib/condition.h"
|
||||
|
||||
CINELERRA_ERROR_DEFINE(TEST, "test error");
|
||||
LUMIERA_ERROR_DEFINE(TEST, "test error");
|
||||
|
||||
#if 0
|
||||
waiting_thread()
|
||||
|
|
@ -52,11 +52,11 @@ main (int argc, char** argv)
|
|||
|
||||
if (!strcmp(argv[1], "conditionforgotunlock"))
|
||||
{
|
||||
cinelerra_condition c;
|
||||
cinelerra_condition_init (&c);
|
||||
lumiera_condition c;
|
||||
lumiera_condition_init (&c);
|
||||
|
||||
cinelerra_conditionlock NOBUG_CLEANUP(cinelerra_conditionlock_ensureunlocked) l;
|
||||
cinelerra_conditionlock_init (&l, &c, CINELERRA_LOCKED);
|
||||
lumiera_conditionlock NOBUG_CLEANUP(lumiera_conditionlock_ensureunlocked) l;
|
||||
lumiera_conditionlock_init (&l, &c, LUMIERA_LOCKED);
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "lib/error.h"
|
||||
|
||||
CINELERRA_ERROR_DEFINE(TEST, "test error");
|
||||
LUMIERA_ERROR_DEFINE(TEST, "test error");
|
||||
|
||||
int conditionforgotunlock ();
|
||||
int mutexforgotunlock ();
|
||||
|
|
|
|||
|
|
@ -34,12 +34,12 @@ void bye(const char* m)
|
|||
printf("Bye %s\n", m);
|
||||
}
|
||||
|
||||
CINELERRA_INTERFACE_IMPLEMENT(hello, 1, german, myopen, myclose,
|
||||
hallo,
|
||||
tschuess
|
||||
);
|
||||
LUMIERA_INTERFACE_IMPLEMENT(hello, 1, german, myopen, myclose,
|
||||
hallo,
|
||||
tschuess
|
||||
);
|
||||
|
||||
CINELERRA_INTERFACE_IMPLEMENT(hello, 1, english, myopen, myclose,
|
||||
hello,
|
||||
bye
|
||||
);
|
||||
LUMIERA_INTERFACE_IMPLEMENT(hello, 1, english, myopen, myclose,
|
||||
hello,
|
||||
bye
|
||||
);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue