*Hey* first time to use a GAVL video frame type...

This commit is contained in:
Fischlurch 2008-09-25 21:48:43 +02:00
parent 8109badf49
commit 47a416bba3
3 changed files with 46 additions and 7 deletions

View file

@ -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

View file

@ -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

View file

@ -30,10 +30,49 @@
#include "common/streamtype.hpp"
#include "proc/control/stypemanager.hpp"
extern "C" {
#include <gavl/gavl.h>
}
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