Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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) Lumiera.org
5  2011, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
23 
30 #include "lib/itertools.hpp"
31 
32 //#include <string>
33 //#include <memory>
34 #include <functional>
35 
36 
37 
38 namespace proc {
39 namespace engine{
40 
41 // using std::string;
42 // using lumiera::Subsys;
43  using std::function;
44  using std::bind;
45  using std::ref;
47  using lib::append_all;
48 
49 
50  namespace { // hidden local details of the service implementation....
51 
52  } // (End) hidden service impl details
53 
54 
55 
56 
57 
60 
61 
62 
65  { }
66 
67 
68 
79  EngineService::calculate(ModelPort mPort,
80  Timings nominalTimings,
81  OutputConnection& output,
82  Quality serviceQuality)
83  {
84  RenderEnvironmentClosure& renderConfig = configureCalculation (mPort,nominalTimings,serviceQuality);
85  function<CalcStream(play::DataSink)> triggerRenderStart = bind (activateCalculation, _1, ref(renderConfig));
86 
87  CalcStreams runningCalculations;
89  ,triggerRenderStart
90  )
91  ,runningCalculations);
92  return runningCalculations;
94 // treat_all(output.getOpenedSinks())
95 // .apply (activateCalculation, _1, renderConfig)
96 // .buildVector();
97  }
98 
99 
100 
104  Timings nominalTimings,
105  Quality serviceQuality)
106  {
107  UNIMPLEMENTED ("build calculation streams for background rendering");
108  }
109 
110 
117  CalcStream
119  {
120  CalcStream calcStream(engineCallback);
121  calcStream.sendToOutput (sink);
122  return calcStream;
123  }
124 
125 
126 
148  Timings nominalTimings,
149  Quality serviceQuality)
150  {
151  UNIMPLEMENTED ("Access and wire to the Scheduler-frontend. "
152  "Then access the Segmentation and invoke a builder function for a suitable dispatcher table. "
153  "Package all of this into a suitable RenderEnvironementClosure subclass.");
154  RenderEnvironmentClosure* todo_fake(0);
155 
156  return *todo_fake;
157  }
158 
159 
160 
167  void
169  {
170  UNIMPLEMENTED ("tracing/diagnostics mode of the render engine");
171  }
172 
173  void
175  {
176  UNIMPLEMENTED ("tracing/diagnostics mode of the render engine");
178  }
179 
180 
181 
182 
183 
184  /* ===== Quality-of-Service ===== */
185 
186 
187  enum CalcType {
191  };
192 
193 
195  : public EngineService::Quality
196  {
198 
199  public:
201  : type_(type)
202  { }
203  };
204 
206  : public DefaultQoS
207  {
208 
209  public:
212  { }
213  };
214 
216  : public DefaultQoS
217  {
218 
219  public:
221  : DefaultQoS(type)
222  { }
223  };
224 
225 
226  EngineService::QoS_Definition EngineService::QoS_DEFAULT = QoS_Definition::build<DefaultQoS> (PLAYBACK);
227  EngineService::QoS_Definition EngineService::QoS_BACKGROUND = QoS_Definition::build<DefaultQoS> (BACKGROUND);
228  EngineService::QoS_Definition EngineService::QoS_COMPROMISE = QoS_Definition::build<Compromise> (PLAYBACK);
229  EngineService::QoS_Definition EngineService::QoS_PERFECT_RESULT = QoS_Definition::build<DefaultQoS> (RENDER);
230  EngineService::QoS_Definition EngineService::QoS_SYNC_PRIORITY = QoS_Definition::build<PriorityQoS>();
231 
232 
233 
234 }} // namespace proc::engine
CalcStreams calculate(ModelPort mPort, Timings nominalTimings, OutputConnection &output, Quality serviceQuality=QoS_DEFAULT)
core operation: activate the Lumiera Render Engine.
Access point for the (core) calculation service of the render engine.
lib::PolymorphicValue< Quality, QoS_IMPL_SIZE, _Clonable_QoS_Strategy > QoS_Definition
denotes an opened connection ready to receive media data for output.
void append_all(IT iter, CON &container)
Definition: itertools.hpp:812
Abstract definition of the environment hosting a given render activity (CalcStream).
Definition: calc-stream.hpp:81
virtual OpenedSinks getOpenedSinks()=0
A calculation stream groups and abstracts a series of calculation jobs, delivering frames into the co...
Quality-of-Service definition for an Render Engine usage.
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:275
virtual RenderEnvironmentClosure & configureCalculation(ModelPort, Timings, Quality)
std::vector< CalcStream > CalcStreams
CalcStreams calculateBackground(ModelPort mPort, Timings nominalTimings, Quality serviceQuality=QoS_BACKGROUND)
_TransformIterT< IT, FUN >::Iter transform(IT &&source, FUN processingFunc)
pipes a given Lumiera Forward Iterator through a transformation function and wraps the resulting tran...
void activateTracing()
Switch the complete engine into diagnostics mode.
static CalcStream activateCalculation(play::DataSink, RenderEnvironmentClosure &)
CalcStream sendToOutput(play::DataSink)
static QoS_Definition QoS_DEFAULT
static QoS_Definition QoS_COMPROMISE
static QoS_Definition QoS_SYNC_PRIORITY
static QoS_Definition QoS_PERFECT_RESULT
Helpers for working with iterators based on the pipeline model.
Proc-Layer implementation namespace root.
Definition: id-scheme.hpp:63
static lib::Depend< EngineService > instance
access point to the Engine Interface.
Generic frame timing specification.
Definition: timings.hpp:95
static QoS_Definition QoS_BACKGROUND