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 → [[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?