WIP: how to start the actual calculation streams within EngineService

this draft fills in the structure how to get from an invocation
of the engine service to the starting of actual CalcStream instances.

Basically the EngineService implementation is repsonsile to
instruct the Segmentation to provide a suitable Dispatcher.
This commit is contained in:
Fischlurch 2013-06-03 05:25:13 +02:00
parent 723096d3f2
commit 77066ee3ce
10 changed files with 83 additions and 35 deletions

View file

@ -127,12 +127,9 @@ namespace lumiera {
typedef proc::asset::PTimeline Timeline;
typedef proc::asset::PViewer Viewer;
/** core operation: create a new playback process
* outputting to the given viewer/display */
virtual Controller connect(ModelPorts, Output) =0;
/* ==== convenience shortcuts for common use cases ==== */
Controller perform(ModelPorts, Output);
Controller perform(Pipes, Output);
Controller perform(Timeline);
Controller perform(Viewer);
@ -141,6 +138,10 @@ namespace lumiera {
protected:
virtual ~Play();
/** core operation: create a new playback process
* outputting to the given viewer/display */
virtual Controller connect(ModelPorts, Output) =0;
};

View file

@ -28,6 +28,7 @@
#include "lib/error.hpp"
#include "proc/play/timings.hpp"
#include "proc/play/output-slot.hpp"
#include "proc/engine/calc-plan-continuation.hpp"
//#include "include/dummy-player-facade.h"
//#include "include/display-facade.h"
@ -108,6 +109,13 @@ namespace engine{
~CalcStream() { }
// using standard copy operations
CalcStream
sendToOutput (play::DataSink)
{
UNIMPLEMENTED ("set up dispatcher to start calculating and feeding to the given output sink");
return *this;
}
};

View file

@ -64,7 +64,7 @@ namespace engine{
/** special engine configuration for mock/testing operation.
*/
RenderEnvironmentClosure&
EngineServiceMock::configureCalculation ()
EngineServiceMock::configureCalculation (ModelPort,Timings,Quality)
{
UNIMPLEMENTED ("represent *this as RenderEnvironmentClosure)");
RenderEnvironmentClosure* todo_fake(0); ////KABOOOM

View file

@ -95,7 +95,7 @@ namespace engine{
protected:
virtual RenderEnvironmentClosure& configureCalculation ();
virtual RenderEnvironmentClosure& configureCalculation (ModelPort,Timings,Quality);
};

View file

@ -22,6 +22,7 @@
#include "proc/engine/engine-service.hpp"
#include "lib/itertools.hpp"
//#include <string>
//#include <memory>
@ -37,15 +38,34 @@ namespace engine{
// using lumiera::Subsys;
// using std::auto_ptr;
// using boost::scoped_ptr;
// using std::tr1::bind;
using std::function;
using std::tr1::bind;
using lib::transform;
using lib::append_all;
namespace { // hidden local details of the service implementation....
/** @internal build a representation of a single, ongoing calculation effort.
* This "CalcStream" is tied to the actual engine implementation, but only
* through an opaque link, representing this concrete engine as an
* RenderEnvironmentClosure. This enables the created CalcStream to be
* re-configured and adjusted while running.
*/
CalcStream
activateCalculation (play::DataSink sink, RenderEnvironmentClosure& engineCallback)
{
CalcStream calcStream(engineCallback);
calcStream.sendToOutput (sink);
return calcStream;
}
} // (End) hidden service impl details
/** storage for the EngineService interface object */
lib::Singleton<EngineService> EngineService::instance;
@ -72,7 +92,19 @@ namespace engine{
OutputConnection& output,
Quality serviceQuality)
{
UNIMPLEMENTED ("build a list of standard calculation streams");
RenderEnvironmentClosure& renderConfig = configureCalculation (mPort,nominalTimings,serviceQuality);
function<CalcStream(play::DataSink)> triggerRenderStart = bind (activateCalculation, renderConfig, _1);
CalcStreams runningCalculations;
append_all (transform (output.getOpenedSinks()
,triggerRenderStart
)
,runningCalculations);
return runningCalculations;
/////////////////////////////////////////////////////////////////////////////////////////////TICKET #874 : use a pipeline builder to write it as follows:
// treat_all(output.getOpenedSinks())
// .apply (activateCalculation, renderConfig, _1)
// .buildVector();
}
@ -87,17 +119,6 @@ namespace engine{
}
/** @internal build a representation of a single, ongoing calculation effort.
* This "CalcStream" is tied to the actual engine implementation, but only
* through an opaque link, representing this concrete engine as an
* RenderEnvironmentClosure. This enables the created CalcStream to be
* re-configured and adjusted while running.
*/
CalcStream
EngineService::activateCalculation (RenderEnvironmentClosure& engineCallback)
{
return CalcStream (engineCallback);
}
/** @internal extension point
@ -113,9 +134,13 @@ namespace engine{
* created render activity
*/
RenderEnvironmentClosure&
EngineService::configureCalculation ()
EngineService::configureCalculation (ModelPort mPort,
Timings nominalTimings,
Quality serviceQuality)
{
UNIMPLEMENTED ("represent *this as RenderEnvironmentClosure)");
UNIMPLEMENTED ("Access and wire to the Scheduler-frontend. "
"Then access the Segmentation and invoke a builder function for a suitable dispatcher table. "
"Package all of this into a suitable RenderEnvironementClosure subclass.");
RenderEnvironmentClosure* todo_fake(0); ////KABOOOM
return *todo_fake;

View file

@ -64,6 +64,7 @@
//
#include <boost/noncopyable.hpp>
//#include <boost/scoped_ptr.hpp>
#include <functional>
//#include <string>
@ -74,6 +75,7 @@ namespace engine{
// using lumiera::Subsys;
// using lumiera::Display;
// using lumiera::DummyPlayer;
// using std::tr1::function;
using mobject::ModelPort;
using proc::play::Timings;
@ -153,11 +155,8 @@ namespace engine{
Quality serviceQuality =QoS_BACKGROUND);
private:
CalcStream activateCalculation (RenderEnvironmentClosure&);
protected:
virtual RenderEnvironmentClosure& configureCalculation ();
virtual RenderEnvironmentClosure& configureCalculation (ModelPort,Timings,Quality);
void activateTracing();
void disableTracing(); ///< EX_FREE

View file

@ -211,11 +211,26 @@ namespace lumiera {
/* ==== convenience shortcuts for creating a PlayProcess ==== */
/**
* Generic point-of-Service for starting playback.
* Activating this service will "perform" the given exit points
* of the model, by "pulling" calculated data from these ports and
* feeding the results into suitable external outputs.
* @return a state machine front-end to control the ongoing
* play/render process.
*/
Play::Controller
Play::perform (ModelPorts ports, Output output)
{
return this->connect (ports, output);
}
/**
*
*/
Play::Controller
Play::perform(Pipes, Output)
Play::perform (Pipes, Output)
{
UNIMPLEMENTED ("build PlayProcess based on a set of pipes");
}
@ -225,7 +240,7 @@ namespace lumiera {
*
*/
Play::Controller
Play::perform(Timeline)
Play::perform (Timeline)
{
UNIMPLEMENTED ("build PlayProcess for a Timeline");
}
@ -235,7 +250,7 @@ namespace lumiera {
*
*/
Play::Controller
Play::perform(Viewer)
Play::perform (Viewer)
{
UNIMPLEMENTED ("build PlayProcess directly for a Viewer element");
}
@ -245,7 +260,7 @@ namespace lumiera {
*
*/
Play::Controller
Play::perform(Track)
Play::perform (Track)
{
UNIMPLEMENTED ("build PlayProcess for a single Track");
}
@ -255,7 +270,7 @@ namespace lumiera {
*
*/
Play::Controller
Play::perform(Clip)
Play::perform (Clip)
{
UNIMPLEMENTED ("build virtual Timeline and PlayProcess to show a single Clip");
}

View file

@ -109,7 +109,7 @@ namespace play {
/** @internal decision point about how to configure the rendering.
* This would be the point to switch the render engine used. */
* This would be the point for possibly switching the concrete render engine used. */
inline RenderConfigurator*
how_to_render (POutputManager outputPossibilities, Timings playTimings)
{

View file

@ -71,7 +71,7 @@ namespace test {
CHECK (!dummy.isWired());
Play::Controller player
= Play::facade().connect ( dummy.provide_testModelPorts()
= Play::facade().perform ( dummy.provide_testModelPorts()
, dummy.provide_testOutputSlot());
CHECK ( dummy.isWired());

View file

@ -4453,9 +4453,9 @@ We need a way of addressing existing [[pipes|Pipe]]. Besides, as the Pipes and T
&lt;&lt;tasksum end&gt;&gt;
</pre>
</div>
<div title="PlayProcess" modifier="Ichthyostega" created="201012181714" modified="201202122111" tags="def spec Player img">
<div title="PlayProcess" modifier="Ichthyostega" created="201012181714" modified="201306022259" tags="def spec Player img" changecount="1">
<pre>With //play process//&amp;nbsp; we denote an ongoing effort to calculate a stream of frames for playback or rendering.
The play process is an conceptual entity linking together several activities in the [[Backend]] and the RenderEngine. Creating a play process is the central service provided by the [[player subsystem|Player]]: it maintains a registration entry for the process to keep track of associated entities, resources allocated and calls [[dispatched|FrameDispatcher]] as a consequence, and it wires and exposes a PlayController to serve as an interface and information hub.
The play process is an conceptual entity linking together several activities in the [[Backend]] and the RenderEngine. Creating a play process is the central service provided by the [[player subsystem|Player]]: it maintains a registration entry for the process to keep track of associated entities, resources allocated and calls [[planned|FrameDispatcher]] and [[invoked|RenderJob]] as a consequence, and it wires and exposes a PlayController to serve as an interface and information hub.
''Note'': the player is in no way engaged in any of the actual calculation and management tasks necessary to make this [[stream of calculations|CalcStream]] happen. The play process code contained within the player subsystem is largely comprised of organisational concerns and not especially performance critical.
* the [[engine backbone|RenderBackbone]] is responsible for [[dispatching|FrameDispatcher]] the [[calculation stream|CalcStream]] and preparing individual calculation jobs