Lumiera  0.pre.03
»edit your freedom«
teststreamtypes.hpp
Go to the documentation of this file.
1 /*
2  TESTSTREAMTYPES.hpp - create test (stub) stream type information
3 
4  Copyright (C)
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 */
13 
19 #ifndef LUMIERA_TEST_TESTSTREAMTYPES_H
20 #define LUMIERA_TEST_TESTSTREAMTYPES_H
21 
22 
23 //#include "lib/util.hpp"
24 
25 #include "steam/streamtype.hpp"
27 #include "lib/time/timevalue.hpp"
28 
29 extern "C" {
30 #include <gavl/gavl.h>
31 }
32 
33 
34 namespace steam {
35 namespace test_format {
36 
38 
39  namespace { // constants used to parametrise tests
40 
41  const int TEST_IMG_WIDTH = 40;
42  const int TEST_IMG_HEIGHT = 30;
43 
44  const int TEST_FRAME_DUR = TimeValue::SCALE / 25;
45  }
46 
47  Symbol GAVL = "GAVL";
48 
49 
50 
54  inline gavl_video_format_t
56  {
57  gavl_video_format_t type;
58 
59  type.pixelformat = GAVL_RGB_24;
60  type.interlace_mode = GAVL_INTERLACE_NONE;
61  type.framerate_mode = GAVL_FRAMERATE_CONSTANT;
62  type.chroma_placement = GAVL_CHROMA_PLACEMENT_DEFAULT;
63 
64  type.image_width = TEST_IMG_WIDTH; // Width of the image in pixels
65  type.image_height = TEST_IMG_WIDTH; // Height of the image in pixels
66  type.frame_width = TEST_IMG_WIDTH; // Width of the frame buffer in pixels, might be larger than image_width
67  type.frame_height = TEST_IMG_WIDTH; // Height of the frame buffer in pixels, might be larger than image_height
68 
69  type.pixel_width = 1; // Relative width of a pixel (pixel aspect ratio is pixel_width/pixel_height)
70  type.pixel_height = 1; // Relative height of a pixel (pixel aspect ratio is pixel_width/pixel_height)
71 
72  type.frame_duration = TEST_FRAME_DUR; // Duration of a frame in timescale ticks.
73  type.timescale = TimeValue::SCALE; // Timescale in ticks per second (is defined to be 1000000 as of 9/2008)
74 
75  return type;
76  }
77 
78 
82  inline StreamType::ImplFacade const&
84  {
85  gavl_video_format_t rawType = test_createRawType();
86  return control::STypeManager::instance().getImpl (GAVL, rawType);
87  }
88 
89 
90 
91 }} // namespace steam::test_format
92 #endif
Framework for classification of media streams.
static const gavl_time_t SCALE
Number of micro ticks (µs) per second as basic time scale.
Definition: timevalue.hpp:167
Steam-Layer implementation namespace root.
Interface to the stream type system.
A (more or less) concrete implementation type, wired up as a facade providing the basic set of operat...
Definition: streamtype.hpp:99
static lib::Depend< STypeManager > instance
access the system-wide stream type manager instance.
gavl_video_format_t test_createRawType()
Helper: create an raw GAVL type descriptor usable for generating a Lumiera StreamType.
Token or Atom with distinct identity.
Definition: symbol.hpp:117
a family of time value like entities and their relationships.
basic constant internal time value.
Definition: timevalue.hpp:133
StreamType::ImplFacade const & test_createImplType()
Helper: create an implementation frame and build the corresponding streamtype.