diff --git a/src/proc/play/output-slot.hpp b/src/proc/play/output-slot.hpp index 860232b1f..3b34a1fa1 100644 --- a/src/proc/play/output-slot.hpp +++ b/src/proc/play/output-slot.hpp @@ -83,6 +83,7 @@ namespace play { using proc::engine::BuffHandle; using proc::engine::BufferProvider; using lib::time::TimeValue; + using lib::time::Time; using boost::scoped_ptr; diff --git a/src/proc/play/play-service.cpp b/src/proc/play/play-service.cpp index 2c359c08e..580b0e6a4 100644 --- a/src/proc/play/play-service.cpp +++ b/src/proc/play/play-service.cpp @@ -187,7 +187,7 @@ namespace play { Play::Controller PlayService::connect (ModelPorts dataGenerators, POutputManager outputPossibilities) { - Timings playbackTimings; //////////////////////////////////////////////////////////////////////TICKET #875 + Timings playbackTimings (lib::time::FrameRate::PAL); //////////////////////////////////////////////////////TICKET #875 return pTable_->establishProcess( PlayProcess::initiate(dataGenerators, diff --git a/src/proc/play/timings.cpp b/src/proc/play/timings.cpp new file mode 100644 index 000000000..d5e1dd7b1 --- /dev/null +++ b/src/proc/play/timings.cpp @@ -0,0 +1,65 @@ +/* + Timings - timing specifications for a frame quantised data stream + + Copyright (C) Lumiera.org + 2012, Hermann Vosseler + + 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/timings.hpp" +#include "lib/time/formats.hpp" +#include "lib/time/timequant.hpp" + + + +namespace proc { +namespace play { + + + using lib::time::PQuant; + + namespace { // hidden local details of the service implementation.... + + inline PQuant + buildStandardGridForFramerate (FrameRate fps) + { + return PQuant (new lib::time::FixedFrameQuantiser (fps)); + } //////TODO maybe caching these quantisers? they are immutable and threadsafe + + + } // (End) hidden service impl details + + + /** Create a default initialised Timing constraint record. + * Using the standard optimistic settings for most values, + * no latency, no special requirements. The frame grid is + * rooted at the "natural" time origin; it is not related + * in any way to the current session. + * @remarks this ctor is intended rather for testing purposes! + * Usually, when creating a play/render process, + * the actual timings \em are related to the timeline + * and the latency/speed requirements of the output. + */ + Timings::Timings (FrameRate fps) + : grid_(buildStandardGridForFramerate(fps)) + , playbackUrgency (ASAP) + { } + + + +}} // namespace proc::play diff --git a/src/proc/play/timings.hpp b/src/proc/play/timings.hpp index d40e23a54..3ce908826 100644 --- a/src/proc/play/timings.hpp +++ b/src/proc/play/timings.hpp @@ -53,20 +53,30 @@ //#include //#include //#include -//#include +#include //#include +namespace lib { +namespace time{ + class Quantiser; +}} namespace proc { namespace play { - using lib::time::Time; + using lib::time::FrameRate; + using lib::time::TimeValue; //using std::string; //using std::vector; //using std::tr1::shared_ptr; //using boost::scoped_ptr; + enum PlaybackUrgency { + ASAP, + NICE, + TIMEBOUND + }; @@ -80,7 +90,21 @@ namespace play { */ class Timings { + typedef std::tr1::shared_ptr PQuant; + + PQuant grid_; + public: + PlaybackUrgency playbackUrgency; + + Timings (FrameRate fps); + + // default copy acceptable + + TimeValue getOrigin(); + + FrameRate getFrameRate(); + //////////////TODO further accessor functions here diff --git a/tests/components/proc/engine/engine-interface-test.cpp b/tests/components/proc/engine/engine-interface-test.cpp index 0345b0334..7f7b6ea59 100644 --- a/tests/components/proc/engine/engine-interface-test.cpp +++ b/tests/components/proc/engine/engine-interface-test.cpp @@ -31,6 +31,7 @@ #include "proc/play/diagnostic-output-slot.hpp" #include "proc/mobject/model-port.hpp" #include "proc/asset/pipe.hpp" +#include "lib/time/timevalue.hpp" //#include //#include @@ -50,6 +51,7 @@ namespace test { using mobject::ModelPort; using proc::play::OutputSlot; using proc::play::DiagnosticOutputSlot; + using lib::time::FrameRate; typedef asset::ID PID; typedef OutputSlot::Allocation Allocation; @@ -94,7 +96,7 @@ namespace test { OutputSlot& oSlot = DiagnosticOutputSlot::build(); Allocation& output = oSlot.allocate(); - Timings timings; /////////TODO + Timings timings (FrameRate::PAL); /////////TODO // Invoke test subject... CalcStreams calc = engine.calculate(port, timings, output); diff --git a/tests/components/proc/play/timing-constraints-test.cpp b/tests/components/proc/play/timing-constraints-test.cpp index d11fdde2e..16e8fbcc5 100644 --- a/tests/components/proc/play/timing-constraints-test.cpp +++ b/tests/components/proc/play/timing-constraints-test.cpp @@ -24,6 +24,7 @@ #include "lib/test/run.hpp" #include "proc/play/timings.hpp" +#include "lib/time/timevalue.hpp" //#include "proc/engine/buffhandle.hpp" //#include "proc/engine/testframe.hpp" //#include "lib/time/control.hpp" @@ -34,8 +35,9 @@ namespace proc { namespace play { namespace test { - namespace time = lib::time; - + using lib::time::Time; + using lib::time::FrameRate; + //using proc::engine::BuffHandle; //using proc::engine::test::testData; //using proc::engine::test::TestFrame; @@ -63,7 +65,12 @@ namespace test { void define_basicTimingConstraints() { + Timings timings (FrameRate::PAL); + #if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #831 + CHECK (Time::ZERO == timings.getOrigin()); + CHECK (FrameRate::PAL == timings.getFrameRate()); + CHECK (ASAP == timings.playbackUrgency); #endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #831 } }; diff --git a/tests/lib/time/time-quantisation-test.cpp b/tests/lib/time/time-quantisation-test.cpp index 32b57a355..9cda288d3 100644 --- a/tests/lib/time/time-quantisation-test.cpp +++ b/tests/lib/time/time-quantisation-test.cpp @@ -154,7 +154,7 @@ namespace test{ checkGridBinding (TimeValue org) { // refer to a grid not yet defined - VERIFY_ERROR (UNKNOWN_GRID, QuTime wired(org, "special_funny_grid")); + VERIFY_ERROR (UNKNOWN_GRID, QuTime weird(org, "special_funny_grid")); TimeGrid::build("special_funny_grid", 1); // provide the grid's definition (1 frame per second) diff --git a/wiki/renderengine.html b/wiki/renderengine.html index 990184f0e..d47cf0f25 100644 --- a/wiki/renderengine.html +++ b/wiki/renderengine.html @@ -7468,7 +7468,7 @@ Actually, what the GUI creates and uses is the //view// of a given timeline. Thi To complement this possibilities, I'd propose to give the //timeline view// the possibility to be re-linked to a sub-sequence. This way, it would stay connected to the main play control, but at the same time show a sub-sequence //in the way it will be treated as embedded// within the top-level sequence. This would be the default operation mode when a meta-clip is opened (and showed in a separate tab with such a linked timeline view). The reason for this proposed handling is again to give the user the least surprising behaviour. Because, when — on the contrary — the sub-sequence would be opened as //separate timeline,// a different absolute time position and a different signal routing may result; doing such should be reserved for advanced use, e.g. when multiple editors cooperate on a single project and a sequence has to be prepared in isolation prior to being integrated in the global sequence (featuring the whole movie). -
+
//Timing constraints of a render or playback process.//
 
 !design quest {{red{WIP 1/2012}}}
@@ -7480,7 +7480,9 @@ The Timings record is used at various places at the engine interface level. Up t
 * besides, it's clear that the Timings record is consulted to find out about latency
 * question: do we need a relation to wall-clock time?
 
-
+!where are the timings definied? +Timing constraint records are used at various places within the engine. Basically we need such a timings record for starting any kind of playback or render. +The effective timings are established when //allocating an OutputSlot// -- based on the timings defined for the ModelPort to //perform,// i.e. the global bus to render.
Tracks are just a structure used to organize the Media Objects within the Sequence. Tracks are associated allways to a specific Sequence and the Tracks of an Sequence form a //tree.// They can be considered to be an organizing grid, and besides that, they have no special meaning. They are grouping devices, not first-class entities. A track doesn't "have" a port or pipe or "is" a video track and the like; it can be configured to behave in such manner by using placements.