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