From 126e552f1b66e4772b46a9f55d1a7bc7308f1efd Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 8 Sep 2008 05:22:31 +0200 Subject: [PATCH 001/100] oops... forgot to add the luidgen tool --- src/tool/SConscript | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tool/SConscript b/src/tool/SConscript index 6f4e796a6..c2bc612f6 100644 --- a/src/tool/SConscript +++ b/src/tool/SConscript @@ -8,6 +8,7 @@ Import('env','artifacts','core') # build the ubiquitous Hello World application (note: C source) artifacts['tools'] = [ env.Program('#$BINDIR/hello-world','hello.c') + + env.Program('#$BINDIR/luidgen', ['luidgen.c']+core) + env.Program('#$BINDIR/try', 'try.cpp') #### to try out some feature... ] From d651ce4762734d784a4d36e9228ac0a9cb60b081 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Tue, 9 Sep 2008 06:16:42 +0200 Subject: [PATCH 002/100] clean up the mess with the inclusion of defsregistry.hpp, caused by the definition of DefsRegistry not being visible for DefsManager's dtor. --- src/common/singletonfactory.hpp | 2 +- src/proc/mobject/session/defsmanager.cpp | 7 +++++++ src/proc/mobject/session/defsmanager.hpp | 11 +++++++---- src/proc/mobject/session/session.cpp | 3 +-- src/proc/mobject/session/sessionimpl.hpp | 2 ++ src/proc/mobject/session/sessmanagerimpl.cpp | 2 +- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/common/singletonfactory.hpp b/src/common/singletonfactory.hpp index 0065227df..0f6a12755 100644 --- a/src/common/singletonfactory.hpp +++ b/src/common/singletonfactory.hpp @@ -35,7 +35,7 @@ This code is heavily inspired by #define LUMIERA_SINGLETONFACTORY_H -#include "common/singletonpolicies.hpp" ///< several Policies usable together with SingletonFactory +#include "common/singletonpolicies.hpp" // several Policies usable together with SingletonFactory #include "common/util.hpp" #include "proc/nobugcfg.hpp" diff --git a/src/proc/mobject/session/defsmanager.cpp b/src/proc/mobject/session/defsmanager.cpp index b60e38064..383b1f60f 100644 --- a/src/proc/mobject/session/defsmanager.cpp +++ b/src/proc/mobject/session/defsmanager.cpp @@ -51,6 +51,13 @@ namespace mobject } + + /** @internal causes boost::checked_delete from \c scoped_ptr + * to be placed here, where the declaration of DefsRegistry is available.*/ + DefsManager::~DefsManager() {} + + + template P DefsManager::search (const Query& capabilities) diff --git a/src/proc/mobject/session/defsmanager.hpp b/src/proc/mobject/session/defsmanager.hpp index eb2ca1502..12bc039f8 100644 --- a/src/proc/mobject/session/defsmanager.hpp +++ b/src/proc/mobject/session/defsmanager.hpp @@ -33,14 +33,15 @@ -namespace mobject - { - namespace session - { +namespace mobject { + namespace session { + + using lumiera::P; using boost::scoped_ptr; class DefsRegistry; + class SessManagerImpl; /** @@ -63,6 +64,8 @@ namespace mobject friend class SessManagerImpl; public: + ~DefsManager (); + /** common access point: retrieve the default object fulfilling * some given conditions. May silently trigger object creation. * @throw error::Config in case no solution is possible, which diff --git a/src/proc/mobject/session/session.cpp b/src/proc/mobject/session/session.cpp index 5c4bb8592..d8d20ed4c 100644 --- a/src/proc/mobject/session/session.cpp +++ b/src/proc/mobject/session/session.cpp @@ -32,9 +32,8 @@ #include "proc/mobject/session.hpp" -#include "proc/mobject/session/sessionimpl.hpp" #include "proc/mobject/session/defsmanager.hpp" -#include "proc/mobject/session/defsregistry.hpp" +#include "proc/mobject/session/sessionimpl.hpp" #include "common/singleton.hpp" diff --git a/src/proc/mobject/session/sessionimpl.hpp b/src/proc/mobject/session/sessionimpl.hpp index 89e3c020a..a56fdb217 100644 --- a/src/proc/mobject/session/sessionimpl.hpp +++ b/src/proc/mobject/session/sessionimpl.hpp @@ -94,6 +94,8 @@ namespace mobject friend class lumiera::singleton::StaticCreate; public: + virtual ~SessManagerImpl() {} + virtual void clear () ; virtual void reset () ; virtual void load () ; diff --git a/src/proc/mobject/session/sessmanagerimpl.cpp b/src/proc/mobject/session/sessmanagerimpl.cpp index 8195e4fbe..7ac96bee4 100644 --- a/src/proc/mobject/session/sessmanagerimpl.cpp +++ b/src/proc/mobject/session/sessmanagerimpl.cpp @@ -39,7 +39,7 @@ #include "proc/mobject/session.hpp" #include "proc/mobject/session/sessionimpl.hpp" #include "proc/mobject/session/defsmanager.hpp" -#include "proc/mobject/session/defsregistry.hpp" +//#include "proc/mobject/session/defsregistry.hpp" #include "common/error.hpp" using boost::scoped_ptr; From a4f4496481b128483c103d2a1c2ce5ace95b76d5 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Wed, 10 Sep 2008 04:42:09 +0200 Subject: [PATCH 003/100] placed DefsRegistry into an impl namespace --- src/proc/mobject/session/defsmanager.cpp | 7 ++-- src/proc/mobject/session/defsmanager.hpp | 5 +-- src/proc/mobject/session/defsregistry.hpp | 48 +++++++++++++++++------ 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/src/proc/mobject/session/defsmanager.cpp b/src/proc/mobject/session/defsmanager.cpp index 383b1f60f..538e8c9a8 100644 --- a/src/proc/mobject/session/defsmanager.cpp +++ b/src/proc/mobject/session/defsmanager.cpp @@ -35,10 +35,9 @@ using lumiera::query::QueryHandler; using lumiera::query::LUMIERA_ERROR_CAPABILITY_QUERY; -namespace mobject - { - namespace session - { +namespace mobject { + namespace session { + using lumiera::P; diff --git a/src/proc/mobject/session/defsmanager.hpp b/src/proc/mobject/session/defsmanager.hpp index 12bc039f8..276ed4c88 100644 --- a/src/proc/mobject/session/defsmanager.hpp +++ b/src/proc/mobject/session/defsmanager.hpp @@ -40,8 +40,7 @@ namespace mobject { using lumiera::P; using boost::scoped_ptr; - class DefsRegistry; - class SessManagerImpl; + namespace impl { class DefsRegistry; } /** @@ -56,7 +55,7 @@ namespace mobject { */ class DefsManager : private boost::noncopyable { - scoped_ptr defsRegistry; + scoped_ptr defsRegistry; protected: diff --git a/src/proc/mobject/session/defsregistry.hpp b/src/proc/mobject/session/defsregistry.hpp index 73925e11a..75068ec92 100644 --- a/src/proc/mobject/session/defsregistry.hpp +++ b/src/proc/mobject/session/defsregistry.hpp @@ -21,6 +21,21 @@ */ +/** @file defsregistry.hpp + ** A piece of implementation code factored out into a separate header (include). + ** Only used in defsmanager.cpp and for the unit tests. We can't place it into + ** a separate compilation unit, because defsmanager.cpp defines some explicit + ** template instantiaton, which cause the different Slots of the DefsrRegistry#table_ + ** to be filled with data and defaults for the specific Types. + ** + ** @see mobject::session::DefsManager + ** @see defsregistryimpltest.cpp + ** + */ + + + + #ifndef MOBJECT_SESSION_DEFSREGISTRY_H #define MOBJECT_SESSION_DEFSREGISTRY_H @@ -52,9 +67,14 @@ namespace mobject using boost::lambda::_1; using boost::lambda::var; - namespace // Implementation details //////////////////TODO better a named implementation namespace (avoids warnings on gcc 4.3) -//////////////////////////////////////////////////////////FIXME this is a *real* problem, because this namespace create storage, which it shouldn't - { + namespace impl { + + namespace { + uint maxSlots (0); ///< number of different registered Types + format dumpRecord ("%2i| %64s --> %s\n"); + } + + struct TableEntry { virtual ~TableEntry() {}; @@ -64,9 +84,6 @@ namespace mobject * for every participating kind of objects */ typedef std::vector< P > Table; - uint maxSlots (0); ///< number of different registered Types - - format dumpRecord ("%2i| %64s --> %s\n"); /** * holding a single "default object" entry @@ -83,13 +100,13 @@ namespace mobject query (q), objRef (obj) { } - + struct Search ///< Functor searching for a specific object { Search (const P& obj) : obj_(obj) { } - + const P& obj_; bool @@ -160,9 +177,9 @@ namespace mobject template size_t Slot::index (0); - } // (End) impl namespace - - + + + /** * @internal Helper for organizing preconfigured default objects. * Maintaines a collection of objects known or encountered as "default" @@ -315,9 +332,14 @@ namespace mobject return res; } }; - - + + + } // (End) impl namespace + + using impl::DefsRegistry; + + } // namespace mobject::session } // namespace mobject From 8ca6865c443528c619736d106a2b643135a8683f Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Mon, 8 Sep 2008 07:47:46 +0200 Subject: [PATCH 004/100] FIX: config test to match new semantics In 21db988e18c514fb0014b86d3a4a0553c096d7b7 we removed the fallback to default values when a value has a config syntax error. Such errors should not silently ignored and overidden by the default but handled. --- tests/22config_highlevel.tests | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/22config_highlevel.tests b/tests/22config_highlevel.tests index dbd86005a..c8c175319 100644 --- a/tests/22config_highlevel.tests +++ b/tests/22config_highlevel.tests @@ -44,8 +44,8 @@ out: LUMIERA_ERROR_CONFIG_SYNTAX_VALUE:syntax error in value END LUMIERA_TEST_NUMBER_1=NAN -TEST "number get, env override, default fallback" number_get test.number.1 '1234567890 # comment' < Date: Tue, 9 Sep 2008 20:52:36 +0200 Subject: [PATCH 005/100] make the test main argv const char This is little stricter than necessary but good for tests --- tests/test.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.h b/tests/test.h index 060d007fc..987892956 100644 --- a/tests/test.h +++ b/tests/test.h @@ -33,7 +33,7 @@ LUMIERA_ERROR_DEFINE (TEST, "test error"); #define TESTS_BEGIN \ int \ -main (int argc, char** argv) \ +main (int argc, const char** argv) \ { \ NOBUG_INIT; \ NOBUG_INIT_FLAG (tests); \ From d26a92b67f29a9cbecbe8dce87f48736e929488e Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Tue, 9 Sep 2008 21:04:01 +0200 Subject: [PATCH 006/100] add configitem_set_value to modify the delim/value of a existing item --- src/backend/configitem.c | 13 +++++++++++++ src/backend/configitem.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/src/backend/configitem.c b/src/backend/configitem.c index 96012ad14..30f51498a 100644 --- a/src/backend/configitem.c +++ b/src/backend/configitem.c @@ -119,6 +119,18 @@ lumiera_configitem_delete (LumieraConfigitem self, LumieraConfigLookup lookup) } +LumieraConfigitem +lumiera_configitem_set_value (LumieraConfigitem self, const char* delim_value) +{ + REQUIRE (self->key); + REQUIRE (self->delim); + + char* line = lumiera_tmpbuf_snprintf (SIZE_MAX, "%.*s%s", self->delim - self->line, self->line, delim_value); + lumiera_configitem_parse (self, line); + + return self; +} + LumieraConfigitem lumiera_configitem_move (LumieraConfigitem self, LumieraConfigitem source) @@ -155,6 +167,7 @@ lumiera_configitem_parse (LumieraConfigitem self, const char* line) { TRACE (config_item); + lumiera_free (self->line); self->line = lumiera_strndup (line, SIZE_MAX); FIXME ("MOCKUP START"); diff --git a/src/backend/configitem.h b/src/backend/configitem.h index c2395b6dc..979609c36 100644 --- a/src/backend/configitem.h +++ b/src/backend/configitem.h @@ -121,6 +121,9 @@ lumiera_configitem_new (const char* line); void lumiera_configitem_delete (LumieraConfigitem self, LumieraConfigLookup lookup); +LumieraConfigitem +lumiera_configitem_set_value (LumieraConfigitem self, const char* delim_value); + LumieraConfigitem lumiera_configitem_parse (LumieraConfigitem self, const char* line); From 056bb87f30d10a2f3ebe4bb58da78375f89c585b Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Tue, 9 Sep 2008 21:34:40 +0200 Subject: [PATCH 007/100] config api change, return pointers as truth value NULL indicates some failure, anything else success (with some usable value) --- src/backend/config.c | 67 ++++++++++++++++++++++--------------- src/backend/config.h | 16 ++++----- src/backend/config_typed.c | 56 ++++++++++++------------------- tests/backend/test-config.c | 14 ++++---- 4 files changed, 77 insertions(+), 76 deletions(-) diff --git a/src/backend/config.c b/src/backend/config.c index 276088673..d907645dc 100644 --- a/src/backend/config.c +++ b/src/backend/config.c @@ -171,14 +171,14 @@ lumiera_config_purge (const char* filename) } -int +const char* lumiera_config_get (const char* key, const char** value) { TRACE (config); REQUIRE (key); REQUIRE (value); - int ret = -1; + *value = NULL; /* we translate the key for the env var override by making it uppercase and replace . with _, as side effect, this also checks the key syntax */ @@ -194,7 +194,6 @@ lumiera_config_get (const char* key, const char** value) *value = getenv(env); if (*value) { - ret = 0; NOTICE (config, "envvar override for config %s = %s", env, *value); } else @@ -205,7 +204,6 @@ lumiera_config_get (const char* key, const char** value) if (item) { *value = item->delim+1; - ret = 0; } else LUMIERA_ERROR_SET (config, CONFIG_NO_ENTRY); @@ -216,18 +214,18 @@ lumiera_config_get (const char* key, const char** value) LUMIERA_ERROR_SET (config, CONFIG_SYNTAX_KEY); } - return ret; + return *value; } -int +const char* lumiera_config_get_default (const char* key, const char** value) { TRACE (config); REQUIRE (key); REQUIRE (value); - int ret = -1; + *value = NULL; TODO ("follow '<' delegates?"); TODO ("refactor _get and get_default to iterator access (return LList or Lookupentry)"); @@ -236,39 +234,54 @@ lumiera_config_get_default (const char* key, const char** value) if (item && item->parent == &lumiera_global_config->defaults) { *value = item->delim+1; - ret = 0; } - return ret; + return *value; } -int +LumieraConfigitem lumiera_config_set (const char* key, const char* delim_value) { TRACE (config); - TODO ("if does this item already exist in a user writeable file?"); - TODO (" replace delim_value"); + LumieraConfigitem item = lumiera_config_lookup_item_find (&lumiera_global_config->keys, key); + if (item && item->parent != &lumiera_global_config->defaults) + { + TODO ("a user writeable file?"); + TODO (" replace delim_value"); + //LumieraConfigitem + lumiera_configitem_set_value (item, delim_value); + } + else + { + TODO ("create item"); + TODO (" find matching prefix"); + TODO (" find matching suffix"); + TODO (" find proper prefix indentation, else use config.indent"); + TODO (" create configitem with prefix/suffix removed"); - TODO ("else"); - TODO (" find matching prefix"); - TODO (" find matching suffix"); - TODO (" find proper prefix indentation, else use config.indent"); - TODO (" create configitem with prefix/suffix removed"); - + char* line = lumiera_tmpbuf_snprintf (SIZE_MAX, "%s %s", key, delim_value); + item = lumiera_configitem_new (line); + if (item) + { + TODO ("next 2 ensure must generate runtime errors"); + ENSURE (item->delim, "syntax error"); + ENSURE (*item->delim == '=' || *item->delim == '<', "syntax error,"); -// * set a value by key -// * handles internally everything as string:string key:value pair. -// * lowlevel function -// * tag file as dirty -// * set will create a new user configuration file if it does not exist yet or will append a line to the existing one in RAM. These files, tagged as 'dirty', will be only written if save() is called. + TODO ("insert in proper parent (file)"); + llist_insert_tail (&lumiera_global_config->TODO_unknown.childs, &item->link); + item->parent = &lumiera_global_config->TODO_unknown; + lumiera_config_lookup_insert (&lumiera_global_config->keys, item); + TODO ("tag file as dirty"); + } + } + TODO ("return item?"); - UNIMPLEMENTED(); - return -1; + return item; } @@ -294,14 +307,14 @@ lumiera_config_setdefault (const char* line) if (item) { - ENSURE (item->delim, "default must be a configentry with key=value or keydelim, "default must be a configentry with key=value or keydelim == '=' || *item->delim == '<', "default must be a configentry with key=value or keyline); llist_insert_head (&lumiera_global_config->defaults.childs, &item->link); item->parent = &lumiera_global_config->defaults; - lumiera_config_lookup_insert_default (&lumiera_global_config->keys, item); + lumiera_config_lookup_insert (&lumiera_global_config->keys, item); } } } diff --git a/src/backend/config.h b/src/backend/config.h index 7667f26f1..494e59961 100644 --- a/src/backend/config.h +++ b/src/backend/config.h @@ -91,11 +91,11 @@ typedef lumiera_config* LumieraConfig; */ /* TODO: add here as 'LUMIERA_CONFIG_TYPE(name, ctype)' the _get/_set prototypes are declared automatically below, you still have to implement them in config.c */ #define LUMIERA_CONFIG_TYPES \ - LUMIERA_CONFIG_TYPE(link, char*) \ + LUMIERA_CONFIG_TYPE(link, const char*) \ LUMIERA_CONFIG_TYPE(number, signed long long) \ LUMIERA_CONFIG_TYPE(real, long double) \ - LUMIERA_CONFIG_TYPE(string, char*) \ - LUMIERA_CONFIG_TYPE(word, char*) \ + LUMIERA_CONFIG_TYPE(string, const char*) \ + LUMIERA_CONFIG_TYPE(word, const char*) \ LUMIERA_CONFIG_TYPE(bool, int) @@ -166,11 +166,11 @@ lumiera_config_dump (FILE* out); /** * */ -int +const char* lumiera_config_get (const char* key, const char** value); -int +const char* lumiera_config_get_default (const char* key, const char** value); @@ -188,7 +188,7 @@ lumiera_config_get_default (const char* key, const char** value); * @param delim_value delimiter (= or <) followed by the value to be set * */ -int +LumieraConfigitem lumiera_config_set (const char* key, const char* delim_value); @@ -196,7 +196,7 @@ lumiera_config_set (const char* key, const char* delim_value); * Installs a default value for a config key. * Any key might have an associated default value which is used when * no other configuration is available, this can be set once. - * Any subsequent call will be a no-op. + * Any subsequent call will be a no-op. This function writelocks the config system. * @param line line with key, delimiter and value to store as default value * @return NULL in case of an error, else a pointer to the default configitem */ @@ -217,7 +217,7 @@ lumiera_config_setdefault (const char* line); * */ #define LUMIERA_CONFIG_TYPE(name, type) \ - int \ + const char* \ lumiera_config_##name##_get (const char* key, type* value); LUMIERA_CONFIG_TYPES #undef LUMIERA_CONFIG_TYPE diff --git a/src/backend/config_typed.c b/src/backend/config_typed.c index 07c2bb486..4c3604f82 100644 --- a/src/backend/config_typed.c +++ b/src/backend/config_typed.c @@ -38,8 +38,8 @@ extern LumieraConfig lumiera_global_config; * Here are the high level typed configuration interfaces defined. */ -int -lumiera_config_link_get (const char* key, char** value) +const char* +lumiera_config_link_get (const char* key, const char** value) { TRACE (config_typed); UNIMPLEMENTED(); @@ -47,7 +47,7 @@ lumiera_config_link_get (const char* key, char** value) } int -lumiera_config_link_set (const char* key, char** value) +lumiera_config_link_set (const char* key, const char** value) { TRACE (config_typed); UNIMPLEMENTED(); @@ -59,26 +59,23 @@ lumiera_config_link_set (const char* key, char** value) * Number * signed integer numbers, in different formats (decimal, hex, oct, binary(for masks)) */ -int +const char* lumiera_config_number_get (const char* key, long long* value) { TRACE (config_typed); - int ret = -1; - const char* raw_value = NULL; LUMIERA_RDLOCK_SECTION (config_typed, &lumiera_global_config->lock) { - if (!lumiera_config_get (key, &raw_value)) + if (lumiera_config_get (key, &raw_value)) { if (raw_value) { /* got it, scan it */ - if (sscanf (raw_value, "%Li", value) == 1) - ret = 0; /* all ok */ - else + if (sscanf (raw_value, "%Li", value) != 1) { + raw_value = NULL; LUMIERA_ERROR_SET (config_typed, CONFIG_SYNTAX_VALUE); } } @@ -87,7 +84,7 @@ lumiera_config_number_get (const char* key, long long* value) } } - return ret; + return raw_value; } int @@ -103,7 +100,7 @@ lumiera_config_number_set (const char* key, long long* value) * Real * floating point number in standard formats (see printf/scanf) */ -int +const char* lumiera_config_real_get (const char* key, long double* value) { TRACE (config_typed); @@ -183,36 +180,31 @@ scan_string (const char* in) return ret; } -int -lumiera_config_string_get (const char* key, char** value) +const char* +lumiera_config_string_get (const char* key, const char** value) { TRACE (config_typed); - int ret = -1; - - const char* raw_value = NULL; + const char* raw_value = *value = NULL; LUMIERA_RDLOCK_SECTION (config_typed, &lumiera_global_config->lock) { - if (!lumiera_config_get (key, &raw_value)) + if (lumiera_config_get (key, &raw_value)) { if (raw_value) { *value = scan_string (raw_value); - if (*value) - ret = 0; /* all ok */ - /* else error was raised by scan_string */ } else LUMIERA_ERROR_SET (config, CONFIG_NO_ENTRY); } } - return ret; + return *value; } int -lumiera_config_string_set (const char* key, char** value) +lumiera_config_string_set (const char* key, const char** value) { TRACE (config_typed); UNIMPLEMENTED(); @@ -247,35 +239,31 @@ scan_word (const char* in) return ret; } -int -lumiera_config_word_get (const char* key, char** value) +const char* +lumiera_config_word_get (const char* key, const char** value) { TRACE (config_typed, "KEY %s", key); - int ret = -1; - - const char* raw_value = NULL; + const char* raw_value = *value = NULL; LUMIERA_RDLOCK_SECTION (config_typed, &lumiera_global_config->lock) { - if (!lumiera_config_get (key, &raw_value)) + if (lumiera_config_get (key, &raw_value)) { if (raw_value) { *value = scan_word (raw_value); - if (*value) - ret = 0; /* all ok */ } else LUMIERA_ERROR_SET (config, CONFIG_NO_ENTRY); } } - return ret; + return *value; } int -lumiera_config_word_set (const char* key, char** value) +lumiera_config_word_set (const char* key, const char** value) { TRACE (config_typed); UNIMPLEMENTED(); @@ -287,7 +275,7 @@ lumiera_config_word_set (const char* key, char** value) * Bool * Bool in various formats, (0,1(!1), yes/no, true/false, on/off, set/clear) */ -int +const char* lumiera_config_bool_get (const char* key, int* value) { TRACE (config_typed); diff --git a/tests/backend/test-config.c b/tests/backend/test-config.c index c9b2aeca3..80446f0a0 100644 --- a/tests/backend/test-config.c +++ b/tests/backend/test-config.c @@ -94,7 +94,7 @@ TEST ("number_get") lumiera_config_setdefault (lumiera_tmpbuf_snprintf (SIZE_MAX, "%s = %s", argv[2], argv[3])); - if (!lumiera_config_number_get (argv[2], &number)) + if (lumiera_config_number_get (argv[2], &number)) printf ("%lld\n", number); else printf ("%s, %lld\n", lumiera_error (), number); @@ -111,7 +111,7 @@ TEST ("number_get_nodefault") long long number = 0; - if (!lumiera_config_number_get (argv[2], &number)) + if (lumiera_config_number_get (argv[2], &number)) printf ("%lld\n", number); else printf ("%s\n", lumiera_error ()); @@ -127,11 +127,11 @@ TEST ("string_get") lumiera_config_init ("./"); - char* string; + const char* string; lumiera_config_setdefault (lumiera_tmpbuf_snprintf (SIZE_MAX, "%s = %s", argv[2], argv[3])); - if (!lumiera_config_string_get (argv[2], &string)) + if (lumiera_config_string_get (argv[2], &string)) printf ("'%s'\n", string); else printf ("%s, '%s'\n", lumiera_error (), string); @@ -150,7 +150,7 @@ TEST ("string_set") FIXME ("handle error"); const char* string; - if (!lumiera_config_get (argv[2], &string)) + if (lumiera_config_get (argv[2], &string)) printf ("'%s'\n", string); else printf ("%s, '%s'\n", lumiera_error (), string); @@ -166,11 +166,11 @@ TEST ("word_get") lumiera_config_init ("./"); - char* word; + const char* word; lumiera_config_setdefault (lumiera_tmpbuf_snprintf (SIZE_MAX, "%s = %s", argv[2], argv[3])); - if (!lumiera_config_word_get (argv[2], &word)) + if (lumiera_config_word_get (argv[2], &word)) printf ("'%s'\n", word); else printf ("%s, '%s'\n", lumiera_error (), word); From 928847a193fac3744a996b68d426f0bd83269f38 Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Tue, 9 Sep 2008 21:36:06 +0200 Subject: [PATCH 008/100] little more verbose logging, dump some values at TRACE points --- src/backend/config_lookup.c | 14 +++++++------- src/backend/configitem.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/backend/config_lookup.c b/src/backend/config_lookup.c index 96c62c880..357d845dc 100644 --- a/src/backend/config_lookup.c +++ b/src/backend/config_lookup.c @@ -67,7 +67,7 @@ lumiera_config_lookup_destroy (LumieraConfigLookup self) LumieraConfigLookupentry lumiera_config_lookup_insert (LumieraConfigLookup self, LumieraConfigitem item) { - TRACE (config_lookup); + TRACE (config_lookup, "%s", item->line); REQUIRE (self); REQUIRE (item); REQUIRE (item->key); @@ -88,7 +88,7 @@ lumiera_config_lookup_insert (LumieraConfigLookup self, LumieraConfigitem item) LumieraConfigLookupentry lumiera_config_lookup_insert_default (LumieraConfigLookup self, LumieraConfigitem item) { - TRACE (config_lookup); + TRACE (config_lookup, "%s", item->line); REQUIRE (self); REQUIRE (item); REQUIRE (item->key); @@ -108,7 +108,7 @@ lumiera_config_lookup_insert_default (LumieraConfigLookup self, LumieraConfigite LumieraConfigitem lumiera_config_lookup_remove (LumieraConfigLookup self, LumieraConfigitem item) { - TRACE (config_lookup); + TRACE (config_lookup, "%s", item->line); REQUIRE (!llist_is_empty (&item->lookup), "item is not in a lookup"); if (llist_is_single (&item->lookup)) @@ -131,7 +131,7 @@ lumiera_config_lookup_remove (LumieraConfigLookup self, LumieraConfigitem item) LumieraConfigLookupentry lumiera_config_lookup_find (LumieraConfigLookup self, const char* key) { - TRACE (config_lookup); + TRACE (config_lookup, "%s", key); return (LumieraConfigLookupentry)psplay_find (&self->tree, key, 100); } @@ -139,7 +139,7 @@ lumiera_config_lookup_find (LumieraConfigLookup self, const char* key) LumieraConfigitem lumiera_config_lookup_item_find (LumieraConfigLookup self, const char* key) { - TRACE (config_lookup); + TRACE (config_lookup, "%s", key); LumieraConfigLookupentry entry = lumiera_config_lookup_find (self, key); @@ -154,7 +154,7 @@ lumiera_config_lookup_item_find (LumieraConfigLookup self, const char* key) LumieraConfigitem lumiera_config_lookup_item_tail_find (LumieraConfigLookup self, const char* key) { - TRACE (config_lookup); + TRACE (config_lookup, "%s", key); LumieraConfigLookupentry entry = lumiera_config_lookup_find (self, key); @@ -174,7 +174,7 @@ lumiera_config_lookup_item_tail_find (LumieraConfigLookup self, const char* key) LumieraConfigLookupentry lumiera_config_lookupentry_init (LumieraConfigLookupentry self, const char* key) { - TRACE (config_lookup, "key = %s", key); + TRACE (config_lookup, "%s", key); if (self) { psplaynode_init (&self->node); diff --git a/src/backend/configitem.c b/src/backend/configitem.c index 30f51498a..f3550da38 100644 --- a/src/backend/configitem.c +++ b/src/backend/configitem.c @@ -96,7 +96,7 @@ lumiera_configitem_destroy (LumieraConfigitem self, LumieraConfigLookup lookup) LumieraConfigitem lumiera_configitem_new (const char* line) { - TRACE (config_item); + TRACE (config_item, "%s", line); lumiera_configitem tmp; lumiera_configitem_init (&tmp); From 61735098ae1fd433d6ba5422a7f2ec41e33f79cf Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Tue, 9 Sep 2008 21:38:28 +0200 Subject: [PATCH 009/100] test for basic set and get --- tests/20config_lowlevel.tests | 5 +++++ tests/backend/test-config.c | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/tests/20config_lowlevel.tests b/tests/20config_lowlevel.tests index 6b1e0abbe..1bebedcbc 100644 --- a/tests/20config_lowlevel.tests +++ b/tests/20config_lowlevel.tests @@ -22,6 +22,11 @@ out: value = ' baz' END +TEST "set a config and retrieve it" basic_set_get 'foo' '=bar' < Date: Wed, 10 Sep 2008 13:14:07 +0200 Subject: [PATCH 010/100] First highlevel setter, small api change * setters return LumieraConfigitem (or NULL) instead int * the config_string_set works now --- src/backend/config.c | 2 +- src/backend/config.h | 5 +++-- src/backend/config_typed.c | 25 +++++++++++++++++-------- tests/backend/test-config.c | 8 ++++---- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/backend/config.c b/src/backend/config.c index d907645dc..43a20af41 100644 --- a/src/backend/config.c +++ b/src/backend/config.c @@ -65,7 +65,7 @@ const char* lumiera_config_defaults[] = "config.formatstr.real = '= %Lg'", "config.formatstr.real.dec = '= %Lf'", "config.formatstr.real.sci = '= %Le'", - "config.formatstr.string = '=%s'", + "config.formatstr.string = '= %s'", "config.formatstr.string.dquoted = '= \"%s\"'", "config.formatstr.string.quoted = '= ''%s'''", "config.formatstr.word = '= %s'", diff --git a/src/backend/config.h b/src/backend/config.h index 494e59961..d5e1cb058 100644 --- a/src/backend/config.h +++ b/src/backend/config.h @@ -52,6 +52,7 @@ LUMIERA_ERROR_DECLARE (CONFIG_DEFAULT); //TODO: Lumiera header includes// #include "backend/config_lookup.h" +#include "backend/configitem.h" //TODO: System includes// #include @@ -229,8 +230,8 @@ LUMIERA_CONFIG_TYPES /** * */ -#define LUMIERA_CONFIG_TYPE(name, type) \ - int \ +#define LUMIERA_CONFIG_TYPE(name, type) \ + LumieraConfigitem \ lumiera_config_##name##_set (const char* key, type* value); LUMIERA_CONFIG_TYPES #undef LUMIERA_CONFIG_TYPE diff --git a/src/backend/config_typed.c b/src/backend/config_typed.c index 4c3604f82..53c8abc09 100644 --- a/src/backend/config_typed.c +++ b/src/backend/config_typed.c @@ -46,7 +46,7 @@ lumiera_config_link_get (const char* key, const char** value) return 0; } -int +LumieraConfigitem lumiera_config_link_set (const char* key, const char** value) { TRACE (config_typed); @@ -87,7 +87,7 @@ lumiera_config_number_get (const char* key, long long* value) return raw_value; } -int +LumieraConfigitem lumiera_config_number_set (const char* key, long long* value) { TRACE (config_typed); @@ -108,7 +108,7 @@ lumiera_config_real_get (const char* key, long double* value) return 0; } -int +LumieraConfigitem lumiera_config_real_set (const char* key, long double* value) { TRACE (config_typed); @@ -203,12 +203,20 @@ lumiera_config_string_get (const char* key, const char** value) return *value; } -int +LumieraConfigitem lumiera_config_string_set (const char* key, const char** value) { TRACE (config_typed); - UNIMPLEMENTED(); - return 0; + + LumieraConfigitem item = NULL; + + LUMIERA_WRLOCK_SECTION (config_typed, &lumiera_global_config->lock) + { + const char* fmt = "= %s"; TODO ("use the config system (config.format*...) to deduce the desired format for this key"); + item = lumiera_config_set (key, lumiera_tmpbuf_snprintf (SIZE_MAX, fmt, *value)); + } + + return item; } @@ -262,7 +270,7 @@ lumiera_config_word_get (const char* key, const char** value) return *value; } -int +LumieraConfigitem lumiera_config_word_set (const char* key, const char** value) { TRACE (config_typed); @@ -283,7 +291,8 @@ lumiera_config_bool_get (const char* key, int* value) return 0; } -int + +LumieraConfigitem lumiera_config_bool_set (const char* key, int* value) { TRACE (config_typed); diff --git a/tests/backend/test-config.c b/tests/backend/test-config.c index de1fdca54..88166776a 100644 --- a/tests/backend/test-config.c +++ b/tests/backend/test-config.c @@ -171,14 +171,14 @@ TEST ("string_set") lumiera_config_init ("./"); - lumiera_config_string_set (argv[2], &argv[3]); - FIXME ("handle error"); + if (!lumiera_config_string_set (argv[2], &argv[3])) + printf ("failed setting string '%s=%s': %s\n", argv[2], argv[3], lumiera_error ()); const char* string; - if (lumiera_config_get (argv[2], &string)) + if (lumiera_config_string_get (argv[2], &string)) printf ("'%s'\n", string); else - printf ("%s, '%s'\n", lumiera_error (), string); + printf ("%s\n", lumiera_error ()); lumiera_config_destroy (); } From 4b2973de27e04b1e2c457aa8114459cc18fdcb1c Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Wed, 10 Sep 2008 13:14:50 +0200 Subject: [PATCH 011/100] some cosmetics, removed the CONFIG_DEFAULT error which is not used anymore --- src/backend/config.c | 7 ++----- src/backend/config.h | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/backend/config.c b/src/backend/config.c index 43a20af41..2e724be08 100644 --- a/src/backend/config.c +++ b/src/backend/config.c @@ -50,7 +50,7 @@ LUMIERA_ERROR_DEFINE (CONFIG_SYNTAX, "syntax error in configfile"); LUMIERA_ERROR_DEFINE (CONFIG_SYNTAX_KEY, "syntax error in key"); LUMIERA_ERROR_DEFINE (CONFIG_SYNTAX_VALUE, "syntax error in value"); LUMIERA_ERROR_DEFINE (CONFIG_NO_ENTRY, "no configuration entry"); -LUMIERA_ERROR_DEFINE (CONFIG_DEFAULT, "illegal default value"); + /** * defaults for the configuraton system itself @@ -248,9 +248,8 @@ lumiera_config_set (const char* key, const char* delim_value) LumieraConfigitem item = lumiera_config_lookup_item_find (&lumiera_global_config->keys, key); if (item && item->parent != &lumiera_global_config->defaults) { - TODO ("a user writeable file?"); + TODO ("is a user writeable file?"); TODO (" replace delim_value"); - //LumieraConfigitem lumiera_configitem_set_value (item, delim_value); } else @@ -279,8 +278,6 @@ lumiera_config_set (const char* key, const char* delim_value) } } - TODO ("return item?"); - return item; } diff --git a/src/backend/config.h b/src/backend/config.h index d5e1cb058..80f33a6d5 100644 --- a/src/backend/config.h +++ b/src/backend/config.h @@ -48,7 +48,7 @@ LUMIERA_ERROR_DECLARE (CONFIG_SYNTAX); LUMIERA_ERROR_DECLARE (CONFIG_SYNTAX_KEY); LUMIERA_ERROR_DECLARE (CONFIG_SYNTAX_VALUE); LUMIERA_ERROR_DECLARE (CONFIG_NO_ENTRY); -LUMIERA_ERROR_DECLARE (CONFIG_DEFAULT); + //TODO: Lumiera header includes// #include "backend/config_lookup.h" @@ -237,6 +237,7 @@ LUMIERA_CONFIG_TYPES #undef LUMIERA_CONFIG_TYPE + // * {{{ lumiera_config_reset(...) }}} // * reset a value by key to the system default values, thus removes a user's configuration line. /** From 7c992c000dd3847265886580a7ef7127be36c692 Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Wed, 10 Sep 2008 15:16:40 +0200 Subject: [PATCH 012/100] config setters for number and word, thats it for now --- src/backend/config_typed.c | 26 ++++++++++++++++---- tests/22config_highlevel.tests | 6 +++-- tests/backend/test-config.c | 43 ++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 7 deletions(-) diff --git a/src/backend/config_typed.c b/src/backend/config_typed.c index 53c8abc09..ae490ff2b 100644 --- a/src/backend/config_typed.c +++ b/src/backend/config_typed.c @@ -91,8 +91,16 @@ LumieraConfigitem lumiera_config_number_set (const char* key, long long* value) { TRACE (config_typed); - UNIMPLEMENTED(); - return 0; + + LumieraConfigitem item = NULL; + + LUMIERA_WRLOCK_SECTION (config_typed, &lumiera_global_config->lock) + { + const char* fmt = "= %lld"; TODO ("use the config system (config.format*...) to deduce the desired format for this key"); + item = lumiera_config_set (key, lumiera_tmpbuf_snprintf (SIZE_MAX, fmt, *value)); + } + + return item; } @@ -239,7 +247,7 @@ scan_word (const char* in) char* end = ret; /* chop trailing blanks */ - while (*end != ' ' && *end != '\t') + while (*end && *end != ' ' && *end != '\t') ++end; *end++ = '\0'; @@ -274,8 +282,16 @@ LumieraConfigitem lumiera_config_word_set (const char* key, const char** value) { TRACE (config_typed); - UNIMPLEMENTED(); - return 0; + + LumieraConfigitem item = NULL; + + LUMIERA_WRLOCK_SECTION (config_typed, &lumiera_global_config->lock) + { + const char* fmt = "= %s"; TODO ("use the config system (config.format*...) to deduce the desired format for this key"); + item = lumiera_config_set (key, lumiera_tmpbuf_snprintf (SIZE_MAX, fmt, scan_word (*value))); + } + + return item; } diff --git a/tests/22config_highlevel.tests b/tests/22config_highlevel.tests index c8c175319..e0e4995c8 100644 --- a/tests/22config_highlevel.tests +++ b/tests/22config_highlevel.tests @@ -61,7 +61,8 @@ out: LUMIERA_ERROR_CONFIG_NO_ENTRY:no configuration entry END -PLANNED "number set" < Date: Fri, 12 Sep 2008 20:55:54 +0100 Subject: [PATCH 013/100] Moved buttons to the timeline --- src/gui/panels/timeline-panel.cpp | 14 ++++++++++++++ src/gui/panels/timeline-panel.hpp | 15 +++++++++++---- src/gui/panels/viewer-panel.cpp | 13 ++----------- src/gui/panels/viewer-panel.hpp | 13 ++----------- 4 files changed, 29 insertions(+), 26 deletions(-) diff --git a/src/gui/panels/timeline-panel.cpp b/src/gui/panels/timeline-panel.cpp index 65e9ae6b7..b079c0b2f 100644 --- a/src/gui/panels/timeline-panel.cpp +++ b/src/gui/panels/timeline-panel.cpp @@ -39,6 +39,11 @@ const int TimelinePanel::ZoomToolSteps = 2; // 2 seems comfortable TimelinePanel::TimelinePanel() : Panel("timeline", _("Timeline"), "panel_timeline"), + previousButton(Stock::MEDIA_PREVIOUS), + rewindButton(Stock::MEDIA_REWIND), + playPauseButton(Stock::MEDIA_PLAY), + forwardButton(Stock::MEDIA_FORWARD), + nextButton(Stock::MEDIA_NEXT), arrowTool(Gtk::StockID("tool_arrow")), iBeamTool(Gtk::StockID("tool_i_beam")), zoomIn(Stock::ZOOM_IN), @@ -52,6 +57,13 @@ TimelinePanel::TimelinePanel() : // Setup the toolbar timeIndicatorButton.set_label_widget(timeIndicator); + + toolbar.append(previousButton); + toolbar.append(rewindButton); + toolbar.append(playPauseButton); + toolbar.append(forwardButton); + toolbar.append(nextButton); + toolbar.append(timeIndicatorButton); toolbar.append(seperator1); @@ -60,7 +72,9 @@ TimelinePanel::TimelinePanel() : &TimelinePanel::on_arrow_tool)); toolbar.append(iBeamTool, mem_fun(this, &TimelinePanel::on_ibeam_tool)); + toolbar.append(seperator2); + toolbar.append(zoomIn, mem_fun(this, &TimelinePanel::on_zoom_in)); toolbar.append(zoomOut, mem_fun(this, &TimelinePanel::on_zoom_out)); diff --git a/src/gui/panels/timeline-panel.hpp b/src/gui/panels/timeline-panel.hpp index b46218e87..e154e9a26 100644 --- a/src/gui/panels/timeline-panel.hpp +++ b/src/gui/panels/timeline-panel.hpp @@ -75,6 +75,16 @@ private: TimelineWidget timelineWidget; // Toolbar Widgets + + Gtk::Label timeIndicator; + Gtk::ToolButton timeIndicatorButton; + + Gtk::ToolButton previousButton; + Gtk::ToolButton rewindButton; + Gtk::ToolButton playPauseButton; + Gtk::ToolButton forwardButton; + Gtk::ToolButton nextButton; + Gtk::ToggleToolButton arrowTool; Gtk::ToggleToolButton iBeamTool; @@ -84,10 +94,7 @@ private: Gtk::ToolButton zoomOut; Gtk::SeparatorToolItem seperator2; - - Gtk::Label timeIndicator; - Gtk::ToolButton timeIndicatorButton; - + // Internals bool updatingToolbar; diff --git a/src/gui/panels/viewer-panel.cpp b/src/gui/panels/viewer-panel.cpp index 323859b9a..ee129a606 100644 --- a/src/gui/panels/viewer-panel.cpp +++ b/src/gui/panels/viewer-panel.cpp @@ -31,20 +31,11 @@ namespace gui { namespace panels { ViewerPanel::ViewerPanel() : - Panel("viewer", _("Viewer"), "panel_viewer"), - previousButton(Stock::MEDIA_PREVIOUS), - rewindButton(Stock::MEDIA_REWIND), - playPauseButton(Stock::MEDIA_PLAY), - forwardButton(Stock::MEDIA_FORWARD), - nextButton(Stock::MEDIA_NEXT) + Panel("viewer", _("Viewer"), "panel_viewer") { //----- Set up the Tool Bar -----// // Add the commands - toolBar.append(previousButton); - toolBar.append(rewindButton); - toolBar.append(playPauseButton); - toolBar.append(forwardButton); - toolBar.append(nextButton); + // Configure the toolbar toolBar.set_toolbar_style(TOOLBAR_ICONS); diff --git a/src/gui/panels/viewer-panel.hpp b/src/gui/panels/viewer-panel.hpp index 9f92b4f63..5400aee41 100644 --- a/src/gui/panels/viewer-panel.hpp +++ b/src/gui/panels/viewer-panel.hpp @@ -31,9 +31,6 @@ #include "panel.hpp" #include "../widgets/video-display-widget.hpp" -using namespace lumiera::gui::widgets; -using namespace Gtk; - namespace lumiera { namespace gui { namespace panels { @@ -45,14 +42,8 @@ namespace panels { protected: - ToolButton previousButton; - ToolButton rewindButton; - ToolButton playPauseButton; - ToolButton forwardButton; - ToolButton nextButton; - - VideoDisplayWidget display; - Toolbar toolBar; + lumiera::gui::widgets::VideoDisplayWidget display; + Gtk::Toolbar toolBar; }; } // namespace panels From f9452f654cf39a4abbbeecfd81bef51aa347b321 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 12 Sep 2008 03:42:32 +0200 Subject: [PATCH 014/100] start media stream type classification framework --- src/common/p.hpp | 2 +- src/common/streamtype.cpp | 33 ++++++++++++ src/common/streamtype.hpp | 99 ++++++++++++++++++++++++++++++++++++ src/proc/asset/struct.hpp | 2 +- src/proc/engine/procnode.hpp | 2 +- src/proc/stypemanager.cpp | 33 ++++++++++++ src/proc/stypemanager.hpp | 50 ++++++++++++++++++ wiki/renderengine.html | 15 +++--- 8 files changed, 226 insertions(+), 10 deletions(-) create mode 100644 src/common/streamtype.cpp create mode 100644 src/common/streamtype.hpp create mode 100644 src/proc/stypemanager.cpp create mode 100644 src/proc/stypemanager.hpp diff --git a/src/common/p.hpp b/src/common/p.hpp index d4cc2f11c..0a303ace7 100644 --- a/src/common/p.hpp +++ b/src/common/p.hpp @@ -63,7 +63,7 @@ namespace lumiera * std::tr1::shared_ptr, but forwarding type relationships and * ordering operators to the pointee objects. * @param TAR the visible pointee type - * @param the shared-ptr type used as implementation + * @param BASE the shared-ptr type used as implementation * @note if the BASE smart-ptr type used as implementation * implies another pointer type than the one used on * the interface (=type TAR), then every access to the diff --git a/src/common/streamtype.cpp b/src/common/streamtype.cpp new file mode 100644 index 000000000..b54bd5751 --- /dev/null +++ b/src/common/streamtype.cpp @@ -0,0 +1,33 @@ +/* + StreamType - classification of media stream types + + Copyright (C) Lumiera.org + 2008, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "common/streamtype.hpp" + + +namespace lumiera + { + + /** */ + + +} // namespace lumiera diff --git a/src/common/streamtype.hpp b/src/common/streamtype.hpp new file mode 100644 index 000000000..5e3a3592b --- /dev/null +++ b/src/common/streamtype.hpp @@ -0,0 +1,99 @@ +/* + STREAMTYPE.hpp - classification of media stream types + + Copyright (C) Lumiera.org + 2008, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +#ifndef LUMIERA_STREAMTYPE_HPP +#define LUMIERA_STREAMTYPE_HPP + + +#include "common/query.hpp" + +#include + + +namespace lumiera + { + + + /** + * + */ + struct StreamType : boost::noncopyable + { + enum MediaKind + { + VIDEO, + IMMAGE, + AUDIO, + MIDI + }; + + enum Usage + { + RAW, + SOURCE, + TARGET, + INTERMEDIARY + }; + + struct Prototype; + + class ImplFacade; + + + MediaKind kind; + Prototype const& prototype; + ImplFacade * implType; + Usage usageTag; + + }; + + + + /** + * + */ + struct StreamType::Prototype + { + Symbol id; + + bool subsumes (Prototype const& other) const; + bool canConvert (Prototype const& other) const; + }; + + + + /** + * + */ + class StreamType::ImplFacade + { + public: + Symbol libraryID; + + }; + + + + +} // namespace lumiera +#endif diff --git a/src/proc/asset/struct.hpp b/src/proc/asset/struct.hpp index 5941bd13a..530f1efa6 100644 --- a/src/proc/asset/struct.hpp +++ b/src/proc/asset/struct.hpp @@ -74,7 +74,7 @@ namespace asset /** * key abstraction: structural asset - * @todo just a stub, have to figure out what a asset::Proc is + * @todo just a stub, have to figure out what a asset::Struct is */ class Struct : public Asset { diff --git a/src/proc/engine/procnode.hpp b/src/proc/engine/procnode.hpp index 343c6a6e8..9cf3a2ea8 100644 --- a/src/proc/engine/procnode.hpp +++ b/src/proc/engine/procnode.hpp @@ -61,7 +61,7 @@ namespace engine { typedef ProcNode* PNode; template - struct RefArray + struct RefArray ///< @todo need an implementation and then probably move it into library { virtual E const& operator[] (uint i) const =0; virtual ~RefArray() {} diff --git a/src/proc/stypemanager.cpp b/src/proc/stypemanager.cpp new file mode 100644 index 000000000..58eb23944 --- /dev/null +++ b/src/proc/stypemanager.cpp @@ -0,0 +1,33 @@ +/* + STypeManager - entry point for dealing with media stream types + + Copyright (C) Lumiera.org + 2008, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "proc/stypemanager.hpp" + +namespace proc_interface + { + + /** */ + + + +} // namespace proc_interface diff --git a/src/proc/stypemanager.hpp b/src/proc/stypemanager.hpp new file mode 100644 index 000000000..d7eeef836 --- /dev/null +++ b/src/proc/stypemanager.hpp @@ -0,0 +1,50 @@ +/* + STYPEMANAGER.hpp - entry point for dealing with media stream types + + Copyright (C) Lumiera.org + 2008, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +#ifndef PROC_INTERFACE_STATE_H +#define PROC_INTERFACE_STATE_H + + +#include "common/streamtype.hpp" + + + +namespace proc_interface { + + using lumiera::Symbol; + + + class STypeManager + { + protected: + virtual ~STypeManager() {}; + + + public: + lumiera::StreamType const& getType (Symbol sTypeID) ; + }; + + + +} // namespace proc_interface +#endif diff --git a/wiki/renderengine.html b/wiki/renderengine.html index 64559e1e0..d5d2bda01 100644 --- a/wiki/renderengine.html +++ b/wiki/renderengine.html @@ -3310,22 +3310,23 @@ if (oldText.indexOf("SplashScreen")==-1) * in a future version, it may also encapsulate the communication in a distributed render farm -
+
The stream Prototype is part of the specification of a media stream's type. It is a semantic (or problem domain oriented) concept and should be distinguished from the actual implementation type of the media stream. The latter is provided by an [[library implementation|StreamTypeImplFacade]]. While there are some common predefined prototypes, mostly, they are defined within the concrete [[Session]] according to the user's needs. 
 
-Prototypes form an open (extensible) collection, though each prototype belongs to a specific media kind ({{{VIDEO, IMAGE, AUDIO, MIDI,...}}}). The ''distinguishing property'' of a stream prototype is that any [[Pipe]] can process //streams of a specific prototype only.// Thus, two streams with different prototype can be considered "something quite different" from the users point of view, while two streams belonging to the same prototype can be considered equivalent (and will be converted automatically when their implementation types differ). Note this definition is //deliberately fuzzy,// because it depends on the actual situation of the project in question.
+Prototypes form an open (extensible) collection, though each prototype belongs to a specific media kind ({{{VIDEO, IMAGE, AUDIO, MIDI,...}}}).
+The ''distinguishing property'' of a stream prototype is that any [[Pipe]] can process //streams of a specific prototype only.// Thus, two streams with different prototype can be considered "something quite different" from the users point of view, while two streams belonging to the same prototype can be considered equivalent (and will be converted automatically when their implementation types differ). Note this definition is //deliberately fuzzy,// because it depends on the actual situation of the project in question.
 
 Consequently, as we can't get away with an fixed Enum of all stream prototypes, the implementation must rely on a query interface. The intention is to provide a basic set of rules for deciding queries about the most common stream prototypes; besides, a specific session may inject additional rules or utilize a completely different knowledge base. Thus, for a given StreamTypeDescriptor specifying a prototype
 * we can get a [[default|DefaultsManagement]] implementation type
 * we can get a default prototype to a given implementation type by a similar query
-* we can query if a implementation type in question can be //subsumed// under this prototype
+* we can query if a implementation type in question can be //subsumed// by this prototype
 * we can determine if another prototype is //convertible//
 
 !!Examples
-NTSC and PAL video, video versus digitized film, HD video versus SD video, 3D versus flat video, cinemascope versus 4:3, stereophonic versus monaural, periphonic versus panoramic sound, Ambisonics versus 5.1, dolby versus dts,...
+NTSC and PAL video, video versus digitized film, HD video versus SD video, 3D versus flat video, cinemascope versus 4:3, stereophonic versus monaural, periphonic versus panoramic sound, Ambisonics versus 5.1, dolby versus linear PCM...
 
-
+
//how to classify and describe media streams//
 Media data is understood to appear structured as stream(s) over time. While there may be an inherent internal structuring, at a given perspective ''any stream is a unit and homogeneous''. In the context of digital media data processing, streams are always ''quantized'', which means they appear as a temporal sequence of data chunks called ''frames''.
 
@@ -3347,8 +3348,8 @@ A stream type is denoted by a StreamTypeID, which is an identifier, acting as an
 !! Classification
 Within the Proc-Layer, media streams are treated largely in a similar manner. But, looking closer, note everything can be connected together, while on the other hand there may be some classes of media streams which can be considered //equivalent// in most respects. Thus, it seems reasonable to separate the distinction between various media streams into several levels
 * Each media belongs to a fundamental ''kind'' of media, examples being __Video__, __Image__, __Audio__, __MIDI__,... Media streams of different kind can be considered somewhat "completely separate" &mdash; just the handling of each of those media kinds follows a common //generic pattern// augmented with specialisations. Basically, it is //impossible to connect// media streams of different kind. Under some circumstances there may be the possibility of a //transformation// though. For example, a still image can be incorporated into video, sound may be visualized, MIDI may control a sound synthesizer.
-* Below the level of distinct kinds of media streams, within every kind we have an open ended collection of ''prototypes'', which, when compared directly may each be quite distinct and different, but which may be //rendered//&nbsp; into each other. For example, we have stereoscopic (3D) video and we have the common flat video lacking depth information, we have several spatial audio systems (Ambisonics, Wave Field Synthesis), we have panorama simulating sound systems (5.1, 7.1,...), we have common stereophonic and monaural audio. It is considered important to retain some openness and configurability within this level of distinction, which means this classification should better be done by rules then by setting up a fixed property table. For example, it may be desirable for some production to distinguish between digitized film and video NTSC and PAL, while in another production everything is just "video" and can be converted mostly automatically. The most noticeable consequence of such a distinction is that any Bus or [[Pipe]] is always limited to a media stream of a single prototype. (&rarr; [[more|StreamPrototype]])
-* Besides the distinction by prototypes, there are the various media ''implementation types''. This classification is not necessarily hierarchically related to the prototype classification, while in practice commonly there will be some sort of dependency. For example, both stereophonic and monaural audio may be implemented as 96kHz 24bit PCM with just a different number of channel streams, as well as we may have a dedicated stereo audio stream with two channels multiplexed into a single stream. For dealing with media streams of various implementation type, we need library routines, which also yield a type classification system. Most notably, for raw sound and video data we use the GAVL library, which defines a classification system for buffers and streams.
+* Below the level of distinct kinds of media streams, within every kind we have an open ended collection of ''prototypes'', which, when compared directly may each be quite distinct and different, but which may be //rendered//&nbsp; into each other. For example, we have stereoscopic (3D) video and we have the common flat video lacking depth information, we have several spatial audio systems (Ambisonics, Wave Field Synthesis), we have panorama simulating sound systems (5.1, 7.1,...), we have common stereophonic and monaural audio. It is considered important to retain some openness and configurability within this level of distinction, which means this classification should better be done by rules then by setting up a fixed property table. For example, it may be desirable for some production to distinguish between digitized film and video NTSC and PAL, while in another production everything is just "video" and can be converted automatically. The most noticeable consequence of such a distinction is that any Bus or [[Pipe]] is always limited to a media stream of a single prototype. (&rarr; [[more|StreamPrototype]])
+* Besides the distinction by prototypes, there are the various media ''implementation types''. This classification is not necessarily hierarchically related to the prototype classification, while in practice commonly there will be some sort of dependency. For example, both stereophonic and monaural audio may be implemented as 96kHz 24bit PCM with just a different number of channel streams, as well we may have a dedicated stereo audio stream with two channels multiplexed into a single stream. For dealing with media streams of various implementation type, we need //library// routines, which also yield a //type classification system.// Most notably, for raw sound and video data we use the GAVL library, which defines a classification system for buffers and streams.
 * Besides the type classification detailed thus far, we introduce an ''intention tag''. This is a synthetic classification owned by Lumiera and used for internal wiring decisions. Currently (8/08), we recognize the following intention tags: __Source__, __Raw__, __Intermediary__ and __Target__. Only media streams tagged as __Raw__ can be processed.
 
 !! Media handling requirements involving stream type classification

From becfcb3935c8f2307162ef06988a82c4c96805fa Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 13 Sep 2008 01:59:39 +0200
Subject: [PATCH 015/100] increase timeout (2sec) to avoid problems when
 running in a VM

---
 tests/test.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test.sh b/tests/test.sh
index d919ed073..e2d5159b7 100755
--- a/tests/test.sh
+++ b/tests/test.sh
@@ -30,7 +30,7 @@ export LC_ALL=C
 arg0="$0"
 srcdir="$(dirname "$arg0")"
 
-ulimit -S -t 1 -v 524288
+ulimit -S -t 2 -v 524288
 valgrind=""
 if [ "$VALGRINDFLAGS" = 'DISABLE' ]; then
     echo "valgrind explicit disabled"

From d4e3405f09d0bfdb2eacd68e5fe9911d05cb0306 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 13 Sep 2008 03:59:36 +0200
Subject: [PATCH 016/100] some namespace rearrangements

---
 src/common/streamtype.cpp                     |   1 +
 src/common/streamtype.hpp                     |  10 ++
 .../controller => control}/pathmanager.cpp    |  26 ++--
 .../controller => control}/pathmanager.hpp    |  37 +++--
 .../controller => control}/renderstate.hpp    |  45 +++---
 src/proc/{ => control}/stypemanager.cpp       |   8 +-
 src/proc/{ => control}/stypemanager.hpp       |  13 +-
 src/proc/engine/nodewiringconfig.hpp          |   3 +
 src/proc/lumiera.hpp                          |  74 +++++++++-
 uml/lumiera/128261                            |   4 +-
 uml/lumiera/128517                            | 128 +++++++++++++++++-
 uml/lumiera/129029                            |  25 +++-
 uml/lumiera/129285                            |   4 +-
 uml/lumiera/129413                            |  42 +++++-
 uml/lumiera/129669                            |   6 +-
 uml/lumiera/130181                            |   4 +-
 uml/lumiera/130693                            |  50 ++++++-
 uml/lumiera/131077                            |   6 +-
 uml/lumiera/132485.diagram                    |  49 +++++++
 uml/lumiera/5.session                         |  19 +--
 20 files changed, 448 insertions(+), 106 deletions(-)
 rename src/proc/{mobject/controller => control}/pathmanager.cpp (77%)
 rename src/proc/{mobject/controller => control}/pathmanager.hpp (64%)
 rename src/proc/{mobject/controller => control}/renderstate.hpp (55%)
 rename src/proc/{ => control}/stypemanager.cpp (91%)
 rename src/proc/{ => control}/stypemanager.hpp (89%)
 create mode 100644 uml/lumiera/132485.diagram

diff --git a/src/common/streamtype.cpp b/src/common/streamtype.cpp
index b54bd5751..a230ba7d4 100644
--- a/src/common/streamtype.cpp
+++ b/src/common/streamtype.cpp
@@ -28,6 +28,7 @@ namespace lumiera
   {
 
    /** */
+   int bla = 3;
   
 
 } // namespace lumiera
diff --git a/src/common/streamtype.hpp b/src/common/streamtype.hpp
index 5e3a3592b..86bf9a6bf 100644
--- a/src/common/streamtype.hpp
+++ b/src/common/streamtype.hpp
@@ -20,6 +20,16 @@
  
 */
 
+/** @file streamtype.hpp
+ ** Framework for classification of media streams.
+ ** Besides the actual implementation type of a media stream, the Proc-Layer
+ ** needs a more general way for accessing, comparing and manipulating media streams
+ ** based on type information.
+ ** 
+ ** @see control::STypeManager
+ ** 
+ */
+
 
 #ifndef LUMIERA_STREAMTYPE_HPP
 #define LUMIERA_STREAMTYPE_HPP
diff --git a/src/proc/mobject/controller/pathmanager.cpp b/src/proc/control/pathmanager.cpp
similarity index 77%
rename from src/proc/mobject/controller/pathmanager.cpp
rename to src/proc/control/pathmanager.cpp
index bf3c359ab..cf2a01a25 100644
--- a/src/proc/mobject/controller/pathmanager.cpp
+++ b/src/proc/control/pathmanager.cpp
@@ -21,23 +21,19 @@
 * *****************************************************/
 
 
-#include "proc/mobject/controller/pathmanager.hpp"
+#include "proc/control/pathmanager.hpp"
 
-namespace mobject
+namespace control {
+
+
+
+  engine::Processor *
+  PathManager::buildProcessor ()
   {
-  namespace controller
-    {
+    UNIMPLEMENTED ("build a complete processor and optimize render path");
+    return 0;//////////////////TODO
+  }
 
 
 
-    engine::Processor *
-    PathManager::buildProcessor ()
-    {
-      return 0;//////////////////TODO
-    }
-
-
-
-  } // namespace mobject::controller
-
-} // namespace mobject
+} // namespace control
diff --git a/src/proc/mobject/controller/pathmanager.hpp b/src/proc/control/pathmanager.hpp
similarity index 64%
rename from src/proc/mobject/controller/pathmanager.hpp
rename to src/proc/control/pathmanager.hpp
index a29cd2f94..355c500dd 100644
--- a/src/proc/mobject/controller/pathmanager.hpp
+++ b/src/proc/control/pathmanager.hpp
@@ -21,34 +21,29 @@
 */
 
 
-#ifndef MOBJECT_CONTROLLER_PATHMANAGER_H
-#define MOBJECT_CONTROLLER_PATHMANAGER_H
+#ifndef CONTROL_PATHMANAGER_H
+#define CONTROL_PATHMANAGER_H
 
 #include "proc/engine/processor.hpp"
 
 
 
-namespace mobject
-  {
-  namespace controller
+namespace control {
+  
+  
+  /**
+   * While building a render engine, this Strategy class 
+   * decides on the actual render strategy in accordance
+   * to the current controller settings (system state)
+   */
+  class PathManager
     {
-
-
-    /**
-     * While building a render engine, this Strategy class 
-     * decides on the actual render strategy in accordance
-     * to the current controller settings (system state)
-     */
-    class PathManager
-      {
-      public:
-        engine::Processor* buildProcessor () ;
-        // TODO: allocation, GC??
-      };
+    public:
+      engine::Processor* buildProcessor () ;
+      // TODO: allocation, GC??
+    };
 
 
 
-  } // namespace mobject::controller
-
-} // namespace mobject
+} // namespace control
 #endif
diff --git a/src/proc/mobject/controller/renderstate.hpp b/src/proc/control/renderstate.hpp
similarity index 55%
rename from src/proc/mobject/controller/renderstate.hpp
rename to src/proc/control/renderstate.hpp
index 833e2d347..d62e56628 100644
--- a/src/proc/mobject/controller/renderstate.hpp
+++ b/src/proc/control/renderstate.hpp
@@ -21,38 +21,33 @@
 */
 
 
-#ifndef MOBJECT_CONTROLLER_RENDERSTATE_H
-#define MOBJECT_CONTROLLER_RENDERSTATE_H
+#ifndef CONTROL_RENDERSTATE_H
+#define CONTROL_RENDERSTATE_H
 
 #include "proc/state.hpp"
 
 
 
-namespace mobject
-  {
-  namespace controller
+namespace control {
+  
+  typedef proc_interface::State State;
+  
+  
+  /**
+   * Encapsulates the logic used to get a "current render process"
+   * in accordance to the currently applicable controller settings.
+   * The provided StateProxy serves to hold any mutalbe state used
+   * in the render process, so the rest of the render engine 
+   * can be stateless.
+   * @todo probably the state management will work different (6/08)
+   */
+  class RenderState
     {
-
-    typedef proc_interface::State State;
-
-
-    /**
-     * Encapsulates the logic used to get a "current render process"
-     * in accordance to the currently applicable controller settings.
-     * The provided StateProxy serves to hold any mutalbe state used
-     * in the render process, so the rest of the render engine 
-     * can be stateless.
-     * @todo probably the state management will work different (6/08)
-     */
-    class RenderState
-      {
-      public:
-        State& getRenderProcess () ;
-      };
+    public:
+      State& getRenderProcess () ;
+    };
 
 
 
-  } // namespace mobject::controller
-
-} // namespace mobject
+} // namespace control
 #endif
diff --git a/src/proc/stypemanager.cpp b/src/proc/control/stypemanager.cpp
similarity index 91%
rename from src/proc/stypemanager.cpp
rename to src/proc/control/stypemanager.cpp
index 58eb23944..9c1e60d08 100644
--- a/src/proc/stypemanager.cpp
+++ b/src/proc/control/stypemanager.cpp
@@ -21,13 +21,13 @@
 * *****************************************************/
 
 
-#include "proc/stypemanager.hpp"
+#include "proc/control/stypemanager.hpp"
 
-namespace proc_interface
-  {
+namespace control {
+  
   
   /** */
   
   
   
-} // namespace proc_interface
+} // namespace control
diff --git a/src/proc/stypemanager.hpp b/src/proc/control/stypemanager.hpp
similarity index 89%
rename from src/proc/stypemanager.hpp
rename to src/proc/control/stypemanager.hpp
index d7eeef836..ef99689d5 100644
--- a/src/proc/stypemanager.hpp
+++ b/src/proc/control/stypemanager.hpp
@@ -21,15 +21,15 @@
 */
 
 
-#ifndef PROC_INTERFACE_STATE_H
-#define PROC_INTERFACE_STATE_H
+#ifndef CONTROL_STYPEMANAGER_H
+#define CONTROL_STYPEMANAGER_H
 
 
 #include "common/streamtype.hpp"
 
 
 
-namespace proc_interface {
+namespace control {
   
   using lumiera::Symbol;
   
@@ -45,6 +45,13 @@ namespace proc_interface {
     };
   
   
+} // namespace control
+
+
+namespace proc_interface {
   
+  using control::STypeManager;
+
+
 } // namespace proc_interface
 #endif
diff --git a/src/proc/engine/nodewiringconfig.hpp b/src/proc/engine/nodewiringconfig.hpp
index aac1ff7a1..562767ccc 100644
--- a/src/proc/engine/nodewiringconfig.hpp
+++ b/src/proc/engine/nodewiringconfig.hpp
@@ -19,6 +19,7 @@
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  
 */
+
 /** @file nodewiringconfig.hpp
  ** Sometimes we need to coose a different implementation for dealing with
  ** some special cases. While for simple cases, just testing a flag or using a
@@ -44,6 +45,8 @@
  ** @see configflags.hpp
  ** 
  */
+
+
 #ifndef ENGINE_NODEWIRINGCONFIG_H
 #define ENGINE_NODEWIRINGCONFIG_H
 
diff --git a/src/proc/lumiera.hpp b/src/proc/lumiera.hpp
index 49822b469..f9ce3b838 100644
--- a/src/proc/lumiera.hpp
+++ b/src/proc/lumiera.hpp
@@ -22,6 +22,18 @@
  
 */
 
+/** @file lumiera.hpp
+ ** Basic set of definitions and includes commonly used together.
+ ** Including lumiera.hpp gives you a common set of elementary declarations
+ ** widely used within the C++ code of the Proc-Layer.
+ ** 
+ ** @see main.cpp
+ ** @see pre.hpp
+ ** 
+ */
+
+
+
 #ifndef LUMIERA_H
 #define LUMIERA_H
 
@@ -37,11 +49,67 @@
 #include "lib/appconfig.hpp"
 
 
-namespace lumiera
-  {
-    /* additional global configuration goes here... */
+/**
+ * Namespace for globals.
+ * A small number of definitions and facilities of application wide relevance.
+ * It's probably a good idea to pull it in explicitly and to avoid nesting
+ * implementation namespaces within \c lumiera::
+ */
+namespace lumiera {
+
+  /* additional global configuration goes here... */
   
     
 } // namespace lumiera
 
+
+/**
+ * Namespace for support and library code.
+ */
+namespace lib { 
+
+}
+
+
+/**
+ * The asset subsystem of the Proc-Layer.
+ */
+namespace asset { }
+
+
+/**
+ * Proc-Layer dispatcher, controller and administrative facilities.
+ */
+namespace control { }
+
+
+/**
+ * Render engine code as part of the Proc-Layer.
+ * Backbone of the engine, render nodes base and cooperation.
+ * A good deal of the active engine code is outside the scope of the
+ * Proc-Layer, e.g. code located in backend services and plugins.
+ */
+namespace engine { }
+
+
+
+/**
+ * Media-Objects, edit operations and high-level session.
+ */
+namespace mobject {
+
+
+  /**
+   * Namespace of Session, EDL and user visible high-level objects.
+   */
+  namespace session { }
+
+
+  /**
+   * Namespace of the Builder, transforming high-level into low-level.
+   */
+  namespace builder { }
+
+}
+
 #endif /*LUMIERA_H*/
diff --git a/uml/lumiera/128261 b/uml/lumiera/128261
index f016cf9c4..c4b03ca90 100644
--- a/uml/lumiera/128261
+++ b/uml/lumiera/128261
@@ -1,6 +1,6 @@
 format 40
 "MObject" // ProcessingLayer::MObject
-  revision 31
+  revision 32
   modified_by 5 "hiv"
   // class settings
   //class diagram settings
@@ -1189,8 +1189,6 @@ ${inlines}
 
   package_ref 128901 // Builder
 
-  package_ref 129029 // Controller
-
   usecaseview 128261 "config examples"
     //use case diagram settings
     package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default
diff --git a/uml/lumiera/128517 b/uml/lumiera/128517
index 5eed4e170..6feb7ce56 100644
--- a/uml/lumiera/128517
+++ b/uml/lumiera/128517
@@ -1,6 +1,6 @@
 format 40
 "CommonLib" // CommonLib
-  revision 12
+  revision 13
   modified_by 5 "hiv"
   // class settings
   //class diagram settings
@@ -26,6 +26,132 @@ format 40
   package_name_in_tab default show_context default show_opaque_action_definition default auto_label_position default write_flow_label_horizontally default draw_all_relations default shadow default
   show_infonote default drawing_language default
   
+  classview 129285 "StreamType"
+    //class diagram settings
+    draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
+    //collaboration diagram settings
+    show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default draw_all_relations default shadow default
+    //object diagram settings
+     write_horizontally default package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default
+    //sequence diagram settings
+    show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default
+    //state diagram settings
+    package_name_in_tab default show_context default auto_label_position default write_trans_label_horizontally default show_trans_definition default draw_all_relations default shadow default
+    show_activities default region_horizontally default drawing_language default
+    //class settings
+    //activity diagram settings
+    package_name_in_tab default show_context default show_opaque_action_definition default auto_label_position default write_flow_label_horizontally default draw_all_relations default shadow default
+    show_infonote default drawing_language default
+    
+    classdiagram 132485 "Stream Type Framework"
+      draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
+      size A4
+    end
+
+    class 144773 "StreamType"
+      visibility package 
+      cpp_decl "${comment}${template}class ${name}${inherit}
+  {
+${members}  };
+${inlines}
+"
+      java_decl ""
+      idl_decl ""
+      explicit_switch_type ""
+      
+      classrelation 158469 // 
+	relation 154373 --->
+	  a role_name "" multiplicity "" protected
+	    cpp default "    ${comment}${static}${mutable}${volatile}${const}${type}* ${name}${value};
+"
+	    classrelation_ref 158469 // 
+	  b multiplicity "" parent class_ref 145285 // MediaKind
+      end
+
+      classrelation 158597 // 
+	relation 154501 --->
+	  a role_name "" multiplicity "" protected
+	    cpp default "    ${comment}${static}${mutable}${volatile}${const}${type}* ${name}${value};
+"
+	    classrelation_ref 158597 // 
+	  b multiplicity "" parent class_ref 144901 // Prototype
+      end
+
+      classrelation 158725 // 
+	relation 154629 --->
+	  a role_name "" multiplicity "" protected
+	    cpp default "    ${comment}${static}${mutable}${volatile}${const}${type}* ${name}${value};
+"
+	    classrelation_ref 158725 // 
+	  b multiplicity "" parent class_ref 145029 // ImplFacade
+      end
+    end
+
+    class 144901 "Prototype"
+      visibility package 
+      cpp_decl "${comment}${template}class ${name}${inherit}
+  {
+${members}  };
+${inlines}
+"
+      java_decl ""
+      idl_decl ""
+      explicit_switch_type ""
+      
+    end
+
+    class 145029 "ImplFacade"
+      visibility package 
+      cpp_decl "${comment}${template}class ${name}${inherit}
+  {
+${members}  };
+${inlines}
+"
+      java_decl ""
+      idl_decl ""
+      explicit_switch_type ""
+      
+    end
+
+    class 145157 "StreamTypeID"
+      visibility package 
+      cpp_decl "${comment}${template}class ${name}${inherit}
+  {
+${members}  };
+${inlines}
+"
+      java_decl ""
+      idl_decl ""
+      explicit_switch_type ""
+      
+      classrelation 158341 // 
+	relation 154245 -_->
+	  a default
+	    cpp default "Generated"
+	    classrelation_ref 158341 // 
+	  b multiplicity "" parent class_ref 144773 // StreamType
+      end
+    end
+
+    class 145285 "MediaKind"
+      visibility package stereotype "enum"
+      cpp_decl "${comment}enum ${name}
+  {
+${items}
+  };
+"
+      java_decl "${comment}${@}${visibility}${final}${abstract}enum ${name}${implements} {
+${items};
+${members}}
+"
+      idl_decl "${comment}enum ${name} {
+${items}};
+"
+      explicit_switch_type ""
+      
+    end
+  end
+
   package_ref 131077 // ConfigQuery
 
   classview 128773 "error"
diff --git a/uml/lumiera/129029 b/uml/lumiera/129029
index 259248b0a..5c7a2a6f4 100644
--- a/uml/lumiera/129029
+++ b/uml/lumiera/129029
@@ -1,6 +1,6 @@
-format 38
-"Controller" // ProcessingLayer::MObject::Controller
-  revision 5
+format 40
+"Control" // ProcessingLayer::Control
+  revision 6
   modified_by 5 "hiv"
   // class settings
   //class diagram settings
@@ -8,7 +8,7 @@ format 38
   //use case diagram settings
   package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default
   //sequence diagram settings
-  show_full_operations_definition default write_horizontally default drawing_language default draw_all_relations default shadow default
+  show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default
   //collaboration diagram settings
   show_full_operations_definition default show_hierarchical_rank default write_horizontally default drawing_language default package_name_in_tab default show_context default draw_all_relations default shadow default
   //object diagram settings
@@ -34,7 +34,7 @@ format 38
     //object diagram settings
      write_horizontally default package_name_in_tab default show_context default auto_label_position default draw_all_relations default shadow default
     //sequence diagram settings
-    show_full_operations_definition default write_horizontally default drawing_language default draw_all_relations default shadow default
+    show_full_operations_definition default write_horizontally default class_drawing_mode default drawing_language default draw_all_relations default shadow default
     //state diagram settings
     package_name_in_tab default show_context default auto_label_position default write_trans_label_horizontally default show_trans_definition default draw_all_relations default shadow default
     show_activities default region_horizontally default drawing_language default
@@ -172,7 +172,7 @@ ${inlines}
       
       comment "Encapsulates the logic used to get a \"current render process\" in accordance to the currentyl applicable controller settings. The provided StateProxy serves to hold any mutalbe state used in the render process, so the rest of the render engine can be stateless."
       operation 128389 "getStateProxy"
-	public return_type class_ref 132741 // StateProxy
+	public return_type class_ref 132741 // State
 	nparams 0
 	cpp_decl "    ${comment}${friend}${static}${inline}${virtual}${type} ${name} ${(}${)}${const}${volatile} ${throw}${abstract};"
 	cpp_def "${comment}${inline}${type}
@@ -186,5 +186,18 @@ ${class}::${name} ${(}${)}${const}${volatile} ${throw}${staticnl}
 	
       end
     end
+
+    class 145413 "STypeManager"
+      visibility package 
+      cpp_decl "${comment}${template}class ${name}${inherit}
+  {
+${members}  };
+${inlines}
+"
+      java_decl ""
+      idl_decl ""
+      explicit_switch_type ""
+      
+    end
   end
 end
diff --git a/uml/lumiera/129285 b/uml/lumiera/129285
index 1441c4bdf..4ff722e2d 100644
--- a/uml/lumiera/129285
+++ b/uml/lumiera/129285
@@ -1,6 +1,6 @@
 format 40
 "ProcessingLayer" // ProcessingLayer
-  revision 22
+  revision 23
   modified_by 5 "hiv"
   // class settings
   //class diagram settings
@@ -28,6 +28,8 @@ format 40
   
   package_ref 128133 // Asset
 
+  package_ref 129029 // Control
+
   package_ref 128261 // MObject
 
   package_ref 128389 // RenderEngine
diff --git a/uml/lumiera/129413 b/uml/lumiera/129413
index a4a3e7283..34ae1c0c2 100644
--- a/uml/lumiera/129413
+++ b/uml/lumiera/129413
@@ -1,6 +1,6 @@
 format 40
 "common" // design::codegen::common
-  revision 14
+  revision 15
   modified_by 5 "hiv"
   // class settings
   //class diagram settings
@@ -201,6 +201,46 @@ ${namespace_end}"
       end
       comment "unified representation of a time point, including conversion functions"
     end
+
+    artifact 139653 "streamtype"
+      stereotype "source"
+      cpp_h "/*
+  ${NAME}.hpp  -  ${description}
+@{CopyrightClaim}@{GPLHeader}
+*/
+
+
+#ifndef ${NAMESPACE}_${NAME}_H
+#define ${NAMESPACE}_${NAME}_H
+
+${includes}
+${declarations}
+
+
+${namespace_start}
+
+${definition}
+${namespace_end}
+#endif
+"
+      cpp_src "/*
+  ${Name}  -  ${description}
+@{CopyrightClaim}@{GPLHeader}
+* *****************************************************/
+
+
+${includes}
+${namespace_start}
+
+
+${members}
+${namespace_end}"
+      associated_classes
+	class_ref 144773 // StreamType
+	class_ref 144901 // Prototype
+	class_ref 145029 // ImplFacade
+      end
+    end
   end
 
   package_ref 130821 // error
diff --git a/uml/lumiera/129669 b/uml/lumiera/129669
index b2c2e0372..fb08fd56f 100644
--- a/uml/lumiera/129669
+++ b/uml/lumiera/129669
@@ -1,6 +1,6 @@
 format 40
 "proc" // design::codegen::proc
-  revision 7
+  revision 8
   modified_by 5 "hiv"
   // class settings
   //class diagram settings
@@ -150,7 +150,7 @@ ${namespace_start}
 ${members}
 ${namespace_end}"
       associated_classes
-	class_ref 132741 // StateProxy
+	class_ref 132741 // State
       end
       comment "Key Interface representing a render process and encapsulating state"
     end
@@ -236,6 +236,8 @@ ${namespace_end}"
 
   package_ref 130053 // asset
 
+  package_ref 130693 // control
+
   package_ref 130181 // mobject
 
   package_ref 130309 // engine
diff --git a/uml/lumiera/130181 b/uml/lumiera/130181
index 2204811cd..6d815be5e 100644
--- a/uml/lumiera/130181
+++ b/uml/lumiera/130181
@@ -1,6 +1,6 @@
 format 40
 "mobject" // design::codegen::proc::mobject
-  revision 8
+  revision 9
   modified_by 5 "hiv"
   // class settings
   //class diagram settings
@@ -394,6 +394,4 @@ ${namespace_end}"
   package_ref 130437 // session
 
   package_ref 130565 // builder
-
-  package_ref 130693 // controller
 end
diff --git a/uml/lumiera/130693 b/uml/lumiera/130693
index 71f67f571..c4b9c0979 100644
--- a/uml/lumiera/130693
+++ b/uml/lumiera/130693
@@ -1,6 +1,6 @@
 format 40
-"controller" // design::codegen::proc::mobject::controller
-  revision 6
+"control" // design::codegen::proc::control
+  revision 7
   modified_by 5 "hiv"
   // class settings
   //class diagram settings
@@ -27,13 +27,13 @@ format 40
   show_infonote default drawing_language default
   
   stereotype "src"
-  cpp_h_dir "proc/mobject/controller"
-  cpp_src_dir "proc/mobject/controller"
-  cpp_namespace "mobject::controller"
+  cpp_h_dir "proc/control"
+  cpp_src_dir "proc/control"
+  cpp_namespace "control"
   comment "sourcecode package
 
 The Processing and Render Controller,
-located within the MObject Subsystem"
+and the Proc-Layer dispatcher"
   deploymentview 129157 "gen"
     //deployment diagram settings
     package_name_in_tab default show_context default write_horizontally default auto_label_position default draw_all_relations default shadow default
@@ -116,5 +116,43 @@ ${namespace_end}"
       end
       comment "renderengine state manager"
     end
+
+    artifact 139781 "stypemanager"
+      stereotype "source"
+      cpp_h "/*
+  ${NAME}.hpp  -  ${description}
+@{CopyrightClaim}@{GPLHeader}
+*/
+
+
+#ifndef ${NAMESPACE}_${NAME}_H
+#define ${NAMESPACE}_${NAME}_H
+
+${includes}
+${declarations}
+
+
+${namespace_start}
+
+${definition}
+${namespace_end}
+#endif
+"
+      cpp_src "/*
+  ${Name}  -  ${description}
+@{CopyrightClaim}@{GPLHeader}
+* *****************************************************/
+
+
+${includes}
+${namespace_start}
+
+
+${members}
+${namespace_end}"
+      associated_classes
+	class_ref 145413 // STypeManager
+      end
+    end
   end
 end
diff --git a/uml/lumiera/131077 b/uml/lumiera/131077
index c996ebb90..480e8aad0 100644
--- a/uml/lumiera/131077
+++ b/uml/lumiera/131077
@@ -1,6 +1,6 @@
 format 40
 "ConfigQuery" // CommonLib::ConfigQuery
-  revision 1
+  revision 2
   modified_by 5 "hiv"
   // class settings
   //class diagram settings
@@ -239,7 +239,7 @@ ${inlines}
       classrelation 150405 // 
 	relation 147717 -_->
 	  a default
-	    cpp default "Generated"
+	    cpp default "#include in header"
 	    classrelation_ref 150405 // 
 	  b multiplicity "" parent class_ref 140805 // TypeHandler
       end
@@ -390,7 +390,7 @@ ${inlines}
       classrelation 150533 // 
 	relation 147845 -_->
 	  a default
-	    cpp default "Generated"
+	    cpp default "#include in header"
 	    classrelation_ref 150533 // 
 	  b multiplicity "" parent class_ref 140549 // ConfigRules
       end
diff --git a/uml/lumiera/132485.diagram b/uml/lumiera/132485.diagram
new file mode 100644
index 000000000..ac0affa9e
--- /dev/null
+++ b/uml/lumiera/132485.diagram
@@ -0,0 +1,49 @@
+format 40
+
+classcanvas 128005 class_ref 144773 // StreamType
+  draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
+  xyz 188 72 2000
+  end
+classcanvas 128133 class_ref 144901 // Prototype
+  draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
+  xyz 261 208 2000
+  end
+classcanvas 128261 class_ref 145029 // ImplFacade
+  draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
+  xyz 261 271 2000
+  end
+classcanvas 128389 class_ref 145157 // StreamTypeID
+  draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
+  xyz 38 72 2000
+  end
+classcanvas 128645 class_ref 145285 // MediaKind
+  draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
+  xyz 263 132 2000
+  end
+classcanvas 129541 class_ref 145413 // STypeManager
+  draw_all_relations default hide_attributes default hide_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_infonote default shadow default
+  xyz 40 256 2000
+  end
+relationcanvas 128517 relation_ref 154245 // 
+  from ref 128389 z 1999 to ref 128005
+  no_role_a no_role_b
+  no_multiplicity_a no_multiplicity_b
+relationcanvas 128773 relation_ref 154373 // 
+  geometry VH
+  from ref 128005 z 1999 to point 223 162
+  line 128901 z 1999 to ref 128645
+  no_role_a no_role_b
+  no_multiplicity_a no_multiplicity_b
+relationcanvas 129029 relation_ref 154501 // 
+  geometry VH
+  from ref 128005 z 1999 to point 223 227
+  line 129157 z 1999 to ref 128133
+  no_role_a no_role_b
+  no_multiplicity_a no_multiplicity_b
+relationcanvas 129285 relation_ref 154629 // 
+  geometry VH
+  from ref 128005 z 1999 to point 223 290
+  line 129413 z 1999 to ref 128261
+  no_role_a no_role_b
+  no_multiplicity_a no_multiplicity_b
+end
diff --git a/uml/lumiera/5.session b/uml/lumiera/5.session
index 3de151827..af68f0264 100644
--- a/uml/lumiera/5.session
+++ b/uml/lumiera/5.session
@@ -4,16 +4,21 @@ diagrams
     407 690 100 4 2 0
   collaborationdiagram_ref 132229 // Render Process
     825 684 100 4 0 0
-  active  classdiagram_ref 132357 // StateAdapter composition
+  classdiagram_ref 132357 // StateAdapter composition
     414 658 100 4 0 0
+  active  classdiagram_ref 132485 // Stream Type Framework
+    463 594 100 4 0 0
 end
 show_stereotypes
 selected 
-package_ref 129 // lumiera
+  package_ref 129 // lumiera
 open
-  class_ref 132741 // State
+  deploymentview_ref 128261 // gen
+  deploymentview_ref 129157 // gen
   
-package_ref 129029 // Controller
+  package_ref 130181 // mobject
+  classview_ref 128389 // Controller Workings
+  class_ref 132741 // State
   class_ref 131717 // ProcNode
   class_ref 142469 // StateProxy
   class_ref 142597 // StateAdapter
@@ -28,11 +33,7 @@ package_ref 129029 // Controller
   class_ref 144005 // BuffTable
   class_ref 144261 // Invocation
   usecaseview_ref 128005 // Renderengine Use
-  class_ref 140677 // QueryHandler
-  class_ref 140805 // TypeHandler
-  class_ref 140933 // ResolverBase
-  class_ref 141189 // QueryHandlerImpl
-  usecaseview_ref 128389 // query use
+  classview_ref 129285 // StreamType
   classview_ref 128773 // error
   class_ref 140165 // Visitable
 end

From 7ed7f05ffbc759702b766ff560daad22a49a947d Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sat, 13 Sep 2008 06:00:22 +0200
Subject: [PATCH 017/100] further analyzing the problem (stream type handling)

---
 src/common/streamtype.hpp      | 16 ++++++++++++++-
 src/proc/engine/buffhandle.hpp |  3 ++-
 wiki/renderengine.html         | 37 +++++++++++++++++++++++++++++-----
 3 files changed, 49 insertions(+), 7 deletions(-)

diff --git a/src/common/streamtype.hpp b/src/common/streamtype.hpp
index 86bf9a6bf..b4ec84b2a 100644
--- a/src/common/streamtype.hpp
+++ b/src/common/streamtype.hpp
@@ -73,7 +73,7 @@ namespace lumiera
       MediaKind kind;
       Prototype const& prototype;
       ImplFacade * implType;
-      Usage usageTag;
+      Usage intentionTag;
       
     };
   
@@ -91,6 +91,12 @@ namespace lumiera
     };
   
   
+
+  /** 
+   * placeholder definition for the contents of a data buffer
+   */
+  struct DataBuffer { };
+  
   
   /**
    * 
@@ -100,6 +106,14 @@ namespace lumiera
     public:
       Symbol libraryID;
       
+      bool operator== (ImplFacade const& other)  const;
+      bool operator== (StreamType const& other)  const;
+      
+      bool canConvert (ImplFacade const& other)  const;
+      bool canConvert (StreamType const& other)  const;
+      
+      DataBuffer* createFrame ()  const;
+      
     };
     
   
diff --git a/src/proc/engine/buffhandle.hpp b/src/proc/engine/buffhandle.hpp
index 51ce1c135..f55277e7a 100644
--- a/src/proc/engine/buffhandle.hpp
+++ b/src/proc/engine/buffhandle.hpp
@@ -40,6 +40,7 @@
 
 
 #include "common/error.hpp"
+#include "common/streamtype.hpp"
 
 
 namespace engine {
@@ -52,7 +53,7 @@ namespace engine {
    */
   struct BuffHandle
     {
-      typedef float Buff;
+      typedef lumiera::DataBuffer Buff;
       typedef Buff* PBuff;//////TODO define the Buffer type(s)
       
       PBuff 
diff --git a/wiki/renderengine.html b/wiki/renderengine.html
index d5d2bda01..905e69369 100644
--- a/wiki/renderengine.html
+++ b/wiki/renderengine.html
@@ -1365,7 +1365,7 @@ Besides routing to a global pipe, wiring plugs can also connect to the source po
 Finally, this example shows an ''automation'' data set controlling some parameter of an effect contained in one of the global pipes. From the effect's POV, the automation is simply a ParamProvider, i.e a function yielding a scalar value over time. The automation data set may be implemented as a bézier curve, or by a mathematical function (e.g. sine or fractal pseudo random) or by some captured and interpolated data values. Interestingly, in this example the automation data set has been placed relatively to the meta clip (albeit on another track), thus it will follow and adjust when the latter is moved.
 
-
+
This wiki page is the entry point to detail notes covering some technical decisions, details and problems encountered in the course of the implementation of the Lumiera Renderengine, the Builder and the related parts.
 
 * [[Packages, Interfaces and Namespaces|InterfaceNamespaces]]
@@ -1383,7 +1383,7 @@ Finally, this example shows an ''automation'' data set controlling some paramete
 * [[identifying the basic Builder operations|BasicBuildingOperations]] and [[planning the Implementation|PlanningNodeCreatorTool]]
 * [[how to handle »attached placement«|AttachedPlacementProblem]]
 * working out the [[basic building situations|BuilderPrimitives]] and [[mechanics of rendering|RenderMechanics]]
-* how to classify and [[describe media stream types|StreamType]]
+* how to classify and [[describe media stream types|StreamType]] and how to [[use them|StreamTypeUse]]
 
@@ -3326,7 +3326,7 @@ Consequently, as we can't get away with an fixed Enum of all stream prototypes, NTSC and PAL video, video versus digitized film, HD video versus SD video, 3D versus flat video, cinemascope versus 4:3, stereophonic versus monaural, periphonic versus panoramic sound, Ambisonics versus 5.1, dolby versus linear PCM...
-
+
//how to classify and describe media streams//
 Media data is understood to appear structured as stream(s) over time. While there may be an inherent internal structuring, at a given perspective ''any stream is a unit and homogeneous''. In the context of digital media data processing, streams are always ''quantized'', which means they appear as a temporal sequence of data chunks called ''frames''.
 
@@ -3357,15 +3357,16 @@ Within the Proc-Layer, media streams are treated largely in a similar manner. Bu
 * determine if a given media data source and sink can be connected, and how.
 * determine and enumerate the internal structure of a stream.
 * discover processing facilities
-
+&rarr; see StreamTypeUse
-
+
A description and classification record usable to find out about the properties of a media stream. The stream type descriptor can be accessed using an unique StreamTypeID. The information contained in this descriptor record can intentionally be //incomplete,// in which case the descriptor captures a class of matching media stream types. The following information is maintained:
 * fundamental ''kind'' of media: {{{VIDEO, IMAGE, AUDIO, MIDI,...}}}
 * stream ''prototype'': this is the abstract high level media type, like NTSC, PAL, Film, 3D, Ambisonics, 5.1, monaural,...
 * stream ''implementation type'' accessible by virtue of an StreamTypeImplFacade
 * the ''intended usage category'' of this stream: {{{SOURCE, RAW, INTERMEDIARY, TARGET}}}.
 &rarr; see &raquo;[[Stream Type|StreamType]]&laquo; detailed specification
+&rarr; notes about [[using stream types|StreamTypeUse]]
 &rarr; more [[about prototypes|StreamPrototype]]
@@ -3379,6 +3380,32 @@ Within the Proc-Layer, media streams are treated largely in a similar manner. Bu * ...? &rarr; see also &raquo;[[Stream Type|StreamType]]&laquo; + +
+
+
Questions regarding the use of StreamType within the Proc-Layer.
+
+* what is the relation between Buffer and Frame?
+* how to get the required size of a Buffer?
+* who does buffer allocations and how?
+
+!creating stream types
+seemingly stream types are created based on an already existing media stream (or a Frame of media data?). {{red{really?}}}
+The other use case seems to be that of an //incomplete// stream type based on a [[Prototype|StreamPrototype]]
+
+!Prototype
+According to my current understanding, a prototype is merely classification entity. But then &mdash; how to bootstrap a Prototype?
+And how to do the classification of an existing implementation type
+
+!the ID problem
+Basically I'd prefer the ~IDs to be real identifiers. So they can be used directly within rules. At least the Prototypes //can// have such a textual identifier. But the implementation type is problematic, and consequently the ID of the StreamType as well. Because the actual implementation should not be nailed down to a fixed set of possibilities. And, generally, we can't expect an implementation library to yield textual identifiers for each implementation type. //Is this really a problem? {{red{what are the use cases?}}}//
+
+--------------
+!use cases
+* pulling from a media file
+* connecting pipes and similar wiring problems
+* describing the properties of an processor plugin
+
 
From 8754555492dece52e329258375c9af4e1922f79b Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 15 Sep 2008 05:40:13 +0200 Subject: [PATCH 018/100] further mulling over the problems related to stream type handling --- src/common/streamtype.hpp | 43 +++++++++++++++++++++++++++++++++------ wiki/renderengine.html | 11 ++++++++-- 2 files changed, 46 insertions(+), 8 deletions(-) diff --git a/src/common/streamtype.hpp b/src/common/streamtype.hpp index b4ec84b2a..e419dbfc7 100644 --- a/src/common/streamtype.hpp +++ b/src/common/streamtype.hpp @@ -68,6 +68,7 @@ namespace lumiera struct Prototype; class ImplFacade; + class ImplConstraint; MediaKind kind; @@ -99,20 +100,50 @@ namespace lumiera /** - * + * A (more or less) concrete implementation type, wired up + * as a facade providing the basic set of operations. */ class StreamType::ImplFacade { public: Symbol libraryID; - bool operator== (ImplFacade const& other) const; - bool operator== (StreamType const& other) const; + virtual bool operator== (ImplFacade const& other) const; + virtual bool operator== (StreamType const& other) const; - bool canConvert (ImplFacade const& other) const; - bool canConvert (StreamType const& other) const; + virtual bool canConvert (ImplFacade const& other) const; + virtual bool canConvert (StreamType const& other) const; - DataBuffer* createFrame () const; + virtual DataBuffer* createFrame () const; + + }; + + + /** + * + */ + class StreamType::ImplConstraint + : public StreamType::ImplFacade + { + public: + Symbol libraryID; + + virtual bool canConvert (ImplFacade const& other) const; + virtual bool canConvert (StreamType const& other) const; + + virtual bool subsumes (ImplFacade const& other) const; + + /** modify the other impl type such as to comply with this constraint */ + virtual void makeCompliant (ImplFacade & other) const; + + /** create a default impl type in accordance to this constraint + * and use it to create a new framebuffer */ + virtual DataBuffer* createFrame () const; + + /** similarily create a impl type which complies to this constraint + * as well as to the additional constraints (e.g. frame size). + * Create a new framebuffer of the resutling type */ + virtual DataBuffer* createFrame (ImplConstraint const& furtherConstraints) const; }; diff --git a/wiki/renderengine.html b/wiki/renderengine.html index 905e69369..2e20400b1 100644 --- a/wiki/renderengine.html +++ b/wiki/renderengine.html @@ -3382,7 +3382,7 @@ Within the Proc-Layer, media streams are treated largely in a similar manner. Bu &rarr; see also &raquo;[[Stream Type|StreamType]]&laquo;
-
+
Questions regarding the use of StreamType within the Proc-Layer.
 
 * what is the relation between Buffer and Frame?
@@ -3394,11 +3394,18 @@ seemingly stream types are created based on an already existing media stream (or
 The other use case seems to be that of an //incomplete// stream type based on a [[Prototype|StreamPrototype]]
 
 !Prototype
-According to my current understanding, a prototype is merely classification entity. But then &mdash; how to bootstrap a Prototype?
+According to my current understanding, a prototype is merely a classification entity. But then &mdash; how to bootstrap a Prototype?
 And how to do the classification of an existing implementation type
 
+!Defaults and partial specification
+A StreamType need not be completely defined. It is sufficient to specify the media kind and the Prototype. The implementation type may be just given as a constraint, thus defining some properties and leaving out others. When creating a frame buffer based upon such an //incomplete type,// [[defaults|DefaultsManagement]] are queried to fill in the missing parts.
+Constraints are objects provided by the Lumiera core, but specialized to the internals of the actual implementation library.
+For example there might be a constraint implementation to force a specific {{{gavl_pixelformat_t}}}.
+
 !the ID problem
 Basically I'd prefer the ~IDs to be real identifiers. So they can be used directly within rules. At least the Prototypes //can// have such a textual identifier. But the implementation type is problematic, and consequently the ID of the StreamType as well. Because the actual implementation should not be nailed down to a fixed set of possibilities. And, generally, we can't expect an implementation library to yield textual identifiers for each implementation type. //Is this really a problem? {{red{what are the use cases?}}}//
+As far as I can see, in most cases this is no problem, as the type can be retrieved or derived from an existing media object. Thus, the only problematic case is when we need to persist the type information without being able to guarantee the persistence of the media object this type was derived from. For example this might be a problem when working with proxy media. But at least we should be able to create a constraint (partial type specification) to cover the important part of the type information, i.e. the part which is needed to re-create the model even when the original media isn't there any longer.
+Thus, //constraints may be viewed as type constructing functors.//
 
 --------------
 !use cases

From a6a19ef60929206fee06b8c7618d5b91ebb27140 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Wed, 17 Sep 2008 03:46:38 +0200
Subject: [PATCH 019/100] WIP start drafting how to bootstrap a stream type...

---
 src/common/streamtype.cpp             |  4 +-
 src/common/streamtype.hpp             |  4 +-
 tests/50components.tests              |  4 ++
 tests/common/streamtypebasicstest.cpp | 67 +++++++++++++++++++++++++++
 tests/common/teststreamtypes.hpp      | 52 +++++++++++++++++++++
 wiki/renderengine.html                | 16 ++++++-
 6 files changed, 142 insertions(+), 5 deletions(-)
 create mode 100644 tests/common/streamtypebasicstest.cpp
 create mode 100644 tests/common/teststreamtypes.hpp

diff --git a/src/common/streamtype.cpp b/src/common/streamtype.cpp
index a230ba7d4..e236148e9 100644
--- a/src/common/streamtype.cpp
+++ b/src/common/streamtype.cpp
@@ -28,7 +28,9 @@ namespace lumiera
   {
 
    /** */
-   int bla = 3;
+   StreamType::ImplFacade::~ImplFacade() 
+   { }
+
   
 
 } // namespace lumiera
diff --git a/src/common/streamtype.hpp b/src/common/streamtype.hpp
index e419dbfc7..40f8b1214 100644
--- a/src/common/streamtype.hpp
+++ b/src/common/streamtype.hpp
@@ -40,8 +40,7 @@
 #include 
 
 
-namespace lumiera
-  {
+namespace lumiera {
 
 
   /**
@@ -116,6 +115,7 @@ namespace lumiera
       
       virtual DataBuffer* createFrame ()  const;
       
+      virtual ~ImplFacade() ;
     };
   
   
diff --git a/tests/50components.tests b/tests/50components.tests
index 417b094ab..57534f06a 100644
--- a/tests/50components.tests
+++ b/tests/50components.tests
@@ -280,6 +280,10 @@ out: dtor ~TargetObj(24) successfull
 END
 
 
+PLANNED "StreamTypeBasics_test" StreamTypeBasics_test < Testgroup=ALL
diff --git a/tests/common/streamtypebasicstest.cpp b/tests/common/streamtypebasicstest.cpp
new file mode 100644
index 000000000..96989f2bc
--- /dev/null
+++ b/tests/common/streamtypebasicstest.cpp
@@ -0,0 +1,67 @@
+/*
+  StreamTypeBasics(Test)  -  check the fundamentals of stream type information
+ 
+  Copyright (C)         Lumiera.org
+    2008,               Hermann Vosseler 
+ 
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+ 
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+ 
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ 
+* *****************************************************/
+
+
+#include "common/test/run.hpp"
+#include "common/util.hpp"
+
+#include "teststreamtypes.hpp"
+
+#include 
+using std::cout;
+
+
+
+namespace lumiera {
+  namespace test {
+    
+
+    /*******************************************************************
+     * @test check the basic workings of the stream type handling.
+     *       create some stream implementation data, build a 
+     *       StreamType::ImplFacade from this, and derive a prototype
+     *       and a full StreamType based on this information.
+     */
+    class StreamTypeBasics_test : public Test
+      {
+        virtual void run (Arg arg)
+          {
+            buildImplType ();
+          }
+        
+        void buildImplType ()
+          {
+            StreamType::ImplFacade iType = createImplType ();
+            
+            UNIMPLEMENTED ("get a lib descriptor"); 
+            UNIMPLEMENTED ("check the lib of the type"); 
+            UNIMPLEMENTED ("compare two types"); 
+          }
+      };
+    
+      LAUNCHER (StreamTypeBasics_test, "unit common");
+
+      
+  } // namespace test
+    
+} // namespace lumiera
+
diff --git a/tests/common/teststreamtypes.hpp b/tests/common/teststreamtypes.hpp
new file mode 100644
index 000000000..e812b78b0
--- /dev/null
+++ b/tests/common/teststreamtypes.hpp
@@ -0,0 +1,52 @@
+/*
+  TESTSTREAMTYPES.hpp  -  create test (stub) stream type information
+ 
+  Copyright (C)         Lumiera.org
+    2008,               Hermann Vosseler 
+ 
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+ 
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+ 
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ 
+*/
+
+
+#ifndef LUMIERA_TEST_TESTSTREAMTYPES_H
+#define LUMIERA_TEST_TESTSTREAMTYPES_H
+
+
+//#include "common/util.hpp"
+
+#include "common/streamtype.hpp"
+#include "proc/control/stypemanager.hpp"
+
+
+
+namespace lumiera {
+  namespace test {
+    
+    /** Helper: create an implementation frame
+     *  and build the corresponding streamtype
+     */
+    inline StreamType::ImplFacade
+    createImplType ()
+    {
+      UNIMPLEMENTED ("create a test stream type from a given GAVL type tag");
+    }
+    
+    
+    
+  } // namespace test
+
+} // namespace lumiera
+#endif
diff --git a/wiki/renderengine.html b/wiki/renderengine.html
index 2e20400b1..851b8a8e2 100644
--- a/wiki/renderengine.html
+++ b/wiki/renderengine.html
@@ -3382,7 +3382,7 @@ Within the Proc-Layer, media streams are treated largely in a similar manner. Bu
 &rarr; see also &raquo;[[Stream Type|StreamType]]&laquo;
 
-
+
Questions regarding the use of StreamType within the Proc-Layer.
 
 * what is the relation between Buffer and Frame?
@@ -3409,10 +3409,22 @@ Thus, //constraints may be viewed as type constructing functors.//
 
 --------------
 !use cases
-* pulling from a media file
+* pulling data from a media file
 * connecting pipes and similar wiring problems
 * describing the properties of an processor plugin
 
+!! pulling data from a media file
+To open the file, we need //type discovery code,// resulting in a handle to some library module for accessing the contents, which is in compliance with the Lumiera application. Thus, we can determine the possible return values of this type discovery code and provide code which wires up a corresponding StreamTypeImpleFacade. Further, the {{{control::STypeManager}}} has the ability to build a complete or partial StreamType from
+* an ~ImplFacade
+* a Prototype
+* maybe even from some generic textual IDs?
+
+!! wiring problems
+When deciding if a connection can be made, we can build up the type information starting out from the source. (this requires some work, but it's //possible,// generally speaking.). Thus, we can allways get an ~ImplType for the "lower end" of the connection, and at least a Prototype for the "output side" &mdash; which should be enough to use the query functions provided by the stream type interfaces
+
+!! describing properties
+{{red{currently difficult to define}}} as of 9/2008, because the property description of plugins is not planned yet.
+My Idea was to use [[type implementation constraints|StreanTyoeImplConstraint]] for this, which are a special kind of ~ImplType
 
From 2885b41895737af755cf36c9a5e9fb18a3b43717 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 22 Sep 2008 04:03:37 +0200 Subject: [PATCH 020/100] fix a link problem --- src/common/streamtype.cpp | 7 ++++--- src/common/streamtype.hpp | 27 +++++++++++++++------------ tests/common/streamtypebasicstest.cpp | 2 +- tests/common/teststreamtypes.hpp | 2 +- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/common/streamtype.cpp b/src/common/streamtype.cpp index e236148e9..b6b1d3e0c 100644 --- a/src/common/streamtype.cpp +++ b/src/common/streamtype.cpp @@ -27,9 +27,10 @@ namespace lumiera { - /** */ - StreamType::ImplFacade::~ImplFacade() - { } + /** @internal defined here non-inline place the vtable in this object file.*/ + StreamType::ImplFacade::ImplFacade (Symbol libID) + : libraryID(libID) + { } diff --git a/src/common/streamtype.hpp b/src/common/streamtype.hpp index 40f8b1214..8fb50460b 100644 --- a/src/common/streamtype.hpp +++ b/src/common/streamtype.hpp @@ -107,15 +107,18 @@ namespace lumiera { public: Symbol libraryID; - virtual bool operator== (ImplFacade const& other) const; - virtual bool operator== (StreamType const& other) const; + virtual bool operator== (ImplFacade const& other) const =0; + virtual bool operator== (StreamType const& other) const =0; - virtual bool canConvert (ImplFacade const& other) const; - virtual bool canConvert (StreamType const& other) const; + virtual bool canConvert (ImplFacade const& other) const =0; + virtual bool canConvert (StreamType const& other) const =0; - virtual DataBuffer* createFrame () const; + virtual DataBuffer* createFrame () const =0; - virtual ~ImplFacade() ; + virtual ~ImplFacade() {}; + + protected: + ImplFacade (Symbol libID) ; }; @@ -128,22 +131,22 @@ namespace lumiera { public: Symbol libraryID; - virtual bool canConvert (ImplFacade const& other) const; - virtual bool canConvert (StreamType const& other) const; + virtual bool canConvert (ImplFacade const& other) const =0; + virtual bool canConvert (StreamType const& other) const =0; - virtual bool subsumes (ImplFacade const& other) const; + virtual bool subsumes (ImplFacade const& other) const =0; /** modify the other impl type such as to comply with this constraint */ - virtual void makeCompliant (ImplFacade & other) const; + virtual void makeCompliant (ImplFacade & other) const =0; /** create a default impl type in accordance to this constraint * and use it to create a new framebuffer */ - virtual DataBuffer* createFrame () const; + virtual DataBuffer* createFrame () const =0; /** similarily create a impl type which complies to this constraint * as well as to the additional constraints (e.g. frame size). * Create a new framebuffer of the resutling type */ - virtual DataBuffer* createFrame (ImplConstraint const& furtherConstraints) const; + virtual DataBuffer* createFrame (ImplConstraint const& furtherConstraints) const =0; }; diff --git a/tests/common/streamtypebasicstest.cpp b/tests/common/streamtypebasicstest.cpp index 96989f2bc..f8eacf15f 100644 --- a/tests/common/streamtypebasicstest.cpp +++ b/tests/common/streamtypebasicstest.cpp @@ -50,7 +50,7 @@ namespace lumiera { void buildImplType () { - StreamType::ImplFacade iType = createImplType (); + StreamType::ImplFacade& iType = createImplType (); UNIMPLEMENTED ("get a lib descriptor"); UNIMPLEMENTED ("check the lib of the type"); diff --git a/tests/common/teststreamtypes.hpp b/tests/common/teststreamtypes.hpp index e812b78b0..03409c7a9 100644 --- a/tests/common/teststreamtypes.hpp +++ b/tests/common/teststreamtypes.hpp @@ -38,7 +38,7 @@ namespace lumiera { /** Helper: create an implementation frame * and build the corresponding streamtype */ - inline StreamType::ImplFacade + inline StreamType::ImplFacade& createImplType () { UNIMPLEMENTED ("create a test stream type from a given GAVL type tag"); From 578178a937679e57cc88ab4dc7b2d93c69cebf90 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 22 Sep 2008 06:42:10 +0200 Subject: [PATCH 021/100] brainstorming (continued). MediaImplLib considering how to snap in the actual implementation --- src/common/streamtype.hpp | 14 +++-- src/lib/external/libgavl.cpp | 58 ++++++++++++++++++++ src/lib/external/libgavl.hpp | 89 +++++++++++++++++++++++++++++++ src/proc/control/mediaimpllib.hpp | 54 +++++++++++++++++++ src/proc/control/stypemanager.hpp | 3 ++ src/proc/engine/buffhandle.hpp | 2 +- wiki/renderengine.html | 37 +++++++++++-- 7 files changed, 247 insertions(+), 10 deletions(-) create mode 100644 src/lib/external/libgavl.cpp create mode 100644 src/lib/external/libgavl.hpp create mode 100644 src/proc/control/mediaimpllib.hpp diff --git a/src/common/streamtype.hpp b/src/common/streamtype.hpp index 8fb50460b..6319c40a5 100644 --- a/src/common/streamtype.hpp +++ b/src/common/streamtype.hpp @@ -92,11 +92,6 @@ namespace lumiera { - /** - * placeholder definition for the contents of a data buffer - */ - struct DataBuffer { }; - /** * A (more or less) concrete implementation type, wired up @@ -107,6 +102,13 @@ namespace lumiera { public: Symbol libraryID; + /** placeholder definition for implementation specific type information */ + struct TypeTag { }; + + /** placeholder definition for the contents of a data buffer */ + struct DataBuffer { }; + + virtual bool operator== (ImplFacade const& other) const =0; virtual bool operator== (StreamType const& other) const =0; @@ -148,6 +150,8 @@ namespace lumiera { * Create a new framebuffer of the resutling type */ virtual DataBuffer* createFrame (ImplConstraint const& furtherConstraints) const =0; + //TODO: do we need functions to represent and describe this constraint? + }; diff --git a/src/lib/external/libgavl.cpp b/src/lib/external/libgavl.cpp new file mode 100644 index 000000000..7b477c871 --- /dev/null +++ b/src/lib/external/libgavl.cpp @@ -0,0 +1,58 @@ +/* + STypeManager - entry point for dealing with media stream types + + Copyright (C) Lumiera.org + 2008, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "proc/lumiera.hpp" +#include "lib/external/libgavl.hpp" + +extern "C" { +#include +} + + +namespace lib { + namespace external { + + namespace { // implementation internals + + } + + /** + * Use an type information struct, which actually has to be + * a GAVL frametype (TODO), to wire up an ImplFacade such + * as to deal with GAVL data frames of this type. + * @todo fill in the acutal GAVL frame type + * @todo how to distinguish the audio and the video case? + */ + ImplFacadeGAVL const& + LibGavl::getImplFacade (TypeTag*) + { + TODO ("any chance to verify that the TypeTag actually points to a GAVL frame type descriptor?"); + UNIMPLEMENTED ("wire up an impl facade with the correct GAVL lib functions for the data type in question"); + } + + + + + } // namespace external + +} // namespace lib diff --git a/src/lib/external/libgavl.hpp b/src/lib/external/libgavl.hpp new file mode 100644 index 000000000..26f6b6237 --- /dev/null +++ b/src/lib/external/libgavl.hpp @@ -0,0 +1,89 @@ +/* + LILBGAVL.hpp - facade for integrating the GAVL media handling library + + Copyright (C) Lumiera.org + 2008, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +#ifndef LIB_EXTERN_LIBGAVL_H +#define LIB_EXTERN_LIBGAVL_H + + +#include "proc/control/mediaimpllib.hpp" + + + +namespace lib { + namespace external { + + + using lumiera::Symbol; + + using lumiera::StreamType; + typedef StreamType::ImplFacade ImplFacade; + typedef StreamType::ImplFacade::TypeTag TypeTag; + + + class LibGavl; + + /** + * Concrete media lib implementation facade + * allowing to work with GAVL data frames and types + * in an implementation agnostic way + */ + class ImplFacadeGAVL + : public ImplFacade + { + protected: + ImplFacadeGAVL() + : ImplFacade("GAVL") + { } + + friend class LibGavl; + + public: + virtual bool operator== (ImplFacade const& other) const; + virtual bool operator== (StreamType const& other) const; + + virtual bool canConvert (ImplFacade const& other) const; + virtual bool canConvert (StreamType const& other) const; + + virtual DataBuffer* createFrame () const; + }; + + + class LibGavl + : public control::MediaImplLib + { + protected: + + public: + virtual Symbol getLibID() const { return "GAVL"; } + + virtual ImplFacadeGAVL const& getImplFacade (TypeTag*); + }; + + + ////////////////////////////////////TODO: dafür sorgen, daß sich das beim Systemstart in den control::STypeManger einklinkt!!!!!!!! + + + } // namespace external + +} // namespace lib +#endif diff --git a/src/proc/control/mediaimpllib.hpp b/src/proc/control/mediaimpllib.hpp new file mode 100644 index 000000000..c150ad913 --- /dev/null +++ b/src/proc/control/mediaimpllib.hpp @@ -0,0 +1,54 @@ +/* + MEDIAIMPLLIB.hpp - interface providing a facade to an media handling library + + Copyright (C) Lumiera.org + 2008, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +#ifndef CONTROL_MEDIAIMPLLIB_H +#define CONTROL_MEDIAIMPLLIB_H + + +#include "common/streamtype.hpp" + + + +namespace control { + + using lumiera::Symbol; + + + class MediaImplLib + { + protected: + virtual ~MediaImplLib() {}; + + typedef lumiera::StreamType::ImplFacade ImplFacade; + typedef lumiera::StreamType::ImplFacade::TypeTag TypeTag; + typedef lumiera::StreamType::ImplFacade::DataBuffer DataBuffer; + + public: + virtual Symbol getLibID() const =0; + + virtual ImplFacade const& getImplFacade (TypeTag*) =0; + }; + + +} // namespace control +#endif diff --git a/src/proc/control/stypemanager.hpp b/src/proc/control/stypemanager.hpp index ef99689d5..1a5a7ec96 100644 --- a/src/proc/control/stypemanager.hpp +++ b/src/proc/control/stypemanager.hpp @@ -42,6 +42,9 @@ namespace control { public: lumiera::StreamType const& getType (Symbol sTypeID) ; + + + ////////////////TODO: Mechanismus erfinden, mit dem sich MediaImplLib-Instanzen einklinken können.... }; diff --git a/src/proc/engine/buffhandle.hpp b/src/proc/engine/buffhandle.hpp index f55277e7a..069b9f83e 100644 --- a/src/proc/engine/buffhandle.hpp +++ b/src/proc/engine/buffhandle.hpp @@ -53,7 +53,7 @@ namespace engine { */ struct BuffHandle { - typedef lumiera::DataBuffer Buff; + typedef lumiera::StreamType::ImplFacade::DataBuffer Buff; typedef Buff* PBuff;//////TODO define the Buffer type(s) PBuff diff --git a/wiki/renderengine.html b/wiki/renderengine.html index 851b8a8e2..893bf34ea 100644 --- a/wiki/renderengine.html +++ b/wiki/renderengine.html @@ -1320,6 +1320,11 @@ Slider.prototype.stop = function() } //}}}
+
+
The ''Gmerlin Audio Video Library''. &rarr; see [[homepage|http://gmerlin.sourceforge.net/gavl.html]]
+Used within Lumiera as a foundation for working with raw video and audio media data
+
+
__G__roup __of__ __P__ictures: several compressed video formats don't encode single frames. Normally, such formats are considered mere //delivery formates// but it was one of the key strenghts of Cinelrra from start to be able to do real non linear editing on such formats (like the ~MPEG2-ts unsed in HDV video). The problem of course is that the data backend needs to decode the whole GOP to be serve  single raw video frames.
 
@@ -1832,6 +1837,21 @@ __5/2008__: the allocation mechanism can surely be improved later, but for now I
 &rarr; see also LoadingMedia
 
+
+
The Proc-Layer is designed such as to avoid unnecessary assumptions regarding the properties of the media data and streams. Thus, for anything which is not completely generic, we rely on an abstract [[type description|StreamTypeDescriptor]], which provides a ''Facade'' to an actual library implementation. This way, the fundamental operations can be invoked, like allocating a buffer to hold media data.
+
+In the context of Lumiera and especially in the Proc-Layer, __media implementation library__ means
+* a subsystem which allows to work with media data of a specific kind
+* such as to provide the minimal set of operations
+** allocating a frame buffer
+** describing the type of the data within such a buffer
+* and this subsystem or external library has been integrated to be used by Lumiera by writing adaptation code for accessing these basic operations through the [[implementation facade interface|StreamTypeImplFacade]]
+* such a link to an type implementation is registered and maintained by the [[stream type manager|STypeManager]]
+
+!Problem of the implementation data types
+Because we deliberately won't make any asumptions about the implementation library (besides the ones imposed indirectly by the facade interface), we can't integrate the data types of the library first class into the type system. All we can do is to use marker types and rely on the builder to have checked the compatibility of the actual data beforehand.
+
+
Of course: Cinelerra currently leaks memory and crashes regularilly. For the newly written code, besides retaining the same level of performance, a main goal is to use methods and techniques known to support the writing of quality code. So, besides the MultithreadConsiderations, a solid strategy for managing the ownership of allocated memory blocks is necessary right from start.
 
@@ -3196,6 +3216,9 @@ __see also__
 
 Rendering can be seen as a passive service available to the Backend, which remains in charge what to render and when. Render processes may be running in parallel without any limitations. All of the storage and data management falls into the realm of the Backend. The render nodes themselves are ''completely stateless'' &mdash; if some state is necessary for carrying out the calculations, the backend will provide a //state frame// in addition to the data frames.
+
+
A facility allowing the Proc-Layer to work with abstracted [[media stream types|StreamType]], linking (abstract or opaque) [[type tags|StreamTypeDescriptor]] to an [[library|MediaImplLib]], which provides functionality for acutally dealing with data of this media stream type. Thus, the stream type manager is a kind of registry of all the external libraries which can be bridged and accessed by Lumiera (for working with media data, that is). The most basic set of libraries is instelled here automatically at application start, most notably the [[GAVL]] library for working with uncompressed video and audio data. //Later on, when plugins will introduce further external libraries, these need to be registered here too.//
+
The Session contains all informations, state and objects to be edited by the User. From a users view, the Session is synonymous to the //current Project//. It can be saved and loaded. The individual Objects within the Session, i.e. Clips, Media, Effects, are contained in one (or several) collections within the Session, which we call [[EDL (Edit Decision List)|EDL]]. &rarr; [[Session design overview|SessionOverview]]
 
@@ -3372,6 +3395,12 @@ Within the Proc-Layer, media streams are treated largely in a similar manner. Bu
 
This ID is an symbolic key linked to a StreamTypeDescriptor. The predicate {{{stream(ID)}}} specifies a media stream with the StreamType as detailed by the corresponding descriptor (which may contain complete or partial data defining the type).
+
+
A special kind of media stream [[implementation type|StreamTypeImplFacade]], which is not fully specified. As such, it is supposed there //actually is// an concrete implementation type, while only caring for some part or detail of this implementation to exhibit a specific property. For example, using an type constraint we can express the requirement of the actual implementation of a video stream to be based on RGB-float, or to enforce a fixed frame size in pixels.
+
+An implementation constraint can //stand-in// for a completely specified implementation type (meaning it's a sub interface of the latter). But actually using it in this way may cause a call to the [[defaults manager|DefaultsImplementation]] to fill in any missing information. An example would be to call {{{createFrame()}}} on the type constraint object, which means being able to allocate memory to hold a data frame, with properties in compliance with the given type constraint. Of cousre, then we need to know all the properties of this stream type, which is where the defaults manager is queried. This allows session customisation to kick in, but may fail under certain cicumstances.
+
+
Common interface for dealing with the implementation of media stream data. From a high level perspective, the various kinds of media ({{{VIDEO, IMAGE, AUDIO, MIDI,...}}}) exhibit similar behaviour, while on the implementation level not even the common classification can be settled down to a complete general and useful scheme. Thus, we need separate library implementations for deailing with the various sorts of media data, all providing at least a set of basic operations:
 * set up a buffer
@@ -3382,7 +3411,7 @@ Within the Proc-Layer, media streams are treated largely in a similar manner. Bu
 &rarr; see also &raquo;[[Stream Type|StreamType]]&laquo;
 
-
+
Questions regarding the use of StreamType within the Proc-Layer.
 
 * what is the relation between Buffer and Frame?
@@ -3414,17 +3443,17 @@ Thus, //constraints may be viewed as type constructing functors.//
 * describing the properties of an processor plugin
 
 !! pulling data from a media file
-To open the file, we need //type discovery code,// resulting in a handle to some library module for accessing the contents, which is in compliance with the Lumiera application. Thus, we can determine the possible return values of this type discovery code and provide code which wires up a corresponding StreamTypeImpleFacade. Further, the {{{control::STypeManager}}} has the ability to build a complete or partial StreamType from
+To open the file, we need //type discovery code,// resulting in a handle to some library module for accessing the contents, which is in compliance with the Lumiera application. Thus, we can determine the possible return values of this type discovery code and provide code which wires up a corresponding StreamTypeImplFacade. Further, the {{{control::STypeManager}}} has the ability to build a complete or partial StreamType from
 * an ~ImplFacade
 * a Prototype
-* maybe even from some generic textual IDs?
+* maybe even from some generic textual ~IDs?
 
 !! wiring problems
 When deciding if a connection can be made, we can build up the type information starting out from the source. (this requires some work, but it's //possible,// generally speaking.). Thus, we can allways get an ~ImplType for the "lower end" of the connection, and at least a Prototype for the "output side" &mdash; which should be enough to use the query functions provided by the stream type interfaces
 
 !! describing properties
 {{red{currently difficult to define}}} as of 9/2008, because the property description of plugins is not planned yet.
-My Idea was to use [[type implementation constraints|StreanTyoeImplConstraint]] for this, which are a special kind of ~ImplType
+My Idea was to use [[type implementation constraints|StreamTypeImplConstraint]] for this, which are a special kind of ~ImplType
 
From 14023d30249e2bf2ec9429eacbb4972a5f9c3284 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Tue, 23 Sep 2008 05:09:56 +0200 Subject: [PATCH 022/100] interface brainstorming --- src/proc/control/stypemanager.cpp | 36 +++++++++++++++++++++++++++ src/proc/control/stypemanager.hpp | 27 ++++++++++++++++---- tests/common/streamtypebasicstest.cpp | 10 ++++++++ wiki/renderengine.html | 15 ++++++++--- 4 files changed, 79 insertions(+), 9 deletions(-) diff --git a/src/proc/control/stypemanager.cpp b/src/proc/control/stypemanager.cpp index 9c1e60d08..4f67ac063 100644 --- a/src/proc/control/stypemanager.cpp +++ b/src/proc/control/stypemanager.cpp @@ -21,12 +21,48 @@ * *****************************************************/ +#include "proc/lumiera.hpp" #include "proc/control/stypemanager.hpp" namespace control { + using lumiera::StreamType; + /** */ + StreamType const& + STypeManager::getType (Symbol sTypeID) + { + UNIMPLEMENTED ("get type just by symbolic ID (query defaults manager)"); + } + + + StreamType const& + STypeManager::getType (StreamType::Prototype const& protoType) + { + UNIMPLEMENTED ("build complete StreamType based on prototype; may include querying defaults manager"); + } + + + StreamType const& + STypeManager::getType (StreamType::ImplFacade const& implType) + { + UNIMPLEMENTED ("build complete StreamType round the given implementation type"); + } + + + StreamType::ImplFacade const& + STypeManager::getImpl (Symbol libID, StreamType::Prototype const& protoType) + { + UNIMPLEMENTED ("wire up implementation in compliance to a prototype and using a specific MediaImplLib. really tricky.... "); + } + + + StreamType::ImplFacade const& + STypeManager::getImpl (Symbol libID, StreamType::ImplFacade::TypeTag rawType) + { + UNIMPLEMENTED ("STypeManager basic functionality: wire up implementation facade (impl type) from given raw type of the library"); + } diff --git a/src/proc/control/stypemanager.hpp b/src/proc/control/stypemanager.hpp index 1a5a7ec96..77778a4ef 100644 --- a/src/proc/control/stypemanager.hpp +++ b/src/proc/control/stypemanager.hpp @@ -32,19 +32,36 @@ namespace control { using lumiera::Symbol; + using lumiera::StreamType; class STypeManager { - protected: - virtual ~STypeManager() {}; - public: - lumiera::StreamType const& getType (Symbol sTypeID) ; + /** (re)-access a media stream type using + * just a symbolic ID. Effectively this queries a default */ + StreamType const& getType (Symbol sTypeID) ; + + /** build or retrieve a complete StreamType implementing the given Prototype */ + StreamType const& getType (StreamType::Prototype const& protoType) ; + + /** build or retrieve a complete StreamType incorporating the given implementation type */ + StreamType const& getType (StreamType::ImplFacade const& implType) ; + + /** build or retrieve an implementation (facade) + * utilizing a specific MediaImplLib and implementing the given Prototype. + * @todo find out if this one is really necessary, because it is especially tricky */ + StreamType::ImplFacade const& getImpl (Symbol libID, StreamType::Prototype const& protoType) ; + + /** build or retrieve an implementation (facade) + * wrapping up the actual implementation as designated by the rawType tag, + * which needs to be an implementation type of the mentioned MediaImplLib */ + StreamType::ImplFacade const& getImpl (Symbol libID, StreamType::ImplFacade::TypeTag rawType) ; - ////////////////TODO: Mechanismus erfinden, mit dem sich MediaImplLib-Instanzen einklinken können.... + + ////////////////TODO: design a mechanism allowing to add MediaImplLib implementations by plugin...... }; diff --git a/tests/common/streamtypebasicstest.cpp b/tests/common/streamtypebasicstest.cpp index f8eacf15f..af6d3f764 100644 --- a/tests/common/streamtypebasicstest.cpp +++ b/tests/common/streamtypebasicstest.cpp @@ -46,9 +46,19 @@ namespace lumiera { virtual void run (Arg arg) { buildImplType (); + basicImplTypeProperties (); } void buildImplType () + { + UNIMPLEMENTED ("Access/Factory for the STypeManager??"); + TODO ("set up a GAVL frame type"); + TODO ("use this to retrieve an ImplFacade from the STypeManager"); + UNIMPLEMENTED ("at least preliminary implementation of the MediaImplLib interface for lib GAVL"); + TODO ("how to do a simple consistency check on the returned ImplFacade? can we re-create the GAVL frame type?"); + } + + void basicImplTypeProperties () { StreamType::ImplFacade& iType = createImplType (); diff --git a/wiki/renderengine.html b/wiki/renderengine.html index 893bf34ea..ae0094e00 100644 --- a/wiki/renderengine.html +++ b/wiki/renderengine.html @@ -1058,7 +1058,7 @@ As we don't have a Prolog interpreter on board yet, we utilize a mock store with {{{default(Obj)}}} is a predicate expressing that the object {{{Obj}}} can be considered the default setup under the given conditions. Using the //default// can be considered as a shortcut for actually finding a exact and unique solution. The latter would require to specify all sorts of detailed properties up to the point where only one single object can satisfy all conditions. On the other hand, leaving some properties unspecified would yield a set of solutions (and the user code issuing the query had to provide means for selecting one soltution from this set). Just falling back on the //default// means that the user code actually doesn't care for any additional properties (as long as the properties he //does// care for are satisfied). Nothing is said specifically on //how//&nbsp; this default gets configured; actually there can be rules //somewhere,// and, additionally, anything encountered once while asking for a default can be re-used as default under similar circumstances. &rarr; [[implementing defaults|DefaultsImplementation]]
-
+
Along the way of working out various [[implementation details|ImplementationDetails]], decisions need to be made on how to understand the different facilities and entities and how to tackle some of the problems. This page is mainly a collection of keywords, summaries and links to further the discussion. And the various decisions should allways be read as proposals to solve some problem at hand...
 
 ''Everything is an object'' &mdash; of course, that's a //no-brainer // todays. Rather, important is what is not "an object", meaning it can't be arranged arbitrarily
@@ -1072,6 +1072,10 @@ We ''separate'' processing (rendering) and configuration (building). We have a [
 An [[EDL]] is just a collection of configured and placed objects (and has no additional, fixed structure). [[Tracks|Track]] form a mere organisational grid, they are grouping devices not first-class entities (a track doesn't "have" a pipe or "is" a video track and the like; it can be configured to behave in such manner by using placements though). [[Pipes|Pipe]] are hooks for making connections and are the only facility to build processing chains. We have global pipes, and each clip is built around a lokal [[source port|ClipSourcePort]] &mdash; and that's all. No special "media viewer" and "arranger", no special role for media sources, no commitment to some fixed media stream types (video and audio). All of this is sort of pushed down to be configuration, represented as asset of some kind. For example, we have [[processing pattern|ProcPatt]] assets to represent the way of building the source network for reading from some media file (including codecs treated like effect plugin nodes)
 
 ''State'' is rigorously ''externalized'' and operations are to be ''scheduled'', to simplify locking and error handling. State is either treated similar to media stream data (as addressable and cacheable data frame), or is represented as "parameter" to be served by some [[parameter provider|ParamProvider]]. Consequently, [[Automation]] is just another kind of parameter, i.e. a function &mdash; how this function is calculated is an encapsulated implementation detail (we don't have "bezier automation", and then maybe a "linear automation", a "mask automation" and yet another way to handle transitions)
+
+Deliberately there is an limitaion on the flexibility of what can be added to the system via Plugins. We allow configuration and parametrisation to be extended and we allow processing and data handling to be extended, but we disallow extensions to the fundamental structure of the system by plugins. They may provide new implementations for already known subsystems, but they can't introduce new subsystems not envisioned in the general design of the application.
+* thus fixed assortments include: the possbile kinds of MObject and [[Asset]], the possible automation parameter data types, the supported kinds of plugin systems
+* while plugins may extend: the supported kinds of media, the [[media handling libraries|MediaImplLib]] used to deal with those media, the session storage backends, the behaviour of placments
 
@@ -1837,7 +1841,7 @@ __5/2008__: the allocation mechanism can surely be improved later, but for now I &rarr; see also LoadingMedia
-
+
The Proc-Layer is designed such as to avoid unnecessary assumptions regarding the properties of the media data and streams. Thus, for anything which is not completely generic, we rely on an abstract [[type description|StreamTypeDescriptor]], which provides a ''Facade'' to an actual library implementation. This way, the fundamental operations can be invoked, like allocating a buffer to hold media data.
 
 In the context of Lumiera and especially in the Proc-Layer, __media implementation library__ means
@@ -1849,7 +1853,8 @@ In the context of Lumiera and especially in the Proc-Layer, __media implementati
 * such a link to an type implementation is registered and maintained by the [[stream type manager|STypeManager]]
 
 !Problem of the implementation data types
-Because we deliberately won't make any asumptions about the implementation library (besides the ones imposed indirectly by the facade interface), we can't integrate the data types of the library first class into the type system. All we can do is to use marker types and rely on the builder to have checked the compatibility of the actual data beforehand.
+Because we deliberately won't make any asumptions about the implementation library (besides the ones imposed indirectly by the facade interface), we can't integrate the data types of the library first class into the type system. All we can do is to use marker types and rely on the builder to have checked the compatibility of the actual data beforehand. 
+It would be possible to circumvent this problem by requiring all supported implementation libraries to be known at compile time, because then the actual media implementation type could be linked to a facade type by generic programming. Indeed, Lumiera follows this route with regards to the possible kinds of MObject or [[Asset]] &mdash; but here to the contraty, being able to include support for a new media data type just by adding a plugin by far outweights the benefits of compile-time checked implementation type selection. So, as a consequence of this design decision we //note the possibility of the media file type discovery code to be misconfigured// and select the //wrong implementation library at runtime.// And thus the render engine needs to be prepared for the source reading node of any pipe to flounder completely, and protect the rest of the system accordingly
 
@@ -3411,7 +3416,7 @@ An implementation constraint can //stand-in// for a completely specified impleme &rarr; see also &raquo;[[Stream Type|StreamType]]&laquo;
-
+
Questions regarding the use of StreamType within the Proc-Layer.
 
 * what is the relation between Buffer and Frame?
@@ -3447,6 +3452,8 @@ To open the file, we need //type discovery code,// resulting in a handle to some
 * an ~ImplFacade
 * a Prototype
 * maybe even from some generic textual ~IDs?
+Together this allows to associate a StreamType to each media source, and thus to derive the Prototype governing the immediately connected [[Pipe]]
+A pipe can by design handle data of one Prototype solely.
 
 !! wiring problems
 When deciding if a connection can be made, we can build up the type information starting out from the source. (this requires some work, but it's //possible,// generally speaking.). Thus, we can allways get an ~ImplType for the "lower end" of the connection, and at least a Prototype for the "output side" &mdash; which should be enough to use the query functions provided by the stream type interfaces

From 83b574bdead734bb5c24bf8b67e7921dc71adf40 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Wed, 24 Sep 2008 05:46:26 +0200
Subject: [PATCH 023/100] stream type registry lifecycle

---
 src/proc/control/stypemanager.cpp     | 50 ++++++++++++++++
 src/proc/control/stypemanager.hpp     | 37 ++++++++++++
 src/proc/control/styperegistry.hpp    | 86 +++++++++++++++++++++++++++
 tests/common/streamtypebasicstest.cpp |  8 ++-
 4 files changed, 179 insertions(+), 2 deletions(-)
 create mode 100644 src/proc/control/styperegistry.hpp

diff --git a/src/proc/control/stypemanager.cpp b/src/proc/control/stypemanager.cpp
index 4f67ac063..330d9581e 100644
--- a/src/proc/control/stypemanager.cpp
+++ b/src/proc/control/stypemanager.cpp
@@ -23,11 +23,52 @@
 
 #include "proc/lumiera.hpp"
 #include "proc/control/stypemanager.hpp"
+#include "proc/control/styperegistry.hpp"
+
 
 namespace control {
   
   using lumiera::StreamType;
+  using lumiera::Symbol;
   
+  /* ======= stream type manager lifecycle ==========*/
+  
+  
+  STypeManager::STypeManager()
+    : reg_(0)
+  { 
+    reset();
+  }
+  
+  STypeManager::~STypeManager()
+  { }
+  
+  /** access the system-wide stream type manager instance.
+   *  Implemented as singleton. */
+  lumiera::Singleton STypeManager::instance;
+  
+  
+  void 
+  STypeManager::reset() 
+  {
+    reg_.reset(new Registry);
+    lumiera::Appconfig::lifecycle(ON_STREAMTYPES_RESET);
+  }
+  
+  /** \par 
+   *  LifecycleHook, on which all the basic setup and configuration
+   *  providing the pristine state of the stream type system has to be registered.
+   *  @note plugins providing additional streamtype configuration should register
+   *        their basic setup functions using this hook, which can be done via
+   *        the C interface functions 
+   */
+  Symbol ON_STREAMTYPES_RESET ("ON_STREAMTYPES_RESET");
+
+
+  
+  
+  
+  /* ======= implementation of the public interface ========= */
   
   /** */
   StreamType const&
@@ -67,3 +108,12 @@ namespace control {
   
   
 } // namespace control
+
+
+// ==== C interface for registering setup of basic stream type configuration =======
+
+void 
+lumiera_StreamType_registerInitFunction (void setupFun(void))
+{
+  lumiera::LifecycleHook (control::ON_STREAMTYPES_RESET, setupFun);
+}
diff --git a/src/proc/control/stypemanager.hpp b/src/proc/control/stypemanager.hpp
index 77778a4ef..02edaeb2d 100644
--- a/src/proc/control/stypemanager.hpp
+++ b/src/proc/control/stypemanager.hpp
@@ -26,7 +26,9 @@
 
 
 #include "common/streamtype.hpp"
+#include "common/singleton.hpp"
 
+#include 
 
 
 namespace control {
@@ -38,7 +40,12 @@ namespace control {
   class STypeManager
     {
       
+      class Registry;
+      boost::scoped_ptr reg_;
+      
     public:
+      static lumiera::Singleton instance;
+      
       /** (re)-access a media stream type using
        *  just a symbolic ID. Effectively this queries a default */
       StreamType const& getType (Symbol sTypeID) ;
@@ -62,8 +69,22 @@ namespace control {
       
       
       ////////////////TODO: design a mechanism allowing to add MediaImplLib implementations by plugin......
+    protected:
+      STypeManager();
+      ~STypeManager();
+      
+      friend class lumiera::singleton::StaticCreate;
+      
+      /** Lifecycle: reset all type registration information
+       *  to the generic pristine default state. This includes
+       *  hard wired defaults and defauls provided by type plugins, but
+       *  excludes everything added by the session
+       */
+      void reset() ;
+
     };
   
+  extern Symbol ON_STREAMTYPES_RESET;  ///< triggered to load the generic pristine default  
   
 } // namespace control
 
@@ -74,4 +95,20 @@ namespace proc_interface {
 
 
 } // namespace proc_interface
+
+
+extern "C" { //TODO provide a separate header if some C code or plugin happens to need this...
+  
+  /** any stream type implementation, which needs to be present on the
+   *  pristine default level (without any session specific configuration),
+   *  should register a setup function, which will be called on each
+   *  STypemanager::reset()
+   */
+  void
+  lumiera_StreamType_registerInitFunction (void setupFun(void));
+  
+  // TODO provide a C interface usable from such a setupFun to access the STypeManager registration functions.
+}
+
+
 #endif
diff --git a/src/proc/control/styperegistry.hpp b/src/proc/control/styperegistry.hpp
new file mode 100644
index 000000000..5104a6df8
--- /dev/null
+++ b/src/proc/control/styperegistry.hpp
@@ -0,0 +1,86 @@
+/*
+  STYPEREGISTRY.hpp  -  implementation of the registry for stream type descriptors
+ 
+  Copyright (C)         Lumiera.org
+    2008,               Hermann Vosseler 
+ 
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+ 
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+ 
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ 
+*/
+
+
+/** @file styperegistry.hpp
+ ** This is part of the \i implementation of the stream type manager (include).
+ ** Only used in stypemanager.cpp and accompaning unit tests.
+ ** 
+ ** @see control::STypeManager
+ ** @see lumiera::StreamType
+ **
+ */
+
+
+
+
+#ifndef CONTROL_STYPEREGISTRY_H
+#define CONTROL_STYPEREGISTRY_H
+
+
+//#include "common/query.hpp"
+//#include "common/util.hpp"
+//#include "common/p.hpp"
+
+//#include 
+//#include 
+//#include 
+//#include 
+#include 
+
+
+namespace control {
+
+//  using lumiera::P;
+//  using lumiera::Query;
+  
+//  using std::string;
+//  using boost::format;
+  
+  namespace impl {
+  } // (End) impl namespace
+  
+  
+  
+  /**
+   * @internal Helper for organizing preconfigured default objects.
+   * Maintaines a collection of objects known or encountered as "default"
+   * for a given type. This collection is ordered by "degree of constriction",
+   * which is implemented by counting the number of predicates in the query
+   * used to define or identify each object.
+   * Accessing an object identified by a query causes the query to be resolved
+   * (executed in prolog), which may result in some additional properties of
+   * the object being bound or specified.
+   * @todo as of 3/2008 the real query implementation is missing, and the
+   * exact behaviour has to be defined.
+   */
+  class STypeManager::Registry : private boost::noncopyable
+    {
+    public:
+      
+    };
+  
+  
+  
+} // namespace control
+
+#endif
diff --git a/tests/common/streamtypebasicstest.cpp b/tests/common/streamtypebasicstest.cpp
index af6d3f764..d12dee470 100644
--- a/tests/common/streamtypebasicstest.cpp
+++ b/tests/common/streamtypebasicstest.cpp
@@ -24,6 +24,7 @@
 #include "common/test/run.hpp"
 #include "common/util.hpp"
 
+#include "proc/control/stypemanager.hpp"
 #include "teststreamtypes.hpp"
 
 #include 
@@ -33,7 +34,9 @@ using std::cout;
 
 namespace lumiera {
   namespace test {
-    
+
+    using control::STypeManager;
+  
 
     /*******************************************************************
      * @test check the basic workings of the stream type handling.
@@ -51,7 +54,8 @@ namespace lumiera {
         
         void buildImplType ()
           {
-            UNIMPLEMENTED ("Access/Factory for the STypeManager??");
+            STypeManager& typeManager = STypeManager::instance();
+        
             TODO ("set up a GAVL frame type");
             TODO ("use this to retrieve an ImplFacade from the STypeManager");
             UNIMPLEMENTED ("at least preliminary implementation of the MediaImplLib interface for lib GAVL");

From f80d0a49bd5c81428b2adb0397493477dc6fd70e Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Wed, 24 Sep 2008 06:36:35 +0200
Subject: [PATCH 024/100] provide for the GAVL impl facade to be registered as
 basic media type. WIP actual implementation missing...

---
 src/lib/external/libgavl.cpp | 21 +++++++++++++++++----
 src/lib/external/libgavl.hpp | 14 +++++++-------
 2 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/src/lib/external/libgavl.cpp b/src/lib/external/libgavl.cpp
index 7b477c871..054feacaf 100644
--- a/src/lib/external/libgavl.cpp
+++ b/src/lib/external/libgavl.cpp
@@ -1,5 +1,5 @@
 /*
-  STypeManager  -  entry point for dealing with media stream types
+  ImplFacadeGAVL  -  facade for integrating the GAVL media handling library
  
   Copyright (C)         Lumiera.org
     2008,               Hermann Vosseler 
@@ -23,6 +23,7 @@
 
 #include "proc/lumiera.hpp"
 #include "lib/external/libgavl.hpp"
+#include "proc/control/stypemanager.hpp"
 
 extern "C" {
 #include 
@@ -31,11 +32,24 @@ extern "C" {
 
 namespace lib {
   namespace external {
-  
-    namespace { // implementation internals
     
+    using control::STypeManager;
+    using control::ON_STREAMTYPES_RESET;
+    using lumiera::LifecycleHook;
+    
+    void
+    provide_GAVL_stream_implementation_types ()
+      {
+        STypeManager& typeManager = STypeManager::instance();
+        UNIMPLEMENTED ("wire up a ImplFacade for GAVL implemented media streams");
+      }
+    
+    namespace { // internal functionality
+    
+        LifecycleHook _register_gavl_types_ (ON_STREAMTYPES_RESET, &provide_GAVL_stream_implementation_types);         
     }
   
+  
   /** 
    * Use an type information struct, which actually has to be 
    * a GAVL frametype (TODO), to wire up an ImplFacade such 
@@ -49,7 +63,6 @@ namespace lib {
     TODO ("any chance to verify that the TypeTag actually points to a GAVL frame type descriptor?");
     UNIMPLEMENTED ("wire up an impl facade with the correct GAVL lib functions for the data type in question");
   }
-
   
   
   
diff --git a/src/lib/external/libgavl.hpp b/src/lib/external/libgavl.hpp
index 26f6b6237..706b08ed2 100644
--- a/src/lib/external/libgavl.hpp
+++ b/src/lib/external/libgavl.hpp
@@ -34,18 +34,20 @@ namespace lib {
   
   
   using lumiera::Symbol;
-    
+  
   using lumiera::StreamType;
   typedef StreamType::ImplFacade ImplFacade;
   typedef StreamType::ImplFacade::TypeTag TypeTag;
-
+  
   
   class LibGavl;
   
   /**
    * Concrete media lib implementation facade
    * allowing to work with GAVL data frames and types
-   * in an implementation agnostic way
+   * in an implementation agnostic way.
+   * @note GAVL types are automagically registered into the
+   * control::STypeManager on reset and thus are always available.
    */
   class ImplFacadeGAVL
     : public ImplFacade
@@ -67,7 +69,7 @@ namespace lib {
       virtual DataBuffer* createFrame ()  const;
     };
   
-    
+  
   class LibGavl
     : public control::MediaImplLib
     {
@@ -78,9 +80,7 @@ namespace lib {
       
       virtual ImplFacadeGAVL const&  getImplFacade (TypeTag*);
     };
-    
-    
-  ////////////////////////////////////TODO: dafür sorgen, daß sich das beim Systemstart in den control::STypeManger einklinkt!!!!!!!!
+  
   
   
   } // namespace external

From 8109badf49c3c415c155f484733541ad3fb964e5 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Wed, 24 Sep 2008 06:37:42 +0200
Subject: [PATCH 025/100] outline a test covering the stream type registration
 lifecycle

---
 tests/50components.tests                 |   4 +
 tests/common/streamtypebasicstest.cpp    |  12 +--
 tests/common/streamtypelifecycletest.cpp | 114 +++++++++++++++++++++++
 3 files changed, 124 insertions(+), 6 deletions(-)
 create mode 100644 tests/common/streamtypelifecycletest.cpp

diff --git a/tests/50components.tests b/tests/50components.tests
index 57534f06a..37b867be1 100644
--- a/tests/50components.tests
+++ b/tests/50components.tests
@@ -284,6 +284,10 @@ PLANNED "StreamTypeBasics_test" StreamTypeBasics_test < Testgroup=ALL
diff --git a/tests/common/streamtypebasicstest.cpp b/tests/common/streamtypebasicstest.cpp
index d12dee470..b852e1acd 100644
--- a/tests/common/streamtypebasicstest.cpp
+++ b/tests/common/streamtypebasicstest.cpp
@@ -34,10 +34,10 @@ using std::cout;
 
 namespace lumiera {
   namespace test {
-
+    
     using control::STypeManager;
-  
-
+    
+    
     /*******************************************************************
      * @test check the basic workings of the stream type handling.
      *       create some stream implementation data, build a 
@@ -72,9 +72,9 @@ namespace lumiera {
           }
       };
     
-      LAUNCHER (StreamTypeBasics_test, "unit common");
-
-      
+    LAUNCHER (StreamTypeBasics_test, "unit common");
+    
+    
   } // namespace test
     
 } // namespace lumiera
diff --git a/tests/common/streamtypelifecycletest.cpp b/tests/common/streamtypelifecycletest.cpp
new file mode 100644
index 000000000..82f7cf6b9
--- /dev/null
+++ b/tests/common/streamtypelifecycletest.cpp
@@ -0,0 +1,114 @@
+/*
+  StreamTypeLifecycle(Test)  -  check lifecycle of the stream type registration
+ 
+  Copyright (C)         Lumiera.org
+    2008,               Hermann Vosseler 
+ 
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+ 
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+ 
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ 
+* *****************************************************/
+
+
+#include "common/test/run.hpp"
+#include "common/util.hpp"
+
+#include "proc/control/stypemanager.hpp"
+#include "proc/mobject/session.hpp"
+//#include "teststreamtypes.hpp"
+
+#include 
+using std::cout;
+
+
+
+namespace lumiera {
+  namespace test {
+    
+    using mobject::Session;
+    using control::STypeManager;
+    using control::ON_STREAMTYPES_RESET;
+    
+    
+    //////////TODO define a dummy-type-info here
+    //////////TODO
+    
+    void 
+    setup_basicDummyTypeInfo () 
+      { 
+        UNIMPLEMENTED ("setup basic dummy-type-info"); 
+      }
+    
+    namespace // enroll this basic setup to be triggered when the type system is reset 
+      {
+        LifecycleHook _schedule_at_reset (ON_STREAMTYPES_RESET, &setup_basicDummyTypeInfo);         
+      }
+    
+    
+    
+    /*******************************************************************
+     * @test check the stream type registration lifecycle. 
+     *       Any internal or external component (plugin) can extend
+     *       the Proc Layer's registry of media stream types.
+     *       There is a basic pristine set of type information, which is
+     *       restored automatically everytime the STypeManager is reset,
+     *       which in turn happenes before loading a (new) Session.
+     */
+    class StreamTypeLifecycle_test : public Test
+      {
+        virtual void
+        run (Arg arg)
+          {
+            check_pristineState ();
+            register_additional_TypeInfo ();
+            check_pristineState ();
+          }
+        
+        
+        /** @test this test defines a new (dummy) type info
+         *  and schedules it for setop in the pristine state;
+         *  check this info is actually present after resetting
+         *  the stream type manager, while other additional info
+         *  \em not scheduled in this manner is not present 
+         *  in this state
+         */
+        void
+        check_pristineState ()
+          {
+            Session::current.reset();
+            TODO ("verify the test-dummy basic type info is present now...");
+            TODO ("verify the additional type info is *not* present");
+          }
+        
+        /** @test use the stream type manager to register additional
+         *  type info and verify it is used in type resolution.
+         */
+        void
+        register_additional_TypeInfo ()
+          {
+            TODO ("verify the additional type info is *not* present");
+            
+            STypeManager& typeManager = STypeManager::instance();
+            TODO ("use the registration facility to add additional type info");
+            TODO ("verify the additional type info to be present now...");
+          }
+      };
+    
+    LAUNCHER (StreamTypeLifecycle_test, "unit common");
+    
+    
+  } // namespace test
+  
+} // namespace lumiera
+

From 47a416bba372d0b889e2f797565d7cdd8d466a1f Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Thu, 25 Sep 2008 21:48:43 +0200
Subject: [PATCH 026/100] *Hey* first time to use a GAVL video frame type...

---
 tests/common/streamtypebasicstest.cpp    |  6 ++--
 tests/common/streamtypelifecycletest.cpp |  4 +--
 tests/common/teststreamtypes.hpp         | 43 ++++++++++++++++++++++--
 3 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/tests/common/streamtypebasicstest.cpp b/tests/common/streamtypebasicstest.cpp
index b852e1acd..9a25b4a1d 100644
--- a/tests/common/streamtypebasicstest.cpp
+++ b/tests/common/streamtypebasicstest.cpp
@@ -33,7 +33,7 @@ using std::cout;
 
 
 namespace lumiera {
-  namespace test {
+  namespace test_format {
     
     using control::STypeManager;
     
@@ -56,7 +56,7 @@ namespace lumiera {
           {
             STypeManager& typeManager = STypeManager::instance();
         
-            TODO ("set up a GAVL frame type");
+            gavl_video_format_t rawType = createRawType();
             TODO ("use this to retrieve an ImplFacade from the STypeManager");
             UNIMPLEMENTED ("at least preliminary implementation of the MediaImplLib interface for lib GAVL");
             TODO ("how to do a simple consistency check on the returned ImplFacade? can we re-create the GAVL frame type?");
@@ -75,7 +75,7 @@ namespace lumiera {
     LAUNCHER (StreamTypeBasics_test, "unit common");
     
     
-  } // namespace test
+  } // namespace test_format
     
 } // namespace lumiera
 
diff --git a/tests/common/streamtypelifecycletest.cpp b/tests/common/streamtypelifecycletest.cpp
index 82f7cf6b9..ce260da59 100644
--- a/tests/common/streamtypelifecycletest.cpp
+++ b/tests/common/streamtypelifecycletest.cpp
@@ -34,7 +34,7 @@ using std::cout;
 
 
 namespace lumiera {
-  namespace test {
+  namespace test_format {
     
     using mobject::Session;
     using control::STypeManager;
@@ -108,7 +108,7 @@ namespace lumiera {
     LAUNCHER (StreamTypeLifecycle_test, "unit common");
     
     
-  } // namespace test
+  } // namespace test_format
   
 } // namespace lumiera
 
diff --git a/tests/common/teststreamtypes.hpp b/tests/common/teststreamtypes.hpp
index 03409c7a9..e0d53f9e2 100644
--- a/tests/common/teststreamtypes.hpp
+++ b/tests/common/teststreamtypes.hpp
@@ -30,10 +30,49 @@
 #include "common/streamtype.hpp"
 #include "proc/control/stypemanager.hpp"
 
+extern "C" {
+#include 
+}
 
 
 namespace lumiera {
-  namespace test {
+  namespace test_format {
+  
+    namespace { // constants used to parametrize tests
+    
+      const int TEST_IMG_WIDTH = 40;
+      const int TEST_IMG_HEIGHT = 30;
+      
+      const int TEST_FRAME_DUR = GAVL_TIME_SCALE / 25; 
+    }
+    
+    /** Helper: create an raw GAVL type descriptor
+     *  usable for generating a Lumiera StreamType 
+     */
+    inline gavl_video_format_t
+    createRawType ()
+    {
+      gavl_video_format_t type;
+      
+      type.pixelformat = GAVL_RGB_24;
+      type.interlace_mode = GAVL_INTERLACE_NONE;
+      type.framerate_mode = GAVL_FRAMERATE_CONSTANT;
+      type.chroma_placement = GAVL_CHROMA_PLACEMENT_DEFAULT;
+      
+      type.image_width  = TEST_IMG_WIDTH;   // Width of the image in pixels
+      type.image_height = TEST_IMG_WIDTH;   // Height of the image in pixels
+      type.frame_width  = TEST_IMG_WIDTH;   // Width of the frame buffer in pixels, might be larger than image_width 
+      type.frame_height = TEST_IMG_WIDTH;   // Height of the frame buffer in pixels, might be larger than image_height
+  
+      type.pixel_width  = 1;              // Relative width of a pixel (pixel aspect ratio is pixel_width/pixel_height)
+      type.pixel_height = 1;             // Relative height of a pixel (pixel aspect ratio is pixel_width/pixel_height)
+
+      type.frame_duration = TEST_FRAME_DUR; // Duration of a frame in timescale tics. 
+      type.timescale = GAVL_TIME_SCALE;     // Timescale in tics per second  (is defined to be 1000000 as of 9/2008)
+      
+      return type;
+    }
+    
     
     /** Helper: create an implementation frame
      *  and build the corresponding streamtype
@@ -46,7 +85,7 @@ namespace lumiera {
     
     
     
-  } // namespace test
+  } // namespace test_format
 
 } // namespace lumiera
 #endif

From feb64fac016d54d32909950f6e1ee4a034fb341f Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Fri, 26 Sep 2008 04:57:20 +0200
Subject: [PATCH 027/100] outline: use of the raw type info for fetching a
 ImplFacade

---
 src/common/streamtype.hpp             | 32 ++++++++++++++++++++++-----
 src/lib/external/libgavl.cpp          |  2 +-
 src/lib/external/libgavl.hpp          |  2 +-
 src/proc/control/mediaimpllib.hpp     |  2 +-
 src/proc/control/stypemanager.cpp     | 12 +++++-----
 src/proc/control/stypemanager.hpp     | 26 +++++++++++++++++-----
 tests/common/streamtypebasicstest.cpp | 10 ++++++---
 tests/common/teststreamtypes.hpp      | 17 +++++++++-----
 wiki/renderengine.html                |  9 ++++----
 9 files changed, 78 insertions(+), 34 deletions(-)

diff --git a/src/common/streamtype.hpp b/src/common/streamtype.hpp
index 6319c40a5..dfebfca95 100644
--- a/src/common/streamtype.hpp
+++ b/src/common/streamtype.hpp
@@ -102,8 +102,7 @@ namespace lumiera {
     public:
       Symbol libraryID;
       
-      /** placeholder definition for implementation specific type information */
-      struct TypeTag { };
+      class TypeTag ; 
       
       /** placeholder definition for the contents of a data buffer */
       struct DataBuffer { };
@@ -125,14 +124,15 @@ namespace lumiera {
   
   
   /**
-   * 
+   * Special case of an implementation type being only partialiy specified
+   * Besides requiring some aspect of the implementation type, there is the
+   * promise to fill in defaults to build a complete implementation type
+   * if necessary.
    */
   class StreamType::ImplConstraint
     : public StreamType::ImplFacade
     {
     public:
-      Symbol libraryID;
-      
       virtual bool canConvert (ImplFacade const& other)  const =0;
       virtual bool canConvert (StreamType const& other)  const =0;
       
@@ -153,6 +153,28 @@ namespace lumiera {
       //TODO: do we need functions to represent and describe this constraint?
       
     };
+  
+  
+    /** 
+     * opaque placeholder (type erasure) 
+     * for implementation specific type info.
+     * Intended to be passed to a concrete
+     * MediaImplLib to build an ImplFacade. 
+     */
+  class StreamType::ImplFacade::TypeTag
+    {
+      void* rawTypeStruct_;
+      
+    public:
+      Symbol libraryID;
+      
+      template
+      TypeTag (Symbol lID, TY& rawType)
+        : rawTypeStruct_(&rawType),
+          libraryID(lID)
+        { }
+    };
+
     
   
 
diff --git a/src/lib/external/libgavl.cpp b/src/lib/external/libgavl.cpp
index 054feacaf..740515052 100644
--- a/src/lib/external/libgavl.cpp
+++ b/src/lib/external/libgavl.cpp
@@ -58,7 +58,7 @@ namespace lib {
    * @todo how to distinguish the audio and the video case?
    */
   ImplFacadeGAVL const&
-  LibGavl::getImplFacade (TypeTag*)
+  LibGavl::getImplFacade (TypeTag&)
   {
     TODO ("any chance to verify that the TypeTag actually points to a GAVL frame type descriptor?");
     UNIMPLEMENTED ("wire up an impl facade with the correct GAVL lib functions for the data type in question");
diff --git a/src/lib/external/libgavl.hpp b/src/lib/external/libgavl.hpp
index 706b08ed2..945aec2b7 100644
--- a/src/lib/external/libgavl.hpp
+++ b/src/lib/external/libgavl.hpp
@@ -78,7 +78,7 @@ namespace lib {
     public:
       virtual Symbol getLibID()  const  { return "GAVL"; }
       
-      virtual ImplFacadeGAVL const&  getImplFacade (TypeTag*);
+      virtual ImplFacadeGAVL const&  getImplFacade (TypeTag&);
     };
   
   
diff --git a/src/proc/control/mediaimpllib.hpp b/src/proc/control/mediaimpllib.hpp
index c150ad913..396d573ef 100644
--- a/src/proc/control/mediaimpllib.hpp
+++ b/src/proc/control/mediaimpllib.hpp
@@ -46,7 +46,7 @@ namespace control {
     public:
       virtual Symbol getLibID()  const =0;
       
-      virtual ImplFacade const&  getImplFacade (TypeTag*) =0;
+      virtual ImplFacade const&  getImplFacade (TypeTag&) =0;
     };
   
   
diff --git a/src/proc/control/stypemanager.cpp b/src/proc/control/stypemanager.cpp
index 330d9581e..d28ee3eb0 100644
--- a/src/proc/control/stypemanager.cpp
+++ b/src/proc/control/stypemanager.cpp
@@ -36,7 +36,7 @@ namespace control {
   
   STypeManager::STypeManager()
     : reg_(0)
-  { 
+  {
     reset();
   }
   
@@ -55,7 +55,7 @@ namespace control {
     lumiera::Appconfig::lifecycle(ON_STREAMTYPES_RESET);
   }
   
-  /** \par 
+  /** \par
    *  LifecycleHook, on which all the basic setup and configuration
    *  providing the pristine state of the stream type system has to be registered.
    *  @note plugins providing additional streamtype configuration should register
@@ -63,8 +63,8 @@ namespace control {
    *        the C interface functions 
    */
   Symbol ON_STREAMTYPES_RESET ("ON_STREAMTYPES_RESET");
-
-
+  
+  
   
   
   
@@ -100,13 +100,11 @@ namespace control {
   
   
   StreamType::ImplFacade const&
-  STypeManager::getImpl (Symbol libID, StreamType::ImplFacade::TypeTag rawType)
+  STypeManager::fetchImpl (StreamType::ImplFacade::TypeTag rawType)
   {
     UNIMPLEMENTED ("STypeManager basic functionality: wire up implementation facade (impl type) from given raw type of the library");
   }
   
-  
-  
 } // namespace control
 
 
diff --git a/src/proc/control/stypemanager.hpp b/src/proc/control/stypemanager.hpp
index 02edaeb2d..48445a427 100644
--- a/src/proc/control/stypemanager.hpp
+++ b/src/proc/control/stypemanager.hpp
@@ -46,6 +46,8 @@ namespace control {
     public:
       static lumiera::Singleton instance;
       
+      typedef StreamType::ImplFacade ImplFacade;
+      
       /** (re)-access a media stream type using
        *  just a symbolic ID. Effectively this queries a default */
       StreamType const& getType (Symbol sTypeID) ;
@@ -55,22 +57,23 @@ namespace control {
       
       /** build or retrieve a complete StreamType incorporating the given implementation type */
       StreamType const& getType (StreamType::ImplFacade const& implType) ;
-
+      
       /** build or retrieve an implementation (facade)
        *  utilizing a specific MediaImplLib and implementing the given Prototype.
        *  @todo find out if this one is really necessary, because it is especially tricky */
-      StreamType::ImplFacade const& getImpl (Symbol libID, StreamType::Prototype const& protoType) ;
+      ImplFacade const& getImpl (Symbol libID, StreamType::Prototype const& protoType) ;
       
       /** build or retrieve an implementation (facade)
        *  wrapping up the actual implementation as designated by the rawType tag,
        *  which needs to be an implementation type of the mentioned MediaImplLib */
-      StreamType::ImplFacade const& getImpl (Symbol libID, StreamType::ImplFacade::TypeTag rawType) ;
+      template
+      ImplFacade const& getImpl (Symbol libID, TY& rawType) ;
       
       
       
       ////////////////TODO: design a mechanism allowing to add MediaImplLib implementations by plugin......
     protected:
-      STypeManager();
+      STypeManager() ;
       ~STypeManager();
       
       friend class lumiera::singleton::StaticCreate;
@@ -81,10 +84,21 @@ namespace control {
        *  excludes everything added by the session
        */
       void reset() ;
-
+      
+    private:
+      ImplFacade const& fetchImpl (StreamType::ImplFacade::TypeTag);
     };
   
-  extern Symbol ON_STREAMTYPES_RESET;  ///< triggered to load the generic pristine default  
+  extern Symbol ON_STREAMTYPES_RESET;  ///< triggered to load the generic pristine default
+  
+  
+  template
+  StreamType::ImplFacade const&
+  STypeManager::getImpl (Symbol libID, TY& rawType)
+  {
+    return fetchImpl (ImplFacade::TypeTag (libID,rawType));
+  }
+  
   
 } // namespace control
 
diff --git a/tests/common/streamtypebasicstest.cpp b/tests/common/streamtypebasicstest.cpp
index 9a25b4a1d..6097da0a7 100644
--- a/tests/common/streamtypebasicstest.cpp
+++ b/tests/common/streamtypebasicstest.cpp
@@ -36,6 +36,7 @@ namespace lumiera {
   namespace test_format {
     
     using control::STypeManager;
+    typedef StreamType::ImplFacade const& ImplType;
     
     
     /*******************************************************************
@@ -56,15 +57,18 @@ namespace lumiera {
           {
             STypeManager& typeManager = STypeManager::instance();
         
-            gavl_video_format_t rawType = createRawType();
-            TODO ("use this to retrieve an ImplFacade from the STypeManager");
+            gavl_video_format_t rawType = test_createRawType();
+            ImplType iTy (typeManager.getImpl (GAVL, rawType));
+            
             UNIMPLEMENTED ("at least preliminary implementation of the MediaImplLib interface for lib GAVL");
+            
             TODO ("how to do a simple consistency check on the returned ImplFacade? can we re-create the GAVL frame type?");
+            ASSERT (GAVL==iTy.libraryID);
           }
         
         void basicImplTypeProperties ()
           {
-            StreamType::ImplFacade& iType = createImplType ();
+            ImplType iTy = test_createImplType ();
             
             UNIMPLEMENTED ("get a lib descriptor"); 
             UNIMPLEMENTED ("check the lib of the type"); 
diff --git a/tests/common/teststreamtypes.hpp b/tests/common/teststreamtypes.hpp
index e0d53f9e2..3505b7580 100644
--- a/tests/common/teststreamtypes.hpp
+++ b/tests/common/teststreamtypes.hpp
@@ -45,12 +45,16 @@ namespace lumiera {
       
       const int TEST_FRAME_DUR = GAVL_TIME_SCALE / 25; 
     }
+        
+    Symbol GAVL = "GAVL";
+    
+    
     
     /** Helper: create an raw GAVL type descriptor
      *  usable for generating a Lumiera StreamType 
      */
     inline gavl_video_format_t
-    createRawType ()
+    test_createRawType ()
     {
       gavl_video_format_t type;
       
@@ -63,10 +67,10 @@ namespace lumiera {
       type.image_height = TEST_IMG_WIDTH;   // Height of the image in pixels
       type.frame_width  = TEST_IMG_WIDTH;   // Width of the frame buffer in pixels, might be larger than image_width 
       type.frame_height = TEST_IMG_WIDTH;   // Height of the frame buffer in pixels, might be larger than image_height
-  
+      
       type.pixel_width  = 1;              // Relative width of a pixel (pixel aspect ratio is pixel_width/pixel_height)
       type.pixel_height = 1;             // Relative height of a pixel (pixel aspect ratio is pixel_width/pixel_height)
-
+      
       type.frame_duration = TEST_FRAME_DUR; // Duration of a frame in timescale tics. 
       type.timescale = GAVL_TIME_SCALE;     // Timescale in tics per second  (is defined to be 1000000 as of 9/2008)
       
@@ -77,10 +81,11 @@ namespace lumiera {
     /** Helper: create an implementation frame
      *  and build the corresponding streamtype
      */
-    inline StreamType::ImplFacade&
-    createImplType ()
+    inline StreamType::ImplFacade const&
+    test_createImplType ()
     {
-      UNIMPLEMENTED ("create a test stream type from a given GAVL type tag");
+      gavl_video_format_t rawType = test_createRawType();
+      return control::STypeManager::instance().getImpl (GAVL, rawType);
     }
     
     
diff --git a/wiki/renderengine.html b/wiki/renderengine.html
index ae0094e00..c1681b9f6 100644
--- a/wiki/renderengine.html
+++ b/wiki/renderengine.html
@@ -1841,7 +1841,7 @@ __5/2008__: the allocation mechanism can surely be improved later, but for now I
 &rarr; see also LoadingMedia
 
-
+
The Proc-Layer is designed such as to avoid unnecessary assumptions regarding the properties of the media data and streams. Thus, for anything which is not completely generic, we rely on an abstract [[type description|StreamTypeDescriptor]], which provides a ''Facade'' to an actual library implementation. This way, the fundamental operations can be invoked, like allocating a buffer to hold media data.
 
 In the context of Lumiera and especially in the Proc-Layer, __media implementation library__ means
@@ -1849,12 +1849,12 @@ In the context of Lumiera and especially in the Proc-Layer, __media implementati
 * such as to provide the minimal set of operations
 ** allocating a frame buffer
 ** describing the type of the data within such a buffer
-* and this subsystem or external library has been integrated to be used by Lumiera by writing adaptation code for accessing these basic operations through the [[implementation facade interface|StreamTypeImplFacade]]
+* and this subsystem or external library has been integrated to be used through Lumiera by writing adaptation code for accessing these basic operations through the [[implementation facade interface|StreamTypeImplFacade]]
 * such a link to an type implementation is registered and maintained by the [[stream type manager|STypeManager]]
 
 !Problem of the implementation data types
 Because we deliberately won't make any asumptions about the implementation library (besides the ones imposed indirectly by the facade interface), we can't integrate the data types of the library first class into the type system. All we can do is to use marker types and rely on the builder to have checked the compatibility of the actual data beforehand. 
-It would be possible to circumvent this problem by requiring all supported implementation libraries to be known at compile time, because then the actual media implementation type could be linked to a facade type by generic programming. Indeed, Lumiera follows this route with regards to the possible kinds of MObject or [[Asset]] &mdash; but here to the contraty, being able to include support for a new media data type just by adding a plugin by far outweights the benefits of compile-time checked implementation type selection. So, as a consequence of this design decision we //note the possibility of the media file type discovery code to be misconfigured// and select the //wrong implementation library at runtime.// And thus the render engine needs to be prepared for the source reading node of any pipe to flounder completely, and protect the rest of the system accordingly
+It would be possible to circumvent this problem by requiring all supported implementation libraries to be known at compile time, because then the actual media implementation type could be linked to a facade type by generic programming. Indeed, Lumiera follows this route with regards to the possible kinds of MObject or [[Asset]] &mdash; but to the contraty, for the problem in question here, being able to include support for a new media data type just by adding a plugin by far outweights the benefits of compile-time checked implementation type selection. So, as a consequence of this design decision we //note the possibility of the media file type discovery code to be misconfigured// and select the //wrong implementation library at runtime.// And thus the render engine needs to be prepared for the source reading node of any pipe to flounder completely, and protect the rest of the system accordingly
 
@@ -3406,7 +3406,7 @@ Within the Proc-Layer, media streams are treated largely in a similar manner. Bu An implementation constraint can //stand-in// for a completely specified implementation type (meaning it's a sub interface of the latter). But actually using it in this way may cause a call to the [[defaults manager|DefaultsImplementation]] to fill in any missing information. An example would be to call {{{createFrame()}}} on the type constraint object, which means being able to allocate memory to hold a data frame, with properties in compliance with the given type constraint. Of cousre, then we need to know all the properties of this stream type, which is where the defaults manager is queried. This allows session customisation to kick in, but may fail under certain cicumstances.
-
+
Common interface for dealing with the implementation of media stream data. From a high level perspective, the various kinds of media ({{{VIDEO, IMAGE, AUDIO, MIDI,...}}}) exhibit similar behaviour, while on the implementation level not even the common classification can be settled down to a complete general and useful scheme. Thus, we need separate library implementations for deailing with the various sorts of media data, all providing at least a set of basic operations:
 * set up a buffer
 * create or accept a frame
@@ -3414,6 +3414,7 @@ An implementation constraint can //stand-in// for a completely specified impleme
 * ...?
 
 &rarr; see also &raquo;[[Stream Type|StreamType]]&laquo;
+//Note:// there is a sort-of "degraded" variant just requiring some &rarr; [[implementation constraint|StreamTypeImplConstraint]] to hold
 
From 873910f0b8162a207267b2eebaf96086f8f1a35c Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 28 Sep 2008 04:05:10 +0200 Subject: [PATCH 028/100] WIP considerations about querying --- src/common/streamtype.hpp | 18 +++---- src/lib/external/libgavl.hpp | 1 + src/proc/control/stypemanager.hpp | 1 + src/tool/try.cpp | 80 ------------------------------- wiki/renderengine.html | 25 +++++++--- 5 files changed, 30 insertions(+), 95 deletions(-) diff --git a/src/common/streamtype.hpp b/src/common/streamtype.hpp index dfebfca95..28c87bfa4 100644 --- a/src/common/streamtype.hpp +++ b/src/common/streamtype.hpp @@ -70,7 +70,6 @@ namespace lumiera { class ImplConstraint; - MediaKind kind; Prototype const& prototype; ImplFacade * implType; Usage intentionTag; @@ -85,13 +84,14 @@ namespace lumiera { struct StreamType::Prototype { Symbol id; + MediaKind kind; bool subsumes (Prototype const& other) const; - bool canConvert (Prototype const& other) const; + bool canRender (Prototype const& other) const; }; - + /** * A (more or less) concrete implementation type, wired up @@ -106,7 +106,7 @@ namespace lumiera { /** placeholder definition for the contents of a data buffer */ struct DataBuffer { }; - + virtual bool operator== (ImplFacade const& other) const =0; virtual bool operator== (StreamType const& other) const =0; @@ -115,6 +115,7 @@ namespace lumiera { virtual bool canConvert (StreamType const& other) const =0; virtual DataBuffer* createFrame () const =0; + virtual MediaKind getKind() const =0; virtual ~ImplFacade() {}; @@ -144,7 +145,7 @@ namespace lumiera { /** create a default impl type in accordance to this constraint * and use it to create a new framebuffer */ virtual DataBuffer* createFrame () const =0; - + /** similarily create a impl type which complies to this constraint * as well as to the additional constraints (e.g. frame size). * Create a new framebuffer of the resutling type */ @@ -174,10 +175,9 @@ namespace lumiera { libraryID(lID) { } }; - - - - + + + } // namespace lumiera #endif diff --git a/src/lib/external/libgavl.hpp b/src/lib/external/libgavl.hpp index 945aec2b7..d8d7bc412 100644 --- a/src/lib/external/libgavl.hpp +++ b/src/lib/external/libgavl.hpp @@ -66,6 +66,7 @@ namespace lib { virtual bool canConvert (ImplFacade const& other) const; virtual bool canConvert (StreamType const& other) const; + virtual StreamType::MediaKind getKind() const; virtual DataBuffer* createFrame () const; }; diff --git a/src/proc/control/stypemanager.hpp b/src/proc/control/stypemanager.hpp index 48445a427..dcefe74f3 100644 --- a/src/proc/control/stypemanager.hpp +++ b/src/proc/control/stypemanager.hpp @@ -48,6 +48,7 @@ namespace control { typedef StreamType::ImplFacade ImplFacade; + /** (re)-access a media stream type using * just a symbolic ID. Effectively this queries a default */ StreamType const& getType (Symbol sTypeID) ; diff --git a/src/tool/try.cpp b/src/tool/try.cpp index 3f51bcaf6..167946552 100644 --- a/src/tool/try.cpp +++ b/src/tool/try.cpp @@ -20,101 +20,21 @@ using std::string; using std::cout; -using std::ostream; using boost::format; -#include -using boost::enable_if; -#include -using boost::is_base_of; -#include -#include - - -#include "common/meta/generator.hpp" -using lumiera::typelist::NullType; -using lumiera::typelist::Node; -using lumiera::typelist::Types; - - namespace { boost::format fmt ("<%2i>"); - /** constant-wrapper type for debugging purposes, - * usable for generating lists of distinghishable types - */ - template - struct Num - { - enum{ VAL=I }; - static string str () { return boost::str (fmt % I); } - Num() - { - cout << Num::str(); - } - }; - - - - template class _CandidateTemplate_> - class Instantiation - { - template - struct If_possibleArgument : _CandidateTemplate_ - { - typedef void Type; - }; - - public: - - template - struct Test - : boost::false_type {}; - - template - struct Test::Type > - : boost::true_type {}; - - }; - } - struct Boing { typedef boost::true_type is_defined; }; - - template struct Zoing ; - - template<> struct Zoing<2> : Boing { enum{wau = 2}; }; - template<> struct Zoing<5> : Boing { enum{wau = 5}; }; - - typedef char yes_type; - struct no_type - { - char padding[8]; - }; - - template - yes_type check(typename U::is_defined *); - template - no_type check(...); - - int main (int argc, char* argv[]) { NOBUG_INIT; - typedef Zoing<2> Z2; - typedef Zoing<3> Z3; - typedef Zoing<5> Z5; - - cout << sizeof(check(0)) << " / " - << sizeof(check(0)) << " / " - << sizeof(check(0)) ; - - cout << "\ngulp\n"; diff --git a/wiki/renderengine.html b/wiki/renderengine.html index c1681b9f6..d3b2b7c47 100644 --- a/wiki/renderengine.html +++ b/wiki/renderengine.html @@ -3354,7 +3354,7 @@ Consequently, as we can't get away with an fixed Enum of all stream prototypes, NTSC and PAL video, video versus digitized film, HD video versus SD video, 3D versus flat video, cinemascope versus 4:3, stereophonic versus monaural, periphonic versus panoramic sound, Ambisonics versus 5.1, dolby versus linear PCM...
-
+
//how to classify and describe media streams//
 Media data is understood to appear structured as stream(s) over time. While there may be an inherent internal structuring, at a given perspective ''any stream is a unit and homogeneous''. In the context of digital media data processing, streams are always ''quantized'', which means they appear as a temporal sequence of data chunks called ''frames''.
 
@@ -3376,8 +3376,8 @@ A stream type is denoted by a StreamTypeID, which is an identifier, acting as an
 !! Classification
 Within the Proc-Layer, media streams are treated largely in a similar manner. But, looking closer, note everything can be connected together, while on the other hand there may be some classes of media streams which can be considered //equivalent// in most respects. Thus, it seems reasonable to separate the distinction between various media streams into several levels
 * Each media belongs to a fundamental ''kind'' of media, examples being __Video__, __Image__, __Audio__, __MIDI__,... Media streams of different kind can be considered somewhat "completely separate" &mdash; just the handling of each of those media kinds follows a common //generic pattern// augmented with specialisations. Basically, it is //impossible to connect// media streams of different kind. Under some circumstances there may be the possibility of a //transformation// though. For example, a still image can be incorporated into video, sound may be visualized, MIDI may control a sound synthesizer.
-* Below the level of distinct kinds of media streams, within every kind we have an open ended collection of ''prototypes'', which, when compared directly may each be quite distinct and different, but which may be //rendered//&nbsp; into each other. For example, we have stereoscopic (3D) video and we have the common flat video lacking depth information, we have several spatial audio systems (Ambisonics, Wave Field Synthesis), we have panorama simulating sound systems (5.1, 7.1,...), we have common stereophonic and monaural audio. It is considered important to retain some openness and configurability within this level of distinction, which means this classification should better be done by rules then by setting up a fixed property table. For example, it may be desirable for some production to distinguish between digitized film and video NTSC and PAL, while in another production everything is just "video" and can be converted automatically. The most noticeable consequence of such a distinction is that any Bus or [[Pipe]] is always limited to a media stream of a single prototype. (&rarr; [[more|StreamPrototype]])
-* Besides the distinction by prototypes, there are the various media ''implementation types''. This classification is not necessarily hierarchically related to the prototype classification, while in practice commonly there will be some sort of dependency. For example, both stereophonic and monaural audio may be implemented as 96kHz 24bit PCM with just a different number of channel streams, as well we may have a dedicated stereo audio stream with two channels multiplexed into a single stream. For dealing with media streams of various implementation type, we need //library// routines, which also yield a //type classification system.// Most notably, for raw sound and video data we use the GAVL library, which defines a classification system for buffers and streams.
+* Below the level of distinct kinds of media streams, within every kind we have an open ended collection of ''prototypes'', which, when compared directly, may each be quite distinct and different, but which may be //rendered//&nbsp; into each other. For example, we have stereoscopic (3D) video and we have the common flat video lacking depth information, we have several spatial audio systems (Ambisonics, Wave Field Synthesis), we have panorama simulating sound systems (5.1, 7.1,...), we have common stereophonic and monaural audio. It is considered important to retain some openness and configurability within this level of distinction, which means this classification should better be done by rules then by setting up a fixed property table. For example, it may be desirable for some production to distinguish between digitized film and video NTSC and PAL, while in another production everything is just "video" and can be converted automatically. The most noticeable consequence of such a distinction is that any Bus or [[Pipe]] is always limited to a media stream of a single prototype. (&rarr; [[more|StreamPrototype]])
+* Besides the distinction by prototypes, there are the various media ''implementation types''. This classification is not necessarily hierarchically related to the prototype classification, while in practice commonly there will be some sort of dependency. For example, both stereophonic and monaural audio may be implemented as 96kHz 24bit PCM with just a different number of channel streams, as well we may have a dedicated stereo audio stream with two channels multiplexed into a single stream. For dealing with media streams of various implementation type, we need //library// routines, which also yield a //type classification system.// Most notably, for raw sound and video data we use the [[GAVL]] library, which defines a classification system for buffers and streams.
 * Besides the type classification detailed thus far, we introduce an ''intention tag''. This is a synthetic classification owned by Lumiera and used for internal wiring decisions. Currently (8/08), we recognize the following intention tags: __Source__, __Raw__, __Intermediary__ and __Target__. Only media streams tagged as __Raw__ can be processed.
 
 !! Media handling requirements involving stream type classification
@@ -3385,7 +3385,9 @@ Within the Proc-Layer, media streams are treated largely in a similar manner. Bu
 * determine if a given media data source and sink can be connected, and how.
 * determine and enumerate the internal structure of a stream.
 * discover processing facilities
-&rarr; see StreamTypeUse
+&rarr; see StreamTypeUse +&rarr; [[querying types|StreamTypeQuery]] +
A description and classification record usable to find out about the properties of a media stream. The stream type descriptor can be accessed using an unique StreamTypeID. The information contained in this descriptor record can intentionally be //incomplete,// in which case the descriptor captures a class of matching media stream types. The following information is maintained:
@@ -3417,13 +3419,24 @@ An implementation constraint can //stand-in// for a completely specified impleme
 //Note:// there is a sort-of "degraded" variant just requiring some &rarr; [[implementation constraint|StreamTypeImplConstraint]] to hold
 
-
+
+
Querying for media stream type information comes in various flavours
+* you may find a structural object (pipe, output, processing patten) associated with / able to deal with a certain stream type
+* you may need a StreamTypeDescriptor for an existing stream given as implementation data
+* you may want to build or complete type information from partial specification.
+Mostly, those queries involve the ConfigRules system in some way or the other. The [[prototype-|StreamPrototype]] and [[implementation type|StreamTypeImplFacade]]-interfaces themselves are mostly a facade for issuing appropriate queries. Some objects (especially [[pipes|Pipe]]) are tied to a certain stream type and thus store a direct link to type information. Others are just associated with a type by virtue of the DefaultsManagement.
+
+
+
Questions regarding the use of StreamType within the Proc-Layer.
-
 * what is the relation between Buffer and Frame?
 * how to get the required size of a Buffer?
 * who does buffer allocations and how?
 
+Mostly, stream types are used for querying, either to decide if they can be connected, or to find usable processing modules.
+Even building a stream type from partial information involves some sort of query.
+&rarr; more on [[media stream type queries|StreamTypeQuery]]
+
 !creating stream types
 seemingly stream types are created based on an already existing media stream (or a Frame of media data?). {{red{really?}}}
 The other use case seems to be that of an //incomplete// stream type based on a [[Prototype|StreamPrototype]]

From 064bf703934441dcf881d77b2897f781543ce5b5 Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Sun, 28 Sep 2008 05:23:32 +0200
Subject: [PATCH 029/100] WIP analysis of the various query situations

---
 wiki/renderengine.html | 36 +++++++++++++++++++++++++++++++++---
 1 file changed, 33 insertions(+), 3 deletions(-)

diff --git a/wiki/renderengine.html b/wiki/renderengine.html
index d3b2b7c47..83bb69dc3 100644
--- a/wiki/renderengine.html
+++ b/wiki/renderengine.html
@@ -3419,15 +3419,43 @@ An implementation constraint can //stand-in// for a completely specified impleme
 //Note:// there is a sort-of "degraded" variant just requiring some &rarr; [[implementation constraint|StreamTypeImplConstraint]] to hold
 
-
+
Querying for media stream type information comes in various flavours
 * you may find a structural object (pipe, output, processing patten) associated with / able to deal with a certain stream type
 * you may need a StreamTypeDescriptor for an existing stream given as implementation data
 * you may want to build or complete type information from partial specification.
 Mostly, those queries involve the ConfigRules system in some way or the other. The [[prototype-|StreamPrototype]] and [[implementation type|StreamTypeImplFacade]]-interfaces themselves are mostly a facade for issuing appropriate queries. Some objects (especially [[pipes|Pipe]]) are tied to a certain stream type and thus store a direct link to type information. Others are just associated with a type by virtue of the DefaultsManagement.
+
+The //problem// with this pivotal role of the config rules is that &mdash; from a design perspective &mdash; not much can be said specifically, besides //"you may be able to find out...", "...depends on the defaults and the session configuration".// This way, a good deal of crucial behaviour is pushed out of the core implementation (and it's quite intentionally being done this way). What can be done regarding the design of the core is mostly to setup a framework for the rules and determine possible ''query situations''.
+
+!the kind of media
+the information of the fundamental media kind (video, audio, text, MIDI,...) is assiciated with the prototype, for technical reasons. Prototype information is mandatory for each StreamType, and the impl facade provides a query function (because some implementation libraries, e.g. [[GAVL]], support multiple kinds of media).
+
+!query for a prototype
+__Situation__: given an implementation type, find a prototype to subsume it.
+Required only for building a complete ~StreamType which isn't known at this point.
+The general case of this query is //quite hairy,// because the solution is not necessary clear and unique. And, worse still, it is related to the semantics, requiring semantic information and tagging to be maintained somewhere. For example, while the computer can't "know" what stereopohinc audio is (only a human can by listening to a stereophoic playback and deciding if it actually does convey a spatical sound image), in most cases we can overcome this problem by using the //heuristical rule// of assuming the prototype "stereophonic" when given two identically typed audio channels. This example also shows the necessity of ordering heuristic rules to be able to pick a best fit.
+
+We can inject two different kinds of fallback solutions for this kind of query:
+* we can always build a "catch-all" prototype just based on the kind of media (e.g. {{{prototype(video).}}}). This should match with lowest priority
+* we can search for existing ~StreamTypes with the same impl type, or an impl type which is //equivalent convertible// (see &rarr; StreamConversion). 
+The latter case can yield multiple solutions, which isn't any problem, because the match is limited to classes of equivalent stream implementation, which would be subsumed under the same prototype anyway. Even if the registry holds different prototypes linked to the same implementation type, they would be convertible and thus could stand in for one another. Together this results in the implementation
+# try to get a direct match to an existing impl type which has an associated (complete) ~StreamType, thus bypassing the ConfigRules system altogether
+# run a {{{Query<Prototype>}}} for the given implementation type
+# do the search within equivalence class as described above
+# fall back to the media kind.
+{{red{TODO: how to deal with the problem of hijacking a prototype?}}} &rarr; see [[here|StreamTypeUse]]
+
+!query for an implementation
+__Situation 1__: given an partially specified ~StreamType (just an [[constraint|StreamTypeImplConstraint]])
+__Situation 2__: find an implementation for a given prototype (without any further impl type guidlines)
+Both cases have to go though the [[defaults manager|DefaultsManagement]] in some way, in order to give any default configuration a chance to kick in. This is //one of the most important use cases// of the defaults system: the ability to configure a default fromat for all streams with certain semantic classification. {{{prototype(video)}}} by default is RGBA 24bit non-interlaced for example.
+But after having queried the defaults system, there remains the problem to build a new solution (which will then automatically become a default
+
+!query for an (complete) StreamType
 
-
+
Questions regarding the use of StreamType within the Proc-Layer.
 * what is the relation between Buffer and Frame?
 * how to get the required size of a Buffer?
@@ -3443,7 +3471,9 @@ The other use case seems to be that of an //incomplete// stream type based on a
 
 !Prototype
 According to my current understanding, a prototype is merely a classification entity. But then &mdash; how to bootstrap a Prototype?
-And how to do the classification of an existing implementation type
+And how to do the classification of an existing implementation type.
+
+Besides, there is the problem of //hijacking a prototype:// when a specific implementation type gets tied to a rather generic protoype, like {{{protoype(video)}}}, how to comply to the rule of prototypes subsuming a class of equivalent implementations?
 
 !Defaults and partial specification
 A StreamType need not be completely defined. It is sufficient to specify the media kind and the Prototype. The implementation type may be just given as a constraint, thus defining some properties and leaving out others. When creating a frame buffer based upon such an //incomplete type,// [[defaults|DefaultsManagement]] are queried to fill in the missing parts.

From e541c71995355213768f9bf4bd8574a4f42fcb8f Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Thu, 2 Oct 2008 05:40:10 +0200
Subject: [PATCH 030/100] WIP continued the analysis of queries / conversions

---
 wiki/renderengine.html | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/wiki/renderengine.html b/wiki/renderengine.html
index 83bb69dc3..b115d0ce6 100644
--- a/wiki/renderengine.html
+++ b/wiki/renderengine.html
@@ -3338,6 +3338,13 @@ if (oldText.indexOf("SplashScreen")==-1)
 * in a future version, it may also encapsulate the communication in a distributed render farm
 
+
+
Conversion of a media stream into a stream of another type is done by a processor module (plugin). The problem of finding such a module is closely related to the StreamType and especially [[problems of querying|StreamTypeQuery]] for such. There can be different kinds of conversions, and the existance or non-existance of such an conversion can influence the stream type classification.
+* different //kinds of media// can be ''transformed'' into each other
+* stream types //subsumed// by a given prototype should be ''lossless convertible''
+* besides, between different stream //implementation types,// there can be a ''rendering'' (lossy conversion) &mdash; or no conversion at all.
+
+
The stream Prototype is part of the specification of a media stream's type. It is a semantic (or problem domain oriented) concept and should be distinguished from the actual implementation type of the media stream. The latter is provided by an [[library implementation|StreamTypeImplFacade]]. While there are some common predefined prototypes, mostly, they are defined within the concrete [[Session]] according to the user's needs. 
 
@@ -3402,8 +3409,8 @@ Within the Proc-Layer, media streams are treated largely in a similar manner. Bu
 
This ID is an symbolic key linked to a StreamTypeDescriptor. The predicate {{{stream(ID)}}} specifies a media stream with the StreamType as detailed by the corresponding descriptor (which may contain complete or partial data defining the type).
-
-
A special kind of media stream [[implementation type|StreamTypeImplFacade]], which is not fully specified. As such, it is supposed there //actually is// an concrete implementation type, while only caring for some part or detail of this implementation to exhibit a specific property. For example, using an type constraint we can express the requirement of the actual implementation of a video stream to be based on RGB-float, or to enforce a fixed frame size in pixels.
+
+
A special kind of media stream [[implementation type|StreamTypeImplFacade]], which is not fully specified. As such, it is supposed there //actually is// an concrete implementation type, while only caring for some part or detail of this implementation to exhibit a specific property. For example, using an type constraint we can express the requirement of the actual implementation of a video stream to be based on ~RGB-float, or to enforce a fixed frame size in pixels.
 
 An implementation constraint can //stand-in// for a completely specified implementation type (meaning it's a sub interface of the latter). But actually using it in this way may cause a call to the [[defaults manager|DefaultsImplementation]] to fill in any missing information. An example would be to call {{{createFrame()}}} on the type constraint object, which means being able to allocate memory to hold a data frame, with properties in compliance with the given type constraint. Of cousre, then we need to know all the properties of this stream type, which is where the defaults manager is queried. This allows session customisation to kick in, but may fail under certain cicumstances.
 
@@ -3419,9 +3426,9 @@ An implementation constraint can //stand-in// for a completely specified impleme //Note:// there is a sort-of "degraded" variant just requiring some &rarr; [[implementation constraint|StreamTypeImplConstraint]] to hold
-
+
Querying for media stream type information comes in various flavours
-* you may find a structural object (pipe, output, processing patten) associated with / able to deal with a certain stream type
+* you may want to find a structural object (pipe, output, processing patten) associated with / able to deal with a certain stream type
 * you may need a StreamTypeDescriptor for an existing stream given as implementation data
 * you may want to build or complete type information from partial specification.
 Mostly, those queries involve the ConfigRules system in some way or the other. The [[prototype-|StreamPrototype]] and [[implementation type|StreamTypeImplFacade]]-interfaces themselves are mostly a facade for issuing appropriate queries. Some objects (especially [[pipes|Pipe]]) are tied to a certain stream type and thus store a direct link to type information. Others are just associated with a type by virtue of the DefaultsManagement.
@@ -3439,7 +3446,7 @@ The general case of this query is //quite hairy,// because the solution is not n
 We can inject two different kinds of fallback solutions for this kind of query:
 * we can always build a "catch-all" prototype just based on the kind of media (e.g. {{{prototype(video).}}}). This should match with lowest priority
 * we can search for existing ~StreamTypes with the same impl type, or an impl type which is //equivalent convertible// (see &rarr; StreamConversion). 
-The latter case can yield multiple solutions, which isn't any problem, because the match is limited to classes of equivalent stream implementation, which would be subsumed under the same prototype anyway. Even if the registry holds different prototypes linked to the same implementation type, they would be convertible and thus could stand in for one another. Together this results in the implementation
+The latter case can yield multiple solutions, which isn't any problem, because the match is limited to classes of equivalent stream implementation, which would be subsumed under the same prototype anyway. Even if the registry holds different prototypes linked to the same implementation type, they would be convertible and thus could //stand-in// for one another. Together this results in the implementation
 # try to get a direct match to an existing impl type which has an associated (complete) ~StreamType, thus bypassing the ConfigRules system altogether
 # run a {{{Query<Prototype>}}} for the given implementation type
 # do the search within equivalence class as described above
@@ -3450,9 +3457,18 @@ The latter case can yield multiple solutions, which isn't any problem, because t
 __Situation 1__: given an partially specified ~StreamType (just an [[constraint|StreamTypeImplConstraint]])
 __Situation 2__: find an implementation for a given prototype (without any further impl type guidlines)
 Both cases have to go though the [[defaults manager|DefaultsManagement]] in some way, in order to give any default configuration a chance to kick in. This is //one of the most important use cases// of the defaults system: the ability to configure a default fromat for all streams with certain semantic classification. {{{prototype(video)}}} by default is RGBA 24bit non-interlaced for example.
-But after having queried the defaults system, there remains the problem to build a new solution (which will then automatically become a default
+But after having queried the defaults system, there remains the problem to build a new solution (which will then automatically become default for this case). To be more precise: invoking the defaults system (as implemented in Lumiera) means first searching through existing objects encountered as default, and then issuing an general query with the capabilities in question. This general query in turn is conducted by the query type handler and usually consists of first searching existing objects and then creating a new object to match the capabilities. But, as said, the details depend on the type (and are defined by the query handler installed for this type). Translated to our problem here in question, this means //we have to define the basic operations from which a type query handler can be built.// Thus, to start with, it's completely sufficient to wire a call to the DefaultsManagement and assume the current session configuration contains some rules to cover it. Plus being prepared for the query to fail (throw, that is).
+
+Later on this could be augmented by providing some search mechanisms:
+* search through existing stream type implementations (or a suitable pre filtered selection) and narrow down the possible result(s) by using the constraint as a filter. Obviously this requires support by the MediaImplLib facade for the implementation in question. (This covers __Situation 1__)
+* relate a protoype in question to the other existing prototypes and use the convertibility / subsumption as a filter mechanism. Finally pick an existing impl type which is linked to one of the prototypes found thus far.
+Essentially, we need a search mechanism for impltypes and prototypes. This search mechanism is best defined by rules itself, but needs some primitive operations on types, like ennumerating all registered types, filter those selections and match against a constraint.
 
 !query for an (complete) StreamType
+All situations discussed thus far can also occur wrapped into and triggered by a query for a complete type. Depending on what part is known, the missing bits will be queried. 
+Independent from these is another __Situation__ where we query for a type ''by ID''.
+* a simple symbolic ID can be found by searching through all existing stream types (Operation supported by the type registry within STypeManager)
+* a special ''classificating'' ID can be parsed into the components (media kind, prototype, impltype), resulting in sub searches for these.
 
From caf7497021549f11ce2f98e0c51c6483c913fca0 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 5 Oct 2008 07:10:15 +0200 Subject: [PATCH 031/100] drawing to show time position of frames used in Design Entry regarding time handling --- doc/devel/draw/FramePositions.svg | 1269 +++++++++++++++++++++++++++++ wiki/draw/FramePositions1.png | Bin 0 -> 2478 bytes wiki/draw/FramePositions2.png | Bin 0 -> 12685 bytes wiki/index.html | 77 +- 4 files changed, 1344 insertions(+), 2 deletions(-) create mode 100644 doc/devel/draw/FramePositions.svg create mode 100644 wiki/draw/FramePositions1.png create mode 100644 wiki/draw/FramePositions2.png diff --git a/doc/devel/draw/FramePositions.svg b/doc/devel/draw/FramePositions.svg new file mode 100644 index 000000000..01cc14ca1 --- /dev/null +++ b/doc/devel/draw/FramePositions.svg @@ -0,0 +1,1269 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + style="overflow:visible"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + t + + + + + + + + + + + + + + + + + + + + + + + t + + + + + + + + + + + + + + + + + + + + + + + + + t + + diff --git a/wiki/draw/FramePositions1.png b/wiki/draw/FramePositions1.png new file mode 100644 index 0000000000000000000000000000000000000000..520788cb652835d95caa0a7f41688092c203f63e GIT binary patch literal 2478 zcmcImX;jkN7XKsWtfgh8d9}DcD@`mcN7Pb#YL1yh&UH&12^1B`l(d_fiZ7=UMXhYS zjzy^`l0|7IL*+n*f(=SJ3k6yZ_upIZ%lr1eytCFmXP>iw`>efxd#`oQWj`M`O*MTr z001;S++Fpce2c$TD44YhyJ5Q7gQafq4k%7NaPhh6K3SQ?k+=Jcx9aXc+N__#iH|?(vO)Do zT=U7(=@*9l&x&A44evL%;J;k-JgL4;hWIIeVcTC#sUEIc!n9g;NPila*y1LrQ8i0E zN(_%pwLBm;@V8~#RV!l~XVq^vxSl4|nWjQuFji5;-P~N|1HRhY>*K3oFv9`lVOQim zVqPx6Pr6Ba;rhgG*vA{~1M4)Nv%7&Pc(x{fIO(5Lw$e0>V!a<10l9@DOS2~`UBMIRJrPN)gUp4J zXQ#V)wylhT#~Ni1MN-A`NT+T#{C|L^c@#2&wi{)2Z}l$7RT)YdYq0p@gfqzFtv||#4|K&mtL#@U zxeeNMpR!RKr&CcQXHb}m;eTaFeqsFgLyXoLyjBiZD^Q-DSFK}WQ!nS1K8}Kl6yhP! ztB}#Insd*70bwA+oWuZv)Lc9=dZD*pkfwcK1!ZN}X2PH+G!wz%`R_)#-HFmqEC;0g@3ci8s;H6^(GWAxQDS04$|Jy!8dX| zw|MD;7#hh=)SAbgKwxzivvAy>v>Yf{{c(vXsa?7$m`txAO6O3aD|H>G~xuxwWygQc7;I(U3xQS|De z<2ad(w5)?%1#qm8DahPv@(n4B;+ZwrWhxHGllp>Vg8ph~Kqth-#l7(J#lYP|N{CMUxyFN`Yieo3j-gnp;aOks%fZvw!8G_&24l)4_DiPN^u zU_N+f6ND5#Yw_k`Cp!B9Dl+rW-!I7)st$XW@00$x`S5Id`_gcRx=qsbhR#k0fNGPL z>(C)+lV`c*3&-Fok#?iodOLnQPo4@Y_0AZtzUGiQ9vnp%U-Z7O84DoHtbxdtac6O~ zjkuki=+vxZ6OHQ2>Y?K7KV5B7a5pLO3=Iv{uc)Zd2@DJj2n>8PFi;u`=Jm^xXa0=+ zPpBN%n1u3DoLxU>aoiWb#kYy@CGiuR0A_;h{J6t$d2Hq8q&*m%eQUj~z{b)}L@aSy zTUfpM5D0Rl?@4fhewms1@ce;G{ki0jUTGSd)KWiXCP$J*V-gkFhFWqVwtWYqX@Gci z{Uv_zMg#XJEVhg?+=;qc06(sI#oc%UC9|p3-?nXI{uT>nAKOkf6KcU44;OPQyO+q8 zrxfNrE$#gdYIS|*H4wA=tM2~6^1)Ysl$(oU*zXoXq?~C+w52pMJ(VP6;C(uuvOGzy zu%x&)pCIRsRboF z3xN@pd5MrT&JjEy4i1y-XCHL`Qd6CXb$Wrn;kv^{PHE1JFibE)u6e?}`}BhHH~Fq8 zhaJ-+Z=-~vjcrIV2ETPv!{lJ?&mG9BrcL`NR!%=?zczRK2w zDZ6fRJ~Krr^Gw=zTIck8*`AFi=ZqzOyr!La!L-HPiy7WNqGSMKG<5@-4m2WYs$J;Q z*6js~*gA^C1|j^G5is)BS7?q(3(2xg>c>Evpd~Ol2Qb|JZb6`kR6<5`ZBgv|+jdSf-j_*d8DabtN%;v94aT3arYSu`+0%wcL{^FJ5`S>+=DGQk$`F zq&~r#_k%u6;lF;DIq3e_eLBA716t5nwtP7#1eb8X#pEn*RLZl};p3q-l2UwB%xPsug$^s%D@-aC1-iVxB4G7h@5aPR zP)-UK9b<@}MUpyS;wv-nNMpGpcgEd8CHxvDL_PS5+KHhzY9ofi@R{(4g&xA?0>2MC z{5S{A=BYUN=$s_Jy6kEFr=SyP?zDhf7Z#j%)-}ie01xy!>OD{Xk;2W$uTYXf`F6ql zu)p5B=9pCpBK0=w7*yywEPpP>3ZE4R7$ewmJlvm_Q(Jwp)X%Y8r!P6j!6w}uUOjy~QTTgw-Ke=ES_u#an_^NH-g0gj2%djJ3c literal 0 HcmV?d00001 diff --git a/wiki/draw/FramePositions2.png b/wiki/draw/FramePositions2.png new file mode 100644 index 0000000000000000000000000000000000000000..8eccf3664ff2e323c33d53e8988a016901753c22 GIT binary patch literal 12685 zcma)@byOU|x94#U?(Uid8C(JhB)A0&?i$?Pf(8xl?g0iF+!J7M4KTO{A6x?gw)1=Y z_PqUP&vL4JpnIzN_PtfNs=uG+tD1@|4i+UA0s;b#yxe`v)C&4JRviFH=`b1TQZyE?Y-C zH*-^GOD-o@>+BP8N(2OY1o`*xG`(|;wn#a!q21U?1j@Vec6F^dFMdT;)bWtG^w zWNQ*NLkuc5+C6ugTVExg0uvYQjqU~@-EK15Ny#xZGbLu@RWJGQB+s5tP@Bm_QbI?< z1XY8RlGH~!QwMO()i<5n(a>J8yPS3fT0tnP=D^@RL}yV&G;ltozXl8=cWGN0z}@^- z0JtR@GmMMnb4A|pk1$ohJIUcGV4{f<`F&B_%H&yrnRXTR!xE3&6mW9VA}qwiVaW5f z*hnVAn3M@25(GbEvBPnso34BPGoi3DX^s`2N-{$@F$veNDrCrx8k6|Hrota1o^%;_j!540@It1ynLv%QrbT}Xj4Yk@i zR+p`Tdzv4Bh$bSN)?@5-LbJF!lGE?o4-{DTRaoQ>?xXVSF+v8-224Tbe3`KyGU~F& zbd*`)KO4RLJoD=vX?29K5ra|qIi^eBClkhX9r@loo;^}<$lFl57&3uv`>$W{Dl-+@ z_BSkp)Y+1T@fnbr-SQ%}GT6tnK35JXWX^f#9=V&3K+FI26@-Y7$142`c~K2My9N(m zUY__WWhhO=Ary9pY_C{h8&$cvBiC7P?;Ms4WZ)ozVgN3=Q+rbe51NQ?X58(IV{MF zCuBtouiHJ$do}cojH@$9i1ItfAs#-z`g;4~#$S_e*q9s??C5MX!Y?|YyJ>qou~(Hq z!}VW^wb^BUOuSF=>O*YqXGB&G27E5tF`BXMs$uO_1S*R5=V%S<@bJ+9}Sz`)4n5FEU`!TrUi;fp{akSBNTGe+>}~9hy&Ad6F(9XVEt&FuL*jl`f#% zGVqhJCH=z*NIWg^r5tgzzwo|ts$RO#HG&YbkdR=@7?fvPk!M8V8N(ll#>@-xh4xO4 zH$~s1c#&2sQMj)?ATLc*FnnqRRj#%9YWs`TGowSH498V-?VYxMM;B#PyqxJzBnw#7 z;fbs3D+?#*a74Ku9>Y+wPQ|XnxC6;hO^a@bn#eAaO+I9d48BAwmLE0_$gMs+W@ciMO-;Et zju6SwGpdQzaFNTzU**$J7n0w=-1rJOe-cp=Jxzqv|F`)h^6C?9T3XsR<=}}^^swyv z(KGj3N6}=LF{!iRXubGz?--i2Egs9Ck6JB2xE9+x54L*;`MPqKLA~t-2^~uX5y{ZRJp^#jxpi2bK~mJN_I}73GoM8!?ml1(dd-Y($e*U-vTr%ZrSvBiV*U`~ipv}u4MjRsGGDKt1;iZBE zydqOQrgwre($vRX+a(POa}iEhQ!E7Z zCO@;SB~!J<@@uo8!)yF@UnJHNP<*(lP0X2x%o5UxM!&N@MhQhSxiI(`$u;ASAY+;& z;#TIVNMNAzV*apxd8D(?^-?bfYrvT`&gVwMs{TSX)gwnu??+XLkwjF4_sidVUC!Uk z6-RaTv_twzl-wK6sxduZC@Lsy7$&1c(&*3jAI#y5xuy}bNQ9d)v*!BTY&R|4nO*a% zysEPBD2S}7$M|OyCc2KE-Vc}39UZM-shH!q$rh0dll(-MM%^|qP1Ce+;>t3-mGmy* zSHYXk|vG<&HPm2CJlp>!s zx18(WVB1&D4D}N?{UnzRk$UP z)cAX*O6s@@&>@73*=|qPMxb(PZ=#8!e0?^k-{pSS|D>eG8qgfTyxYDq=F#?to^osM zEq91}^q#Mn4i$Vm<$`m!O?&|Nysn%v7n-M%?Ec#k()Klr>T?jV?3Ce<~?SFZ!FBXlKPDNi)oD-UG6Z7 zsz-~4EyT@C_uqi}uHGE_-WoJ9vW9y$0%yNF(Cd9}q4LX@MZZqhxi7uBP*%>LnHi?@j0+xh$`4 zQut(*jl~${4Xu@@2K5Ui_&Ip7e*hy>K`o5OX?8a z2|_Co#eF5Hj~KOy8-M?QO}Vr&sROj;3i<-=T_Id7R6h}o@NNiU{Jl1;o}YaLN;wC> z>>%|Kljbs-*sL2x>^V)%2Q!#RSo;mm|yUVC^OOmIvmCMQ+?tIBZtRk8nDvR zwCb2>cXFMBYwCIE-b?%A<9xJ*K4kzN8gOVzmmCIGYN*=g;=AJ8G z-$$w3)px@vV0$c!nMSrEe|${HO9C45xDi`HNI^+Tg7?TdE!qH4bY)1&#cPKCnqJhm z&vDCIQM>&CzHA(<3}_A4`QU1EuX(xUBGaFl?#=oYbiwK|slFY_q8*{Yo-(_becT6F z@mh1flLblCUBNO!r!!5!qkU3d91v=j49#Sw0p|A#e*zf#dywgdyMwy$-&p3M6Cf&i zwPu_+p97PZXp&1alo3dj?q!5wAX}--tGCjw5PZ#LxURH^x?|Hvv*ry@=HOi2--B8F zVz@HPEydofL$lhcGidO@DsMDY`MN<}39%#vvw;2=TsCu$p=9lZnw>5sm^+o)%nTTW zK!yOy2Hk~jQTrdZg2~e?9RC*WzMspNcb{7Spfl!XJ*2Iw*ul8e z+f{hFf-PQ+bak}gP77kbiyNP4wDf|T@II@jj!*E?awEta7W3I! zJ{fO~z!n7~NV@-VM2!`QeK} zkS|hUs5uWJn(VPb4{xQqSH{ym}*TMY>V)d{W@? zC@EnM23z+$tSnDsO_mQhS!v5|aa_HB&0%Ss7a|BEft00T$6G!;eR!AK>YHg zEnd0CZW=`KN}DQQY+FC)=74*TN%j@#Zk|5a1Qw4sEr8R}Hz14OJwoA0zd-jEsll4z04X}WB97EgK{t8_JPmC262{G2vN z6YzI&Derj2_d)CGdPQNXC-Vs08h841_Puj^xy^y-cICc`;oR^p)cE5^t@Ql08@$%r zd1Hb&ly?}MRflc+Nk6YnI*wuQeb@H3yk7Eh{AVXUAtsWVkF4=k2S0=?!5_X{HOQHy;+xSp_oOsj2fGMU$8W0&Z-(`V zU(agH8Pz5R`0wR<315!!wZIqZ&FfP@g7fTQ_}mC|$Y^9a;lZONDbIX*x!<#FVS%^6 zT=n~_h%#Z*TYfNL&J>x%PWD_(R_U&M|0oBP;^IK1}=iycZTCUEkPv(MC zs~tjp`$U=@vw?d&&o&MU+IY8L{@sc)T|knbvuiJ}Tk`Kh zbauC<(MJe;%&q&jYLNEcP_TP1wKd&zFQYrJz)u5SH*L>Q zv2GxKPp5OY+Z;8*1<*sX{E-#E<=V+abqS8J4BXBiYv9C3IAU77KuFr0KK6@ewlPJg z3{Rr7w>QVxF(`51}G+ef~?Qe(W1(}(k$DN+3Uvm>@vpzsqPfYvxaF1}i8aO8* z#1-6A8)KcD4?=jBkSIjoPoi~UoQFQsz;t#6OH z@irVr^?)p%!nPm=yLQp-T9t|_569obV2H4I=;s}zhS>E*;QWfLLJ56G`daU|os*Ms z-_$TX#msxK0huby#5iuO7D5Y{UF{=lAX<&Jl(h2uohgsjHZMt(!~cOH>M@cHiunL=clOt>`< zmmF6gHX_VQl`|bzq&XKeC(T@v{5TZ6s4CvZ|BPKhZTid_+mQE|d*s{&JYPq+PNRu8 z(&avRe08ZA?^Wet?KErkLDJ`SOiOfk9q>j}laTUX4w0mJYu&o*)RXhixH zEtbl%)rjtFK>V6e^TUuyi4N=eYF!~>{9d8piFd|1P&t9|35`=b z^2&%GzWUfx517(8{J5Ry-j`DiW@AG_cSR4u`WLa|Sk<(ieb=NFx6y^S;4rPn^VO{K zJPIZc{=fdGl(Jn$8z)FtMneSaZ+s3jd6M8E?|cK^DkA#6blb0C=jq-MKCGcG+Z(J9 z9+p)_2%`1u4%|p|nfK$T>oQ%sr1+e%+Uvy2S#%>}B*#G@h0(J7c)hf=#BG~3zr42g z^j0+2ND&c(!3t@8fc@E@pjAVmZT+I|gF_>4=&^0M zS;K^>m`2I_Z4TAc$m*)sKJh3ueo$y@=jl3f4Ca20bWvS#?oMf0lf*p_pkN|7D@eIW zMY^8o7hV^JI`Pu_8bjp2nVqS0&uPfBLq`PD1^KcH3Z=R zWmJF({)wIV;a%olisfi{FX6WbD#f?KcVr9_;^%4~O4XD|G@Apk82jfzQ!T;l=sv-c za)lw?w7dDtmhn#$fIQE}xg)|d9fYY#yCD2SE;E{_u;!p35~#?aIpP-0(4Xc*zm6gj zA-@%lvQ+q+oa5;7q^VSmTIIjx{6)|Im*g)Vi(lmM72n}9nkG_;mqcyX$NOA1)|MLp z0wMq1!v6&X{(neZ5^d9`QNBG5Z) zVCAH`=6RMbnqvLEtU~3jd((4ypRT%=p7!~r*&rWg;%aV3AZO`{F8nPnE76kpYwe>< z<2R?W#`z)-75_m7=d}qR^8F6G#cH&d8z2*Z)?j;Ml4!wH;8&%A_tcX<>)k$9iPAY! zo%b{OM5=FmA0D-<95(k%JC#>S~W_5;d6D8O<*8RW#0I(Pk#7JS^| zntOmLq8my=2EMGGXu>WLT30QRnZo==M&_<5nP?MQ78s}rHUEpO{BKTxs;uxclV9GD zjm1OV*E4acz$3R2oIL9>1A6#=#9S&P>KBWTMD&jlpk{>i<^(tqE*`(oqjT@FR z3RAfX_^?KT1hQZ@I|;$$VVyABsr!QC2RNVUXdrl9T!3Smd0)NAa{UO@k^All+3Mw2 zyZ`V3%ZA#;50m(?o3h~0%&Vw9Q@+d>d`$~ydcY;CQ*>*_TvJTcIbewYuoAiM$?7n< z*fwwTScbW=_f8icHe~S^7XB3u^&U^=xn5j~-m_WBg1z@xnhS6GlYPey{hemfx*7zH zYQzG=N?Qf}Bi(fVROAhu6 zjI$>Vm7u3Jf~z$5c(CMs0ts62rT|G>5b-F)V-ePpTFA-D=$GWORAkybz;sorA$>Eq zKt1M}Hg)-QKP##I#y4btLHBYvCdhNUUY3hPy>S3|>fGiRtAvQf(2RtY;a@5tJ0Zse z7ehu{8Xg(}yFUe!^cDkJ`aM>(dLeso7`UF7aBI~W!PwVHd-i`~fs~B6!Od_vxfuVm z_(=c^X#5W_Al)ks$ndx(ymjtV4H&|&JN|;}+jc}=Fa>-Egz4&y3XP^>|eVVb@=%vkF9zMx*t;ns# zKr4uMXc39D=>9}^RsaH_-1rcFK|dvSVkfSZyv&DgsQCJJE-xuwk32O~ZKSittTj62o z)3NEi{^BzrZgQqp3foZ6bpPWM5;lOwt!P4e=JZxf=Ffg;FFMd58NeDAa4nUhhZUKV zO)Z_!@lF;e!0%s_FOHRS+WkqlmE|#}DBq&jNRhb!+SuxS78Gn*!TO7RreQ+sEat2W z+z8I12at@jix{4kmgV&hb;1CR5(`j{`>oW?SJ`oKK6L#8$VMr!t$v+ecoN@uQ-Ih? zuwZl(?vx|$$_5(PjN)S9zVSG>pQN2p|EIZjuku7{j8>((aN=?hZ8_Q*u9aA3OT0## zK$=I=iVq)r?YH)Mha?EE{_%=Ko0_)2@kN5?@m9?@ItadhSwlRxwyH+zyXYdG!uw`x zyVYluzm-4-$Oi$-TaMbiHo^UEKst>PH;U)3QNtTGm6HWc+Vhd8g@En?4?P$61cS0|GjKwO>&})?WB0kfW9F92dbCOO;8BnxR(-k9-f-|iI3QY z7_H$xh!i#^u>iWi=8fYF!7u(i_}Yh0ppakoyYMWE*(I6*T*bnLNO`-wM?f9VF%%13 z{YqYi+yz(Z_a0s!&n}cuxzcut?ND-6dMZaiz<>JpEM9 zL^GOekm7xpc?H-J+BX0@v}$0YwFLMB*y2migQzaul}l1fbodEq&d>?z7b!NRp(Qj0 z4A4Ah?eP~mR$37?8LdhbmvC!sPm|?los3V9U3W9`+BcqcK*%ke1Z2~^qiKrF@Y_>5 z3HMC{rpUSd3OiB&2bvOmU(w^O&ve~goD@%wY~#YqW@IqJyP8T@Iaiu=oJXU{Q8y~( zq-RC=__~kpjo(6Ulqu<#U!0$Hi$2eiB!_X><(a(r(lKQ?@{xrWz(0WaJCmz$X7Nc3 zP|PH>jmF(0s}@XY)BZW6%o^|G>(D{79U#Jongid=2zg7#A#}<3)Z70B3+nO#`5Z{A zv-*Tx*`a{kpJ`kK4H4IIXCVR@U~jq#V=%x6L>BdHz%5&9 z7g)|n&NycfsW9A^fTI5ybUxjn5Pz8hVW2h%s7T1u{9^6vxs9_RT-f*ph{D+SufJNS z@|O$%d=Y|G6*s9pSM_udEgg+tgxDvHxJ&lkODD@(Qakx8pbq<&H0I39ee-xn2LKqY zZWSZ!tA@tvFXrM#)!%o8oJ5l`^XO8R#Jj7LlDo9NBZqE%V+<2U^fsF+`xTDg)vK&N z^73L@yc+Nn1pn2Iw+M85C)6fN;2j+xBL`i1T*~wgCaH7BtnReFK6H&si%Q$n3c@>; z{eoOMKB=Xwkt!8!cFqzTGH>bWVv){=Xqgwz7>vqN`ih;yQt{Q#tb&9IiyR>&iFp+N zF&7`5t#go~7FV2{9!!_)(A=;tA$ArZZRe#VIq(|w0s3gO3#tOljJWfP^%o@}9hW4U zyCO(#hK>Me0tjO#(akT?m^v0xE5%o_u+Qf8gNnr+N^!qaJ|LZjBX^SSvwXKi$T+&F ztM1Hlt;+hP`q7{y<%hkp7`ec4I_dYyu}g&iQiuuWK!5;$;mG`!K6k6M+tKLy)>%`Y zLs5Ju@_2(JE5$w*O_vT%mBHOLaq@e6M}S{gGyI#G8GTpF)$l&(z z;ftgRQ>jWosasl?E*+ovTb-!A2>?>aU35^3oY`DxU_<`CcP)PuQH)j9$N1 zaTxqQcD$YkKp#No2S&GDs6=muIv~~mD-$OLBcJJD_O-_qEUDQ?Wjib7$Uy?~TvI4g z3hf%003ra&4fFPUP^RhLZ&M&+iKw)Eb}h+Bk>lv$4!iT(U|PJbB`Yc)yQDWGG&Av^ zR{b>pk8`~yEo7o77fbEUSJ_l82VSs1>19*`vNeDf)c%7Oe&hP?3d#2F-#)*1k@xd6y;S#<*h*~ zvY>a?pm@n#GcQKy$$R@DYh@__S#a>`J7>Ob9rJ@Jj*(JZ5m6W>C5ZxX?@s*b433S>xbt zz}0w?S<5Wt4n=`rydQ-dH|8%Lc%tXT?DV4D9ROfdd$#iF0c(Jq!Yoe;AFEsBm*Jwdxz?Q4>%mflnHysFIbHm?9dK^ceOlBqNQX%=UfL3*Oh# znlRuEA7*}<7=SCV0+Bw}Usr7!EWS;QrQ3X3(aoQh8FKxE6jQBo(WGqn3!hbEZ7*A2 zl^!}glxh^>+a8Y}n+-697ei8m)6`{=De6?{udxdfSOl?ye;tSy78Y*CYp95nGSVg- zx$R8^cpc5xtS749>{3MGv?2=A)L}9d^;)WrL|#mfTFi*gT<8mSUW4>lL+7maVrvb? zBGf1j;3i->UlZc@XS>NEYE9!Lrc@RE5xuJc4< zbGK2e+J5-qi}Ws_kHEltxVGXoRqmQwEm*0$bE}L5ko8AZBzzC71;?_+&%}NfDoU^^ z`%vuV-PEi+K8#{U-oM58d}Qsqi3cti(@%}0gxjt|-?SLW&`-t4XH?`0RylX+bF&ej zh2YQ5PHg;C1o!G2<)$0$<5eaN=^7aIT6z z`CY()#)%53iFgXcd>~U~}BnpZ5KuV~gz$JDYB})Kc$TyTrr?Bo+f-wp7mwv&sP%Ngv*zbnpjw~NiCsS?Iy-D|jlP2laNQ7%SG z%sAai*zyl2@LyVep`MtYTB;ypp=>?awEtqb&ynGCRgk6rvLEv8Xe8D8R{KjXF7|E* zhf^Gbp7HFpt@crFR_cocU2d_6UF=?Yaw{Ps9kfp7F!IZu589_J8^k8Qp1NqAISEFR zi?c@oy{aL%;rMo8_~}>-oU-?^wt(-w#Q*$GZZbMu``VKBN|zDb^K`E(ARr(~ZHF%v zmCV~Nh2w;>j~cj?KTG=>01goIWmeEZAq}EgJ57^3Q_0m=Btcj7q|ms9^Rgqu-M_ZnB8|J{Em#BGzv z_R;adkmBipRs!Mv(V~!qap3tI=fOFV>%ZNOw1($B=JR%KmstdX30$-RXDtBB*v~tX z6<_z?0tkeSZ~QS|@X_Ve1C8H91)h~C&kYgnh&lW?$_vSvs7@B+ycK_|+P;1lVXJjJ zez`mF@m{x2>&p-N7}D2=4giA~oyrSvT{t>(xC{wrLP@z^M);)!?gZPhkP&QJ-J{ zL5#k%BSIF#(-CCfKVCbYZ5+e!_3UbBmyq~PBoZGR7P{*^^xQgN=I~AZ`EKnl4}A?i z(0+dr?(3l}?N5g|{mgj7@o;jua4=#qBjWZTm~B{9nawMw`od@UoWvczcrsGrcBJdz z+2y!YU9phgTNeNfpEQe^N`fsno9kZ*QM~(kqu0w}ND_+qwMQy319~q@|1Qb(M2?^Q zV-9ig_zP$2GDz^Hr$V+j>i(XQg68vy56ZN7Jwjgg%fIEzlb8<2#m(M%_jh>Nv|^Y% zq}{%$)CBEannJ{y7Tw4qA|GiVR+tcjYMZLe2XV-eomZqBFHsiI3_wbIZ;jkuN_Xht zT8YUp-A(VuHa>qWa71}TsKfFm)nTEeqFP?_JMC)gOIT`lpvu4NXER!8bKARq(Iq|b z4+lwL{>5-5E&me|gf3M)g;=a~lOG&}==xZ|u%Sl}`tpBJ#9O+l&U|lI+b1?2_01L5 z0!x(KM6*s5@=9kgj<=1Z=;IOLcBCNkbKFOve&ITBMGoDgA+JRJ9}c*pVf!`I2lHNo`axbxzNX>5pBf627( z{Mn;oF!Hz}Et;bxpyhj28?=E~B3+*T?0JdhPN*tyP>g=rT=H8GGrQcdG^F*N>je{B z&F>a^y?`o98Ym(^uGkyZIF+H#Uh;kSb3F9AJ1KIl$?y6`WW9E$ z5Egr0fCIZk-UI5g;L|X4`(JS_C#6xaX&*J@ zbg%Gso&0O*rZ2fWxBQ8|$fhVe7Gs`V%OXQ!J4DwYo1S#4fVe|5{DP zQt$hm&45{u zIM=3ta?8^Yx^Z(t&ZofN)VmGd+J{~<_DZXdkYWGo*pd-G9fZC)uX0lS(;I*a^}>aA z@_gLD1I}K|jefp4V&VA@YY6!`@g&Q!V~lr}h(0jRjGl1im&Yp z^C0lsE=YrKrpt^NUsbs&`8fpjFc;S!bvq)kM6IiOcf8jtWRE9H>J7{7FBwA%noqpp z1V!VB{!t(MI6}14Cmsx3iq+X!aiuWCWPF~s)kjXI{bjC)#l-KpUu>f=Enn&~EU9pt ziDM0fNhxHesIQ6YZKD9#-~wZM9>E@(Vb#>5{jslt!kB%hvr~3Pn;q90(D@JDUdu#= z|4`-|BX`&d)J%yYj^+qf@KG@hvk{}vQ9ilJA}nsO2B%!g!3bRVMaQkuL`hP-9%_p>98vfVw6Q9fsnmCP z>d0%~T-OG1eNC_ih@}8T!YVnqKQEfK4ttTq_ivd$5$rm;VJl6Z|Ux literal 0 HcmV?d00001 diff --git a/wiki/index.html b/wiki/index.html index fd3fe210e..89790640d 100644 --- a/wiki/index.html +++ b/wiki/index.html @@ -802,12 +802,14 @@ for __Running__
LumieraWiki
 ShortCuts
-
+
* There is a [[Manifest]] explaining the vision of the Lumiera project
 * The foundation how we work together is defined in LumieraDesignProcess
 * There is a description how the git repository is set up in RepositorySetup
 * we decided to write code in GNU style, with no tabs (use spaces)
-
+ +!basic decisions +* TimeHandling
/***
@@ -4602,6 +4604,77 @@ Thus no server and no network connection is needed. Simply open the file in your
  * see [[Homepage|http://tiddlywiki.com]], [[Wiki-Markup|http://tiddlywiki.com/#MainFeatures]]
 
+
+
/%||'''State'''||''Final''||%/
+||'''State'''||''Draft''||
+||'''Date'''||[[Date(2007-06-21T05:12:03Z)]]||
+||'''Proprosed by'''||["Ichthyostega"]||
+
+!time handling
+how to handle time values in the code and which policy to aply to the "current" position
+
+!!Description
+# Representation of time values
+#* we use an uniform time type. Time is time, not frames, samples etc.
+#* all timings in Lumiera are based on integral datatypes
+#* we use a fixed, very fine grid, something of the sort of microseconds
+#* the internal representation is based on a {{{typedef int64_t gavl_time_t}}}
+#* we use a set of library routines and  convenience-methods to
+#** get time in different formats (fractional seconds, frame counts)
+#** calculate with time values (overloaded operators)
+#* time measurement is zero based (of course :-P )
+# Quantizing to a frame index or similar
+#* quantizing/rounding shall happen only once at a defined point in the calculation chain and, if in doubt, be done always as late as possible. 
+#* values needing to be quantized to time (grid) positions are calculated by half-way rounding, but the result should not depend on the actual zero-point of the scale (i.e. {{{floor(0.5+val)}}}, thus quant(0.5) yields 1, quant(0.49) yields 0, quant(-0.5) yields 0 )
+# Position of frames[>img[draw/FramePositions1.png]]
+#* frame numbers are zero based and Frame 0 starts at time=0 (or whatever the nominal start time is)
+#* each frame starts when the locator hits its lower border (inclusively) and ends when the locator is on its upper border (exclusively)
+#** when the locator snaps to frames this means it can be placed on the start positions of the frames solely
+#** when the locator is placed on such a start position, this means //always// displaying the frame starting at this position, irrespective of playback direction.
+# Current position for keyframe nodes and automation[>img[draw/FramePositions2.png]]
+#* when parameter values for plugins/automation need to be retrieved on a per frame base (which normally is the case), for each frame there is a well defined __//point of evalutation//__ time position, irrespective of the playback direction
+#* there is no single best choice where to put this "POE", thus we provide a switch
+#** //point of evalutation// of the automation is in the middle of the timespan covered by a frame
+#** //point of evalutation// is on the lower bound of each frame
+#** maybe additional position or fraction (?)
+#* moreover, we provide an option to snap the keyframe nodes to the //point of evalutation// within each frame or to be able to move them arbitrarily
+#* when keyframes are set by tweaking of parameters, they are located at the //point of evalutation// position.
+
+
+!!!!Tasks
+* figure out what has to be done when switching the "current position" policy on a existing project
+
+
+!!!Alternatives
+Leave everything as in Cinelerra2, i.e. show frames after the locator has passed over them, behave differnt when playing backwards and set the keyframes on the position of the locator but use them on the frame actually to be shown (which differs according to the playback direction but is always "one off").
+
+Why not? because it makes frame-precise working with keyframes a real pain and even creates contradictory situations when you
+switch back and forward while tweaking.
+
+Similar for the issues with quantized values. At first sight, e.g. directly using the frame numbers as coordinates (as Cinelerra does) seems to be clever, but on the long run we get lots of case distinctions scattered all over the code. Thus better use one uniform scheme and work with precise time values as long as possible and only quantize for rendering a given frame.
+
+
+!!Rationale
+The intention is to make time handling and calculations as uniform and "rational" as possible. We try to stick to the precise mathematical values and let the calculations just yield an result in an uniform manner, instead of sticking to "simple" values like frame counts or even a session-wide frame rate
+# time and interval calculations are tricky. Solve this question once and be done.
+# rounding is always dangerous, rounded values are not the more "clean" values. The floor-rounding rule is chosen, because the length of an interval after quantizion should not depend on the position in relation to the zero point. The usual mathematical rounding behaves "symmetrical" to the zero point, which could yield a different length after quantizion if an interval contains the zero point
+# this is based on the analoy with real film running through a film projector (or the usual fencepost problem)
+# while using the actual position of the locator as the "current" position for keyframes seems more natural at first, it crates problems when mixing footage with different framerate or when using a low-framerate proxy footage
+
+
+
+!Comments
+This is the summary of a discussion cehteh, Plouj and ichthyo just had on irc.
+ -- ["Ichthyostega"] //2007-06-21T05:12:03Z//
+
+We use Gavl now
+ -- ["ct"] //2008-03-05T16:19:22Z//
+
+I've tidied up this old design proposal, we could make it final now. I've changed the rounding rule, please check if it's OK. In the original proposal, we  wanted to use the common mathematical rounding rule, i.e. round(-x) = - round(x) . I changed this, because of the danger of interval lengts or alignment to "jump" dependant on the position in relation to the time zero point.
+ -- ["Ichthyostega"] //2008-10-04T22:47:54Z//
+
+
+
The question to find out about is: how much of the coding to do with the help of BOUML. Basically, BOUML is capable to permanently support the coding; you can define all entities, fields and methods in the UML model an just develop the method bodies //conventionally// with a text editor. 
 

From 1724e019ea87963a2091204a368bd8d52d9e290c Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Mon, 6 Oct 2008 06:17:40 +0200
Subject: [PATCH 032/100] related it to the ConManager and the wiring requests

---
 src/proc/mobject/builder/conmanager.cpp    | 16 +++----
 src/proc/mobject/builder/conmanager.hpp    | 17 ++++---
 src/proc/mobject/builder/wiringrequest.hpp | 54 ++++++++++++++++++++++
 wiki/renderengine.html                     | 30 ++++++++----
 4 files changed, 93 insertions(+), 24 deletions(-)
 create mode 100644 src/proc/mobject/builder/wiringrequest.hpp

diff --git a/src/proc/mobject/builder/conmanager.cpp b/src/proc/mobject/builder/conmanager.cpp
index e32ecf92b..14e20a788 100644
--- a/src/proc/mobject/builder/conmanager.cpp
+++ b/src/proc/mobject/builder/conmanager.cpp
@@ -1,5 +1,5 @@
 /*
-  ConManager  -  manages the creation of additional ProcNode connections for the Renderengine
+  ConManager  -  manages the creation of data/control connections when building the Renderengine
  
   Copyright (C)         Lumiera.org
     2008,               Hermann Vosseler 
@@ -22,15 +22,13 @@
 
 
 #include "proc/mobject/builder/conmanager.hpp"
+#include "proc/control/stypemanager.hpp"
 
-namespace mobject
-  {
-
-  namespace builder
-    {
-
-
-
+namespace mobject {
+  namespace builder {
+    
+    
+    
     /**
      * TODO !!!!!!!!!!!!!!!!!!
      */
diff --git a/src/proc/mobject/builder/conmanager.hpp b/src/proc/mobject/builder/conmanager.hpp
index 3cd75cc6d..1f3eb23b8 100644
--- a/src/proc/mobject/builder/conmanager.hpp
+++ b/src/proc/mobject/builder/conmanager.hpp
@@ -1,5 +1,5 @@
 /*
-  CONMANAGER.hpp  -  manages the creation of additional ProcNode connections for the Renderengine
+  CONMANAGER.hpp  -  manages the creation of data/control connections when building the Renderengine
  
   Copyright (C)         Lumiera.org
     2008,               Hermann Vosseler 
@@ -26,17 +26,20 @@
 
 
 
-namespace mobject
-  {
-  namespace builder
-    {
-
-
+namespace mobject {
+  namespace builder {
+    
+    
     /**
      * Connection Manager: used to build the connections between render engine nodes
      * if these nodes need to cooperate besides the normal "data pull" operation. 
      * Esp. the Connection Manager knows how to wire up the effect's parameters 
      * with the corresponding ParamProviders (autmation) in the Session.
+     * Questions regarding the possibility of a media stream connection are 
+     * delegated internally to the STypeManager.
+     * \par
+     * The primary service of the connection manager is to accept a wiring request
+     * and handle the details of establishing the necessary connections.
      */
     class ConManager
       {
diff --git a/src/proc/mobject/builder/wiringrequest.hpp b/src/proc/mobject/builder/wiringrequest.hpp
new file mode 100644
index 000000000..1190daccb
--- /dev/null
+++ b/src/proc/mobject/builder/wiringrequest.hpp
@@ -0,0 +1,54 @@
+/*
+  WIRINGREQUEST.hpp  -  (interface) the intention to make a data or control connection
+ 
+  Copyright (C)         Lumiera.org
+    2008,               Hermann Vosseler 
+ 
+  This program is free software; you can redistribute it and/or
+  modify it under the terms of the GNU General Public License as
+  published by the Free Software Foundation; either version 2 of the
+  License, or (at your option) any later version.
+ 
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+ 
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ 
+*/
+
+
+#ifndef MOBJECT_BUILDER_WIRINGREQUEST_H
+#define MOBJECT_BUILDER_WIRINGREQUEST_H
+
+
+
+namespace mobject {
+  namespace builder {
+    
+    
+    /**
+     * A stateful value object denoting the wish to establish a link or connection
+     * between two entities. Used to organize the proper working of the build process.
+     * Wiring requests are first to be checked and can be deemed impossible to 
+     * satisfy. Internally, wiring requests contain specific information about
+     * the objects to be connected. This information is exposed only to the
+     * ConManager, which is the facility actually wiring the connections.
+     */
+    class WiringRequest
+      {
+      public:
+        /**
+         * TODO design sketch......
+         */
+      };
+
+
+
+  } // namespace mobject::builder
+
+} // namespace mobject
+#endif
diff --git a/wiki/renderengine.html b/wiki/renderengine.html
index b115d0ce6..624a36e3a 100644
--- a/wiki/renderengine.html
+++ b/wiki/renderengine.html
@@ -928,13 +928,18 @@ TertiaryMid: #99a
 TertiaryDark: #667
 Error: #f88
-
-
The Connection Manager is a __Facade__ for querying information and deriving decisions regarding various aspects of data streams and possible connections.
-* retrieve information about capabilities of a stream type given by ID
+
+
The Connection Manager is a service for wiring connections and for querying information and deriving decisions regarding various aspects of data streams and the possibility of connections. The purpose of the Connection Manager is to isolate the [[Builder]], which is client of this information and decision services, from the often convoluted details of type information and organizing a connection.
+
+!control connections
+my intention was that it would be sufficient for the builder to pass an connection request, and the Connection Manager will handle the details of establishing a control/parameter link.
+{{red{TODO: handling of parameter values, automation and control connections still need to be designed}}}
+
+!data connections
+Connecting data streams of differing type involves a StreamConversion. Mostly, this aspect is covered by the [[stream type system|StreamType]]. The intended implementation will rely partially on [[rules|ConfigRules]] to define automated conversions, while other parts need to be provided by hard wired logic. Thus, regarding data connections, the ConManager can be seen as a specialized Facade and will delegate to the &rarr; [[stream type manager|STypeManager]]
+* retrieve information about capabilities of a stream type given by ID 
 * decide if a connection is possible
 * retrieve a //strategy// for implementing a connection
-
-In the intended implementation, a good deal of this functionality will actually be implemented by [[rules|ConfigRules]], while other parts need to be provided by hard wired logic, at least as a fallback. Anyway, the purpose of the Connection Manager ois to isolate the [[Builder]], which is client of this information and decision services, from these details
 
@@ -3338,10 +3343,10 @@ if (oldText.indexOf("SplashScreen")==-1) * in a future version, it may also encapsulate the communication in a distributed render farm
-
-
Conversion of a media stream into a stream of another type is done by a processor module (plugin). The problem of finding such a module is closely related to the StreamType and especially [[problems of querying|StreamTypeQuery]] for such. There can be different kinds of conversions, and the existance or non-existance of such an conversion can influence the stream type classification.
+
+
Conversion of a media stream into a stream of another type is done by a processor module (plugin). The problem of finding such a module is closely related to the StreamType and especially [[problems of querying|StreamTypeQuery]] for such. (The builder uses a special Facade, the ConManager, to access this functionality). There can be different kinds of conversions, and the existance or non-existance of such an conversion can influence the stream type classification.
 * different //kinds of media// can be ''transformed'' into each other
-* stream types //subsumed// by a given prototype should be ''lossless convertible''
+* stream types //subsumed// by a given prototype should be ''lossless convertible'' and thus can be considered //equivalent.//
 * besides, between different stream //implementation types,// there can be a ''rendering'' (lossy conversion) &mdash; or no conversion at all.
 
@@ -4917,6 +4922,15 @@ If ''not processing'' we don't have any input buffers, instead we get our output Otherwise, in the default case of actually ''processing'' out output, we have to organize input buffers, allocate output buffers, call the {{{process()}}} function of the WiringDescriptor and finally release the input buffers.
+
+
{{red{This is an early draft as of 9/08}}}
+Wiring requests rather belong to the realm of the high-level model, but play an important role in the build process, because the result of "executing" a wiring request will be to establish an actual low-level data connection. Wiring requests will be created automatically in the course of the build process, but they can be created manually and attached to the media objects in the high-level model as a ''wiring plug'', which is a special kind of LocatingPin (&rarr; [[Placement]])
+
+Wiring requests are small stateful value objects. They will be collected, sorted and processed ordered, such as to finish the building and get a completely wired network of processing nodes. Obviously, there needs to be some reference or smart pointer to the objects to be wired, but this information remains opaque.
+
+&rarr; ConManager
+
+
The purpose of automation is to vary a parameter of some data processing instance in the course of time while rendering. Thus, automation encompasses all the variability within the render network //which is not a structural change.//
 

From 1bce7d4c38f991c10ede657d24d6532ed051520d Mon Sep 17 00:00:00 2001
From: Ichthyostega 
Date: Mon, 6 Oct 2008 07:26:43 +0200
Subject: [PATCH 033/100] define the next steps by test

---
 src/common/streamtype.hpp             |  2 +-
 tests/common/streamtypebasicstest.cpp | 50 +++++++++++++++++++++++----
 wiki/renderengine.html                |  5 +--
 3 files changed, 47 insertions(+), 10 deletions(-)

diff --git a/src/common/streamtype.hpp b/src/common/streamtype.hpp
index 28c87bfa4..4f79969d7 100644
--- a/src/common/streamtype.hpp
+++ b/src/common/streamtype.hpp
@@ -71,7 +71,7 @@ namespace lumiera {
       
       
       Prototype const& prototype;
-      ImplFacade * implType;
+      ImplFacade * implType;       /////////////TODO: really by ptr???
       Usage intentionTag;
       
     };
diff --git a/tests/common/streamtypebasicstest.cpp b/tests/common/streamtypebasicstest.cpp
index 6097da0a7..a2c1332d0 100644
--- a/tests/common/streamtypebasicstest.cpp
+++ b/tests/common/streamtypebasicstest.cpp
@@ -29,13 +29,15 @@
 
 #include 
 using std::cout;
-
+using ::test::Test;
+using util::isnil;
 
 
 namespace lumiera {
   namespace test_format {
     
     using control::STypeManager;
+    typedef StreamType const& SType;
     typedef StreamType::ImplFacade const& ImplType;
     
     
@@ -47,13 +49,18 @@ namespace lumiera {
      */
     class StreamTypeBasics_test : public Test
       {
-        virtual void run (Arg arg)
+        virtual void
+        run (Arg arg)
           {
-            buildImplType ();
-            basicImplTypeProperties ();
+            ImplType iType = buildImplType ();
+            basicImplTypeProperties (iType);
+            
+            SType type = extend2fullType (iType);
+            basicStreamTypeProperties (type, iType);
           }
         
-        void buildImplType ()
+        ImplType
+        buildImplType ()
           {
             STypeManager& typeManager = STypeManager::instance();
         
@@ -64,16 +71,45 @@ namespace lumiera {
             
             TODO ("how to do a simple consistency check on the returned ImplFacade? can we re-create the GAVL frame type?");
             ASSERT (GAVL==iTy.libraryID);
+            return iTy;
           }
         
-        void basicImplTypeProperties ()
+        void
+        basicImplTypeProperties (ImplType refType)
           {
-            ImplType iTy = test_createImplType ();
+            ImplType iTy2 = test_createImplType ();
+            ASSERT (iTy2==refType);
+            ASSERT (refType==iTy2);
+            TODO ("add equality comparable concept to the ImplType class");
             
+            ASSERT (StreamType::VIDEO==refType.getKind());
             UNIMPLEMENTED ("get a lib descriptor"); 
             UNIMPLEMENTED ("check the lib of the type"); 
             UNIMPLEMENTED ("compare two types"); 
           }
+        
+        SType
+        extend2fullType (ImplType iTy)
+          {
+            return STypeManager::instance().getType(iTy);
+          }
+        
+        void
+        basicStreamTypeProperties (SType type, ImplType iTy)
+          {
+            ASSERT (type.implType);
+            ASSERT (iTy==(*type.implType));  /////////////TODO: really by ptr???
+            ASSERT (&iTy==type.implType);   // actually using the same object (in the registry)
+            
+            ASSERT (!isnil (type.prototype.id));
+            ASSERT (StreamType::VIDEO==type.prototype.kind);
+            ASSERT (StreamType::VIDEO==type.implType->getKind());
+            
+            ASSERT (type.implType->canConvert(iTy));  // of course... they are actually the same
+            ASSERT (iTy.canConvert(type));           // because it's based on the same impl type
+            
+            ASSERT (StreamType::RAW==type.intentionTag);
+          }
       };
     
     LAUNCHER (StreamTypeBasics_test, "unit common");
diff --git a/wiki/renderengine.html b/wiki/renderengine.html
index 624a36e3a..bb22c2320 100644
--- a/wiki/renderengine.html
+++ b/wiki/renderengine.html
@@ -3431,7 +3431,7 @@ An implementation constraint can //stand-in// for a completely specified impleme
 //Note:// there is a sort-of "degraded" variant just requiring some &rarr; [[implementation constraint|StreamTypeImplConstraint]] to hold
 
-
+
Querying for media stream type information comes in various flavours
 * you may want to find a structural object (pipe, output, processing patten) associated with / able to deal with a certain stream type
 * you may need a StreamTypeDescriptor for an existing stream given as implementation data
@@ -3471,9 +3471,10 @@ Essentially, we need a search mechanism for impltypes and prototypes. This searc
 
 !query for an (complete) StreamType
 All situations discussed thus far can also occur wrapped into and triggered by a query for a complete type. Depending on what part is known, the missing bits will be queried. 
-Independent from these is another __Situation__ where we query for a type ''by ID''.
+Independent from these is __another Situation__ where we query for a type ''by ID''.
 * a simple symbolic ID can be found by searching through all existing stream types (Operation supported by the type registry within STypeManager)
 * a special ''classificating'' ID can be parsed into the components (media kind, prototype, impltype), resulting in sub searches for these.
+{{red{not sure if we want to support queries by symboic ID}}}...problem is the impl type, because probably the library needs to support describing any implementation type by a string. Seemingly GAVL does, but requiring it for every lib?
 
From 094ce0654d83d1892388a1c54789ca69f75306b8 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Tue, 7 Oct 2008 21:17:29 +0100 Subject: [PATCH 034/100] Added playback support in the timeline --- src/gui/lumiera_ui.rc | 14 +- src/gui/panels/timeline-panel.cpp | 105 ++++++++++- src/gui/panels/timeline-panel.hpp | 16 ++ src/gui/widgets/timeline-widget.cpp | 27 +++ src/gui/widgets/timeline-widget.hpp | 28 +++ src/gui/widgets/timeline/timeline-body.cpp | 198 +++++++++++++------- src/gui/widgets/timeline/timeline-body.hpp | 20 ++ src/gui/widgets/timeline/timeline-ruler.cpp | 138 ++++++++++---- src/gui/widgets/timeline/timeline-ruler.hpp | 23 ++- 9 files changed, 451 insertions(+), 118 deletions(-) diff --git a/src/gui/lumiera_ui.rc b/src/gui/lumiera_ui.rc index 02f6d90fc..a13ba209d 100644 --- a/src/gui/lumiera_ui.rc +++ b/src/gui/lumiera_ui.rc @@ -126,6 +126,7 @@ style "timeline_body" gtkmm__CustomObject_TimelineBody::background = "#7E838B" gtkmm__CustomObject_TimelineBody::selection = "#2D2D90" gtkmm__CustomObject_TimelineBody::selection_alpha = 0.5 + gtkmm__CustomObject_TimelineBody::playback_point = "#006000" } style "timeline_ruler" = "default_base" @@ -140,10 +141,15 @@ style "timeline_ruler" = "default_base" gtkmm__CustomObject_TimelineRuler::min_division_width = 100 gtkmm__CustomObject_TimelineRuler::mouse_chevron_size = 5 gtkmm__CustomObject_TimelineRuler::selection_chevron_size = 5 - gtkmm__CustomObject_TimelineRuler::playback_arrow_colour = "#2D2D90" - gtkmm__CustomObject_TimelineRuler::playback_arrow_alpha = 0.5 - gtkmm__CustomObject_TimelineRuler::playback_arrow_size = 10 - gtkmm__CustomObject_TimelineRuler::playback_arrow_stem_size = 3 + + gtkmm__CustomObject_TimelineRuler::playback_point_colour = "#006000" + gtkmm__CustomObject_TimelineRuler::playback_point_alpha = 0.5 + gtkmm__CustomObject_TimelineRuler::playback_point_size = 12 + + gtkmm__CustomObject_TimelineRuler::playback_period_arrow_colour = "#2D2D90" + gtkmm__CustomObject_TimelineRuler::playback_period_arrow_alpha = 0.5 + gtkmm__CustomObject_TimelineRuler::playback_period_arrow_size = 10 + gtkmm__CustomObject_TimelineRuler::playback_period_arrow_stem_size = 3 } style "timeline_header_base" = "default_base" diff --git a/src/gui/panels/timeline-panel.cpp b/src/gui/panels/timeline-panel.cpp index b079c0b2f..709323bad 100644 --- a/src/gui/panels/timeline-panel.cpp +++ b/src/gui/panels/timeline-panel.cpp @@ -42,6 +42,7 @@ TimelinePanel::TimelinePanel() : previousButton(Stock::MEDIA_PREVIOUS), rewindButton(Stock::MEDIA_REWIND), playPauseButton(Stock::MEDIA_PLAY), + stopButton(Stock::MEDIA_STOP), forwardButton(Stock::MEDIA_FORWARD), nextButton(Stock::MEDIA_NEXT), arrowTool(Gtk::StockID("tool_arrow")), @@ -54,24 +55,29 @@ TimelinePanel::TimelinePanel() : // Setup the widget timelineWidget.mouse_hover_signal().connect( mem_fun(this, &TimelinePanel::on_mouse_hover)); + timelineWidget.playback_period_drag_released_signal().connect( + mem_fun(this, &TimelinePanel::on_playback_period_drag_released)); // Setup the toolbar timeIndicatorButton.set_label_widget(timeIndicator); + toolbar.append(timeIndicatorButton); + toolbar.append(previousButton); toolbar.append(rewindButton); - toolbar.append(playPauseButton); + toolbar.append(playPauseButton, + mem_fun(this, &TimelinePanel::on_play_pause)); + toolbar.append(stopButton, + mem_fun(this, &TimelinePanel::on_stop)); toolbar.append(forwardButton); toolbar.append(nextButton); - - toolbar.append(timeIndicatorButton); toolbar.append(seperator1); - toolbar.append(arrowTool, mem_fun(this, - &TimelinePanel::on_arrow_tool)); - toolbar.append(iBeamTool, mem_fun(this, - &TimelinePanel::on_ibeam_tool)); + toolbar.append(arrowTool, + mem_fun(this, &TimelinePanel::on_arrow_tool)); + toolbar.append(iBeamTool, + mem_fun(this, &TimelinePanel::on_ibeam_tool)); toolbar.append(seperator2); @@ -92,6 +98,33 @@ TimelinePanel::TimelinePanel() : show_time(0); } +void +TimelinePanel::on_play_pause() +{ + // TEST CODE! + if(!is_playing()) + { + play(); + } + else + { + frameEvent.disconnect(); + } + + update_playback_buttons(); +} + +void +TimelinePanel::on_stop() +{ + // TEST CODE! + timelineWidget.set_playback_point(GAVL_TIME_UNDEFINED); + frameEvent.disconnect(); + show_time(timelineWidget.get_playback_period_start()); + + update_playback_buttons(); +} + void TimelinePanel::on_arrow_tool() { @@ -126,7 +159,26 @@ TimelinePanel::on_zoom_out() void TimelinePanel::on_mouse_hover(gavl_time_t time) { - show_time(time); + +} + +void +TimelinePanel::on_playback_period_drag_released() +{ + //----- TEST CODE - this needs to set the playback point via the + // real backend + timelineWidget.set_playback_point( + timelineWidget.get_playback_period_start()); + //----- END TEST CODE + + play(); +} + +void +TimelinePanel::update_playback_buttons() +{ + playPauseButton.set_stock_id(is_playing() ? + Stock::MEDIA_PAUSE : Stock::MEDIA_PLAY); } void @@ -150,12 +202,49 @@ TimelinePanel::update_zoom_buttons() TimelineWidget::MaxScale); } +void +TimelinePanel::play() +{ + if(timelineWidget.get_playback_point() == GAVL_TIME_UNDEFINED) + timelineWidget.set_playback_point( + timelineWidget.get_playback_period_start()); + frameEvent = Glib::signal_timeout().connect( + sigc::mem_fun(this, &TimelinePanel::on_frame), + 1000 / 25); +} + +bool +TimelinePanel::is_playing() const +{ + // TEST CODE! - this should be hooked up to the real playback control + return frameEvent.connected(); +} + void TimelinePanel::show_time(gavl_time_t time) { timeIndicator.set_text(lumiera_tmpbuf_print_time(time)); } +bool +TimelinePanel::on_frame() +{ + // TEST CODE! + const gavl_time_t point = timelineWidget.get_playback_point() + + GAVL_TIME_SCALE / 25; + if(point < timelineWidget.get_playback_period_end()) + { + show_time(point); + timelineWidget.set_playback_point(point); + + + } + else + on_stop(); + + return true; +} + } // namespace panels } // namespace gui } // namespace lumiera diff --git a/src/gui/panels/timeline-panel.hpp b/src/gui/panels/timeline-panel.hpp index e154e9a26..e12a827f6 100644 --- a/src/gui/panels/timeline-panel.hpp +++ b/src/gui/panels/timeline-panel.hpp @@ -49,6 +49,10 @@ public: private: //----- Event Handlers -----// + + void on_play_pause(); + void on_stop(); + void on_arrow_tool(); void on_ibeam_tool(); @@ -58,11 +62,16 @@ private: void on_time_pressed(); void on_mouse_hover(gavl_time_t time); + void on_playback_period_drag_released(); private: + void update_playback_buttons(); void update_tool_buttons(); void update_zoom_buttons(); + void play(); + bool is_playing() const; + void show_time(gavl_time_t time); private: @@ -82,6 +91,7 @@ private: Gtk::ToolButton previousButton; Gtk::ToolButton rewindButton; Gtk::ToolButton playPauseButton; + Gtk::ToolButton stopButton; Gtk::ToolButton forwardButton; Gtk::ToolButton nextButton; @@ -98,7 +108,13 @@ private: // Internals bool updatingToolbar; +private: + // TEST CODE + bool on_frame(); + sigc::connection frameEvent; + //----- Constants -----// +private: static const int ZoomToolSteps; }; diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index c7463768b..2bf6285f9 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -48,6 +48,7 @@ TimelineWidget::TimelineWidget() : selectionEnd(0), playbackPeriodStart(0), playbackPeriodEnd(0), + playbackPoint(GAVL_TIME_UNDEFINED), horizontalScroll(horizontalAdjustment), verticalScroll(verticalAdjustment) { @@ -248,6 +249,20 @@ TimelineWidget::set_playback_period(gavl_time_t start, gavl_time_t end) body->queue_draw(); } +void +TimelineWidget::set_playback_point(gavl_time_t point) +{ + playbackPoint = point; + ruler->queue_draw(); + body->queue_draw(); +} + +gavl_time_t +TimelineWidget::get_playback_point() const +{ + return playbackPoint; +} + ToolType TimelineWidget::get_tool() const { @@ -274,6 +289,12 @@ TimelineWidget::mouse_hover_signal() const return mouseHoverSignal; } +sigc::signal +TimelineWidget::playback_period_drag_released_signal() const +{ + return playbackPeriodDragReleasedSignal; +} + void TimelineWidget::on_scroll() { @@ -372,6 +393,12 @@ TimelineWidget::on_motion_in_body_notify_event(GdkEventMotion *event) return true; } +void +TimelineWidget::on_playback_period_drag_released() +{ + playbackPeriodDragReleasedSignal.emit(); +} + } // namespace widgets } // namespace gui } // namespace lumiera diff --git a/src/gui/widgets/timeline-widget.hpp b/src/gui/widgets/timeline-widget.hpp index ef13ef556..4e307bd19 100644 --- a/src/gui/widgets/timeline-widget.hpp +++ b/src/gui/widgets/timeline-widget.hpp @@ -52,8 +52,14 @@ namespace timeline {} class TimelineWidget : public Gtk::Table { public: + /** + * Constructor + */ TimelineWidget(); + /** + * Destructor + */ ~TimelineWidget(); /* ===== Data Access ===== */ @@ -145,6 +151,20 @@ public: */ void set_playback_period(gavl_time_t start, gavl_time_t end); + /** + * Sets the time which is currenty being played back. + * @param point The time index being played. This value may be + * GAVL_TIME_UNDEFINED, if there is no playback point. + */ + void set_playback_point(gavl_time_t point); + + /** + * Gets the current playback point. + * @return The time index of the playback point. This value may be + * GAVL_TIME_UNDEFINED, if there is no playback point. + */ + gavl_time_t get_playback_point() const; + /** * Gets the type of the tool currently active. */ @@ -160,6 +180,8 @@ public: sigc::signal view_changed_signal() const; sigc::signal mouse_hover_signal() const; + + sigc::signal playback_period_drag_released_signal() const; /* ===== Events ===== */ protected: @@ -183,6 +205,8 @@ private: int get_y_scroll_offset() const; bool on_motion_in_body_notify_event(GdkEventMotion *event); + + void on_playback_period_drag_released(); protected: @@ -195,6 +219,7 @@ protected: gavl_time_t selectionEnd; gavl_time_t playbackPeriodStart; gavl_time_t playbackPeriodEnd; + gavl_time_t playbackPoint; int totalHeight; @@ -202,6 +227,7 @@ protected: timeline::Track video2; std::vector tracks; + // Child Widgets timeline::HeaderContainer *headerContainer; timeline::TimelineBody *body; timeline::TimelineRuler *ruler; @@ -213,6 +239,8 @@ protected: // Signals sigc::signal viewChangedSignal; sigc::signal mouseHoverSignal; + sigc::signal + playbackPeriodDragReleasedSignal; /* ===== Constants ===== */ public: diff --git a/src/gui/widgets/timeline/timeline-body.cpp b/src/gui/widgets/timeline/timeline-body.cpp index a3602572a..0d620ef07 100644 --- a/src/gui/widgets/timeline/timeline-body.cpp +++ b/src/gui/widgets/timeline/timeline-body.cpp @@ -132,8 +132,6 @@ TimelineBody::on_realize() bool TimelineBody::on_expose_event(GdkEventExpose* event) { - Cairo::Matrix view_matrix; - REQUIRE(event != NULL); REQUIRE(timelineWidget != NULL); @@ -146,78 +144,18 @@ TimelineBody::on_expose_event(GdkEventExpose* event) read_styles(); // Prepare to render via cairo - Glib::RefPtr