Lumiera
0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
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*/
lib::Symbol
Token or Atom with distinct identity.
Definition
symbol.hpp:120
steam::StreamType::ImplConstraint
Special case of an implementation type being only partially specified Besides requiring some aspect o...
Definition
streamtype.hpp:139
steam::StreamType::ImplConstraint::createFrame
virtual DataBuffer * createFrame() const =0
create a default impl type in accordance to this constraint and use it to create a new framebuffer
steam::StreamType::ImplConstraint::subsumes
virtual bool subsumes(ImplFacade const &other) const =0
steam::StreamType::ImplConstraint::canConvert
virtual bool canConvert(StreamType const &other) const =0
steam::StreamType::ImplConstraint::canConvert
virtual bool canConvert(ImplFacade const &other) const =0
steam::StreamType::ImplConstraint::createFrame
virtual DataBuffer * createFrame(ImplConstraint const &furtherConstraints) const =0
Similarly create a impl type which complies to this constraint as well as to the additional constrain...
steam::StreamType::ImplConstraint::makeCompliant
virtual void makeCompliant(ImplFacade &other) const =0
modify the other impl type such as to comply with this constraint
steam::StreamType::ImplFacade::TypeTag
opaque placeholder (type erasure) for implementation specific type info.
Definition
streamtype.hpp:170
steam::StreamType::ImplFacade::TypeTag::TypeTag
TypeTag(Symbol lID, TY &rawType)
Definition
streamtype.hpp:177
steam::StreamType::ImplFacade::TypeTag::libraryID
Symbol libraryID
Definition
streamtype.hpp:174
steam::StreamType::ImplFacade::TypeTag::rawTypeStruct_
void * rawTypeStruct_
Definition
streamtype.hpp:171
steam::StreamType::ImplFacade
A (more or less) concrete implementation type, wired up as a facade providing the basic set of operat...
Definition
streamtype.hpp:100
steam::StreamType::ImplFacade::createFrame
virtual DataBuffer * createFrame() const =0
steam::StreamType::ImplFacade::~ImplFacade
virtual ~ImplFacade()
Definition
streamtype.hpp:124
steam::StreamType::ImplFacade::operator==
virtual bool operator==(ImplFacade const &other) const =0
steam::StreamType::ImplFacade::canConvert
virtual bool canConvert(StreamType const &other) const =0
steam::StreamType::ImplFacade::canConvert
virtual bool canConvert(ImplFacade const &other) const =0
steam::StreamType::ImplFacade::libraryID
Symbol libraryID
Definition
streamtype.hpp:102
steam::StreamType::ImplFacade::getKind
virtual MediaKind getKind() const =0
steam::StreamType::ImplFacade::DataBuffer
placeholder type for the contents of a data buffer.
Definition
streamtype.hpp:112
util::NonCopyable
Any copy and copy construction prohibited.
Definition
nocopy.hpp:38
entry-id.hpp
Bare symbolic and hash ID used for accounting of asset like entries.
lumiera
Lumiera public interface.
Definition
advice.hpp:102
steam
Steam-Layer implementation namespace root.
lib::idi::EntryID< StreamType >
steam::StreamType::Prototype
Definition
streamtype.hpp:84
steam::StreamType::Prototype::canRender
bool canRender(Prototype const &other) const
steam::StreamType::Prototype::id
Symbol id
Definition
streamtype.hpp:85
steam::StreamType::Prototype::kind
MediaKind kind
Definition
streamtype.hpp:86
steam::StreamType::Prototype::subsumes
bool subsumes(Prototype const &other) const
steam::StreamType
Definition
streamtype.hpp:47
steam::StreamType::prototype
Prototype const & prototype
Definition
streamtype.hpp:72
steam::StreamType::Usage
Usage
Definition
streamtype.hpp:57
steam::StreamType::SOURCE
@ SOURCE
Definition
streamtype.hpp:59
steam::StreamType::TARGET
@ TARGET
Definition
streamtype.hpp:60
steam::StreamType::TRANSIENT
@ TRANSIENT
Definition
streamtype.hpp:61
steam::StreamType::RAW
@ RAW
Definition
streamtype.hpp:58
steam::StreamType::intentionTag
Usage intentionTag
Definition
streamtype.hpp:74
steam::StreamType::MediaKind
MediaKind
Definition
streamtype.hpp:49
steam::StreamType::MIDI
@ MIDI
Definition
streamtype.hpp:53
steam::StreamType::VIDEO
@ VIDEO
Definition
streamtype.hpp:50
steam::StreamType::IMMAGE
@ IMMAGE
Definition
streamtype.hpp:51
steam::StreamType::AUDIO
@ AUDIO
Definition
streamtype.hpp:52
steam::StreamType::implType
ImplFacade * implType
Definition
streamtype.hpp:73
symbol.hpp
Marker types to indicate a literal string and a Symbol.
steam
streamtype.hpp
Generated on Thu Dec 11 2025 for Lumiera by
1.9.8