Lumiera  0.pre.03
»edit your freedom«
streamtype.hpp
Go to the documentation of this file.
1 /*
2  STREAMTYPE.hpp - classification of media stream types
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 
25 #ifndef STEAM_STREAMTYPE_H
26 #define STEAM_STREAMTYPE_H
27 
28 #include "lib/symbol.hpp"
29 //#include "common/query.hpp"
30 #include "lib/idi/entry-id.hpp"
31 
32 
33 
34 namespace steam {
35 
36  using lib::Symbol;
37 
38 // "yes mummy, we all know this code is not finished yet..."
39 #pragma GCC diagnostic push
40 #pragma GCC diagnostic ignored "-Wuninitialized"
41 
45  struct StreamType
47  {
48  enum MediaKind
49  {
50  VIDEO,
51  IMMAGE,
52  AUDIO,
53  MIDI
54  };
55 
56  enum Usage
57  {
58  RAW,
59  SOURCE,
60  TARGET,
61  TRANSIENT
62  };
63 
64  struct Prototype;
65 
66  class ImplFacade;
67  class ImplConstraint;
68 
70 
71 
72  Prototype const& prototype;
73  ImplFacade * implType;
74  Usage intentionTag;
75 
76  };
77 #pragma GCC diagnostic pop
78 
79 
84  {
85  Symbol id;
86  MediaKind kind;
87 
88  bool subsumes (Prototype const& other) const;
89  bool canRender (Prototype const& other) const;
90  };
91 
92 
93 
94 
100  {
101  public:
102  Symbol libraryID;
103 
104  class TypeTag ;
105 
112  struct DataBuffer { };
113 
114 
115  virtual bool operator== (ImplFacade const& other) const =0;
116  virtual bool operator== (StreamType const& other) const =0;
117 
118  virtual bool canConvert (ImplFacade const& other) const =0;
119  virtual bool canConvert (StreamType const& other) const =0;
120 
121  virtual DataBuffer* createFrame () const =0;
122  virtual MediaKind getKind() const =0;
123 
124  virtual ~ImplFacade() {};
125 
126  protected:
127  ImplFacade (Symbol libID) ;
128  };
129 
130 
138  : public StreamType::ImplFacade
139  {
140  public:
141  virtual bool canConvert (ImplFacade const& other) const =0;
142  virtual bool canConvert (StreamType const& other) const =0;
143 
144  virtual bool subsumes (ImplFacade const& other) const =0;
145 
147  virtual void makeCompliant (ImplFacade & other) const =0;
148 
151  virtual DataBuffer* createFrame () const =0;
152 
156  virtual DataBuffer* createFrame (ImplConstraint const& furtherConstraints) const =0;
157 
158  //TODO: do we need functions to represent and describe this constraint?
159 
160  };
161 
162 
170  {
171  void* rawTypeStruct_;
172 
173  public:
174  Symbol libraryID;
175 
176  template<class TY>
177  TypeTag (Symbol lID, TY& rawType)
178  : rawTypeStruct_(&rawType),
179  libraryID(lID)
180  { }
181  };
182 
183 
184 
185 
186 } // namespace steam
187 
188 
189 namespace lumiera {
190  using steam::StreamType;
191 }
192 
193 #endif /*STEAM_STREAMTYPE_H*/
opaque placeholder (type erasure) for implementation specific type info.
Definition: streamtype.hpp:169
Any copy and copy construction prohibited.
Definition: nocopy.hpp:37
Steam-Layer implementation namespace root.
A (more or less) concrete implementation type, wired up as a facade providing the basic set of operat...
Definition: streamtype.hpp:99
Token or Atom with distinct identity.
Definition: symbol.hpp:117
Marker types to indicate a literal string and a Symbol.
ElementBoxWidget::Config::Qualifier kind(Kind kind)
qualify the basic use case for the new ElementBoxWidget
Lumiera public interface.
Definition: advice.cpp:104
Special case of an implementation type being only partially specified Besides requiring some aspect o...
Definition: streamtype.hpp:137
Bare symbolic and hash ID used for accounting of asset like entries.
placeholder type for the contents of a data buffer.
Definition: streamtype.hpp:112