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
46
:
util::NonCopyable
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
69
using
ID
=
lib::idi::EntryID<StreamType>
;
70
71
72
Prototype
const
& prototype;
73
ImplFacade
* implType;
74
Usage intentionTag;
75
76
};
77
#pragma GCC diagnostic pop
78
79
83
struct
StreamType::Prototype
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
99
class
StreamType::ImplFacade
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
137
class
StreamType::ImplConstraint
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
169
class
StreamType::ImplFacade::TypeTag
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*/
steam::StreamType::ImplFacade::TypeTag
opaque placeholder (type erasure) for implementation specific type info.
Definition:
streamtype.hpp:169
util::NonCopyable
Any copy and copy construction prohibited.
Definition:
nocopy.hpp:37
lib::idi::EntryID< StreamType >
steam
Steam-Layer implementation namespace root.
Definition:
dummy-player-facade.h:37
steam::StreamType
Definition:
streamtype.hpp:45
steam::StreamType::ImplFacade
A (more or less) concrete implementation type, wired up as a facade providing the basic set of operat...
Definition:
streamtype.hpp:99
lib::Symbol
Token or Atom with distinct identity.
Definition:
symbol.hpp:117
symbol.hpp
Marker types to indicate a literal string and a Symbol.
stage::widget::kind
ElementBoxWidget::Config::Qualifier kind(Kind kind)
qualify the basic use case for the new ElementBoxWidget
Definition:
element-box-widget.hpp:223
lumiera
Lumiera public interface.
Definition:
advice.cpp:104
steam::StreamType::ImplConstraint
Special case of an implementation type being only partially specified Besides requiring some aspect o...
Definition:
streamtype.hpp:137
entry-id.hpp
Bare symbolic and hash ID used for accounting of asset like entries.
steam::StreamType::ImplFacade::DataBuffer
placeholder type for the contents of a data buffer.
Definition:
streamtype.hpp:112
steam::StreamType::Prototype
Definition:
streamtype.hpp:83
steam
streamtype.hpp
Generated on Fri Dec 13 2024 05:05:35 for Lumiera by
1.8.13