Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
timings.hpp
Go to the documentation of this file.
1/*
2 TIMINGS.hpp - timing specifications for a frame quantised data stream
3
4 Copyright (C)
5 2011, 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
33#ifndef STEAM_PLAY_TIMINGS_H
34#define STEAM_PLAY_TIMINGS_H
35
36
37#include "lib/error.hpp"
38//#include "lib/handle.hpp"
40//#include "steam/engine/buffer-provider.hpp"
41//#include "lib/iter-source.hpp"
42//#include "lib/sync.hpp"
43
44//#include <string>
45//#include <vector>
46#include <boost/rational.hpp>
47#include <memory>
48
49namespace lib {
50namespace time{
51 class Quantiser;
52 typedef std::shared_ptr<const Quantiser> PQuant;
53}}
54
55namespace steam {
56namespace play {
57
63 using lib::time::Time;
64//using std::string;
65
66//using std::vector;
67//using std::shared_ptr;
68
74
75
76
77 /*************************************************************************/
86 class Timings
87 {
89
90 public:
92 boost::rational<FrameCnt> playbackSpeed;
96
97 explicit
98 Timings (FrameRate fps);
99
100 Timings (FrameRate fps, Time realTimeAnchor);
101
102 // default copy acceptable
103
104
107
108 Time getOrigin() const;
109
110 Time getFrameStartAt (FrameCnt frameNr) const;
111 Duration getFrameDurationAt (TimeValue refPoint) const;
112 Duration getFrameDurationAt (FrameCnt refFrameNr) const;
113
115 FrameCnt getBreakPointAfter (TimeValue refPoint) const;
116
122
133 Offset getRealOffset (FrameCnt frameOffset) const;
134
146 Time getTimeDue(FrameCnt frameOffset) const;
147
157
165 FrameCnt establishNextPlanningChunkStart(FrameCnt anchorFrame) const;
166
167
168 bool isOriginalSpeed() const;
169 bool isTimebound() const;
170
171
173 bool isValid() const;
174
175
177
178 Timings constrainedBy (Timings additionalConditions);
179
180 };
181
182
183
184
185
186 inline bool
188 {
189 return 1 == playbackSpeed;
190 }
191
192 inline bool
194 {
196 }
197
198
199
200}} // namespace steam::play
201#endif
Duration is the internal Lumiera time metric.
Framerate specified as frames per second.
Offset measures a distance in time.
basic constant internal time value.
Lumiera's internal time value datatype.
Generic frame timing specification.
Definition timings.hpp:87
FrameCnt getBreakPointAfter(TimeValue refPoint) const
the next grid point at or after the given reference time
Definition timings.cpp:143
bool isOriginalSpeed() const
Definition timings.hpp:187
Duration getPlanningChunkDuration() const
the minimum time span to be covered by frame calculation jobs planned in one sway.
Definition timings.cpp:190
bool isTimebound() const
Definition timings.hpp:193
lib::time::PQuant grid_
Definition timings.hpp:88
Time getOrigin() const
Definition timings.cpp:114
Duration outputLatency
Definition timings.hpp:94
Duration getFrameDurationAt(TimeValue refPoint) const
Definition timings.cpp:128
FrameCnt establishNextPlanningChunkStart(FrameCnt anchorFrame) const
establish the time point to anchor the next planning chunk, in accordance with getPlanningChunkDurati...
Definition timings.cpp:197
Time scheduledDelivery
a wall clock time corresponding to the Grid's origin. Can be Time::Never (=not time bound)
Definition timings.hpp:93
Time getFrameStartAt(FrameCnt frameNr) const
Definition timings.cpp:121
bool isValid() const
Consistency self-check.
Definition timings.cpp:102
static Timings DISABLED
marker for halted output
Definition timings.hpp:106
Timings constrainedBy(Timings additionalConditions)
Definition timings.cpp:215
Time getTimeDue(FrameCnt frameOffset) const
real time deadline for the given frame, without any latency.
Definition timings.cpp:166
Duration constantFrameTimingsInterval(TimeValue startPoint) const
the frame spacing and duration remains constant for some time...
Definition timings.cpp:159
Offset getRealOffset(FrameCnt frameOffset) const
calculate the given frame's distance from origin, but do so using the real time scale,...
Definition timings.cpp:180
boost::rational< FrameCnt > playbackSpeed
Definition timings.hpp:92
PlaybackUrgency playbackUrgency
Definition timings.hpp:91
Duration engineLatency
reasonable guess at the scheduling and dispatch-delay of the render engine
Definition timings.hpp:95
Lumiera error handling (C++ interface).
int64_t FrameCnt
relative framecount or frame number.
Definition digxel.hpp:310
std::shared_ptr< const Quantiser > PQuant
Definition formats.hpp:58
Implementation namespace for support and library code.
Steam-Layer implementation namespace root.
a family of time value like entities and their relationships.