Lumiera  0.pre.03
»edit your freedom«
engine-service.cpp
Go to the documentation of this file.
1 /*
2  EngineService - primary service access point for using the renderengine
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 
14 
22 #include "lib/itertools.hpp"
23 
24 //#include <string>
25 //#include <memory>
26 #include <functional>
27 
28 
29 
30 namespace steam {
31 namespace engine{
32 
33 // using std::string;
34 // using lumiera::Subsys;
35  using std::function;
36  using std::bind;
37  using std::ref;
39  using lib::append_all;
40 
41 
42  namespace { // hidden local details of the service implementation....
43 
44  } // (End) hidden service impl details
45 
46 
47 
48 
49 
52 
53 
54 
56  EngineService::EngineService()
57  { }
58 
59 
60 
70  CalcStreams
72  Timings nominalTimings,
73  OutputConnection& output,
74  Quality serviceQuality)
75  {
76  RenderEnvironment& renderConfig = configureCalculation (mPort,nominalTimings,serviceQuality);
77  function<CalcStream(play::DataSink)> triggerRenderStart = bind (activateCalculation, _1, ref(renderConfig));
78 
79  CalcStreams runningCalculations;
80  append_all (transform (output.getOpenedSinks()
81  ,triggerRenderStart
82  )
83  ,runningCalculations);
84  return runningCalculations;
86 // treat_all(output.getOpenedSinks())
87 // .apply (activateCalculation, _1, renderConfig)
88 // .buildVector();
89  }
90 
91 
92 
94  CalcStreams
95  EngineService::calculateBackground(ModelPort mPort,
96  Timings nominalTimings,
97  Quality serviceQuality)
98  {
99  UNIMPLEMENTED ("build calculation streams for background rendering");
100  }
101 
102 
109  CalcStream
111  {
112  CalcStream calcStream(engineCallback);
113  calcStream.sendToOutput (sink);
114  return calcStream;
115  }
116 
117 
118 
140  Timings nominalTimings,
141  Quality serviceQuality)
142  {
143  UNIMPLEMENTED ("Access and wire to the Scheduler-frontend. "
144  "Then access the Segmentation and invoke a builder function for a suitable dispatcher table. "
145  "Package all of this into a suitable RenderEnvironementClosure subclass.");
146  RenderEnvironment* todo_fake(0);
147 
148  return *todo_fake;
149  }
150 
151 
152 
159  void
161  {
162  UNIMPLEMENTED ("tracing/diagnostics mode of the render engine");
163  }
164 
165  void
167  {
168  UNIMPLEMENTED ("tracing/diagnostics mode of the render engine");
170  }
171 
172 
173 
174 
175 
176  /* ===== Quality-of-Service ===== */
177 
178 
179  enum CalcType {
180  PLAYBACK,
181  RENDER,
182  BACKGROUND
183  };
184 
185 
187  : public EngineService::Quality
188  {
189  CalcType type_;
190 
191  public:
192  DefaultQoS (CalcType type)
193  : type_(type)
194  { }
195  };
196 
198  : public DefaultQoS
199  {
200 
201  public:
202  PriorityQoS ()
203  : DefaultQoS(PLAYBACK)
204  { }
205  };
206 
208  : public DefaultQoS
209  {
210 
211  public:
212  Compromise (CalcType type)
213  : DefaultQoS(type)
214  { }
215  };
216 
217 
218  EngineService::QoS_Definition EngineService::QoS_DEFAULT = QoS_Definition::build<DefaultQoS> (PLAYBACK);
219  EngineService::QoS_Definition EngineService::QoS_BACKGROUND = QoS_Definition::build<DefaultQoS> (BACKGROUND);
220  EngineService::QoS_Definition EngineService::QoS_COMPROMISE = QoS_Definition::build<Compromise> (PLAYBACK);
221  EngineService::QoS_Definition EngineService::QoS_PERFECT_RESULT = QoS_Definition::build<DefaultQoS> (RENDER);
222  EngineService::QoS_Definition EngineService::QoS_SYNC_PRIORITY = QoS_Definition::build<PriorityQoS>();
223 
224 
225 
226 }} // namespace steam::engine
Access point for the (core) calculation service of the render engine.
void activateTracing()
Switch the complete engine into diagnostics mode.
CalcStreams calculate(ModelPort mPort, Timings nominalTimings, OutputConnection &output, Quality serviceQuality=QoS_DEFAULT)
core operation: activate the Lumiera Render Engine.
Generic frame timing specification.
Definition: timings.hpp:86
denotes an opened connection ready to receive media data for output.
Steam-Layer implementation namespace root.
static lib::Depend< EngineService > instance
access point to the Engine Interface.
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:280
static CalcStream activateCalculation(play::DataSink, RenderEnvironment &)
Template to build polymorphic value objects.
A calculation stream groups and abstracts a series of calculation jobs, delivering frames into the co...
Definition: calc-stream.hpp:87
_TransformIterT< IT, FUN >::Iter transform(IT &&source, FUN processingFunc)
pipes a given Lumiera Forward Iterator through a transformation function and wraps the resulting tran...
Handle designating a point within the model, where actually output data can be pulled.
Definition: model-port.hpp:95
virtual RenderEnvironment & configureCalculation(ModelPort, Timings, Quality)
Helpers for working with iterators based on the pipeline model.
Quality-of-Service definition for an Render Engine usage.
Abstract definition of the environment hosting a given render activity (CalcStream).