WIP draft the building of a render CalculationStream
This commit is contained in:
parent
8362145039
commit
76b24ce50d
5 changed files with 192 additions and 8 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
PlayProcess.hpp - state frame for an ongoing play/render process
|
||||
PlayProcess - state frame for an ongoing play/render process
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2011, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
|
||||
#include "proc/play/play-process.hpp"
|
||||
#include "proc/play/render-configurator.hpp"
|
||||
#include "lib/itertools.hpp"
|
||||
|
||||
//#include <string>
|
||||
|
|
@ -57,7 +58,8 @@ namespace play {
|
|||
if (!slot.isFree())
|
||||
throw error::State("unable to acquire a suitable output slot" /////////////////////TICKET #197 #816
|
||||
, LUMIERA_ERROR_CANT_PLAY);
|
||||
return Feed (port,slot);
|
||||
|
||||
return Feed (port,slot); //////////////////////////////////TODO: how to get the RenderConfigurator (strategy) here???
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -110,10 +112,9 @@ namespace play {
|
|||
|
||||
|
||||
/** */
|
||||
Feed::Feed (ModelPort port, OutputSlot& output)
|
||||
{
|
||||
UNIMPLEMENTED("build an active playback/render feed");
|
||||
}
|
||||
Feed::Feed (ModelPort port, OutputSlot& output, RenderConfigurator& renderStrategy)
|
||||
: renderStreams_(renderStrategy.buildCalculationStreams(port,output))
|
||||
{ }
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -83,6 +83,10 @@ namespace play {
|
|||
namespace error = lumiera::error;
|
||||
|
||||
|
||||
/** Strategy for configuring the render process */
|
||||
class RenderConfigurator;
|
||||
|
||||
|
||||
/**
|
||||
* Rendering data feed, corresponding to a single
|
||||
* global pipe and to be delivered into a single OutputSlot.
|
||||
|
|
@ -95,7 +99,14 @@ namespace play {
|
|||
public:
|
||||
typedef lib::IterSource<Feed>::iterator Connections;
|
||||
|
||||
Feed (ModelPort, OutputSlot&);
|
||||
typedef std::vector<engine::CalcStream> RenderStreams;
|
||||
|
||||
RenderStreams renderStreams_;
|
||||
|
||||
/** building a Feed effectively involves the EngineService
|
||||
* to establish an actual rendering plan. Which is abstracted
|
||||
* here through the RenderConfigurator instance */
|
||||
Feed (ModelPort, OutputSlot&, RenderConfigurator&);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@
|
|||
* *****************************************************/
|
||||
|
||||
|
||||
#include "lib/error.hpp"
|
||||
#include "include/play-facade.h"
|
||||
#include "proc/play/play-service.hpp"
|
||||
#include "proc/play/play-process.hpp"
|
||||
#include "lib/util.hpp"
|
||||
|
|
@ -97,6 +99,7 @@ namespace play {
|
|||
void
|
||||
endProcess (PlayProcess* dyingProcess)
|
||||
{
|
||||
/////////////////////////////////////////////TICKET #867 : somehow ensure sane abort of all attached calculation efforts
|
||||
delete dyingProcess;
|
||||
|
||||
Lock sync(this);
|
||||
|
|
@ -114,7 +117,10 @@ namespace play {
|
|||
using lumiera::Play;
|
||||
|
||||
|
||||
PlayService::~PlayService() { }
|
||||
PlayService::~PlayService()
|
||||
{
|
||||
UNIMPLEMENTED ("block waiting for any ongoing play processes. Ensure the process table is empty -- OR -- hand it over to some kind of cleanup service");
|
||||
}
|
||||
|
||||
|
||||
/** bring up the global render- and playback service.
|
||||
|
|
|
|||
79
src/proc/play/render-configurator.cpp
Normal file
79
src/proc/play/render-configurator.cpp
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
RenderConfigurator - strategy to help building an actual render calculation stream
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2011, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
* *****************************************************/
|
||||
|
||||
|
||||
#include "proc/play/render-configurator.hpp"
|
||||
#include "proc/engine/engine-service.hpp"
|
||||
//#include "lib/itertools.hpp"
|
||||
|
||||
//#include <string>
|
||||
//#include <memory>
|
||||
//#include <tr1/functional>
|
||||
//#include <boost/scoped_ptr.hpp>
|
||||
|
||||
|
||||
|
||||
namespace proc {
|
||||
namespace play {
|
||||
|
||||
// using std::string;
|
||||
// using lumiera::Subsys;
|
||||
// using std::auto_ptr;
|
||||
// using boost::scoped_ptr;
|
||||
// using std::tr1::bind;
|
||||
|
||||
|
||||
namespace { // Implementation details...
|
||||
|
||||
// using std::tr1::bind;
|
||||
// using std::tr1::function;
|
||||
// using std::tr1::placeholders::_1;
|
||||
// using lib::transform;
|
||||
|
||||
class DefaultRenderProcessBuilder
|
||||
: public RenderConfigurator
|
||||
{
|
||||
|
||||
RenderStreams
|
||||
buildCalculationStreams (ModelPort port, OutputSlot& output)
|
||||
{
|
||||
UNIMPLEMENTED("build an active playback/render feed");
|
||||
|
||||
///TODO allocate the output slot
|
||||
///TODO extract the individual channels
|
||||
///TODO get the timings
|
||||
|
||||
engine::EngineService::instance().calculate(port, nominalTimings, activeOutputConnection, serviceQuality);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // (End) hidden service impl details
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** */
|
||||
|
||||
|
||||
}} // namespace proc::play
|
||||
87
src/proc/play/render-configurator.hpp
Normal file
87
src/proc/play/render-configurator.hpp
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
RENDER-CONFIGURATOR.hpp - strategy to help building an actual render calculation stream
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2011, Hermann Vosseler <Ichthyostega@web.de>
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
/** @file render-configurator.hpp
|
||||
** Strategy holding all the detail knowledge necessary to establish
|
||||
** a running render CalculationStream.
|
||||
**
|
||||
** @see engine::EngineService
|
||||
** @see engine::Feed
|
||||
** @see engine::PlayService
|
||||
*/
|
||||
|
||||
|
||||
#ifndef PROC_PLAY_RENDER_CONFIGURATOR_H
|
||||
#define PROC_PLAY_RENDER_CONFIGURATOR_H
|
||||
|
||||
|
||||
#include "lib/error.hpp"
|
||||
//#include "include/dummy-player-facade.h"
|
||||
//#include "include/display-facade.h"
|
||||
//#include "common/instancehandle.hpp"
|
||||
//#include "lib/singleton-ref.hpp"
|
||||
#include "proc/mobject/model-port.hpp"
|
||||
//#include "proc/play/output-manager.hpp"
|
||||
//#include "lib/iter-source.hpp"
|
||||
//#include "lib/util.hpp"
|
||||
//
|
||||
//#include <boost/noncopyable.hpp>
|
||||
//#include <boost/scoped_ptr.hpp>
|
||||
//#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace proc {
|
||||
namespace play {
|
||||
|
||||
// using std::string;
|
||||
// using lumiera::Subsys;
|
||||
// using lumiera::Display;
|
||||
// using lumiera::DummyPlayer;
|
||||
// using util::isnil;
|
||||
using proc::mobject::ModelPort;
|
||||
|
||||
// typedef proc::play::POutputManager POutputManager;
|
||||
// typedef lib::IterSource<ModelPort>::iterator ModelPorts;
|
||||
|
||||
namespace error = lumiera::error;
|
||||
|
||||
|
||||
/** Strategy for configuring the render process */
|
||||
class RenderConfigurator
|
||||
{
|
||||
|
||||
public:
|
||||
virtual ~RenderConfigurator(); ///< this is an interface
|
||||
|
||||
|
||||
typedef std::vector<engine::CalcStream> RenderStreams; ////TODO this belongs rather into class Feed
|
||||
|
||||
virtual RenderStreams buildCalculationStreams (ModelPort, OutputSlot&) =0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
}} // namespace proc::play
|
||||
#endif
|
||||
Loading…
Reference in a new issue