21 #ifndef STEAM_PLAY_DIAGNOSTIC_OUTPUT_SLOT_H 22 #define STEAM_PLAY_DIAGNOSTIC_OUTPUT_SLOT_H 44 #include <unordered_set> 71 Symbol gridID(
"DiagnosticOutputSlot-buffer-grid");
73 PGrid testGrid25 = query4grid.getAdvice();
94 typedef std::unordered_set<FrameID> FrameTrackingInfo;
100 FrameTrackingInfo frameTrackingIndex_;
107 trackFrame (FrameID frameNr,
BuffHandle const& newBuffer)
109 TRACE (
test,
"Con=%p : track buffer %zu for frame-#%lu" 110 ,
this, newBuffer.entryID(), frameNr);
111 REQUIRE (!contains (frameTrackingIndex_,frameNr),
112 "attempt to lock already used frame %lu", frameNr);
114 frameTrackingIndex_.insert (frameNr);
119 deadlineFor (FrameID frameNr)
123 return frameGrid_->timeOf (frameNr);
132 claimBufferFor(FrameID frameNr)
134 TRACE (
test,
"Con=%p : lock buffer for frame-#%lu",
this, frameNr);
137 return trackFrame (frameNr,
143 isTimely (FrameID frameNr,
TimeValue currentTime)
145 TRACE (
test,
"Con=%p : timely? frame-#%lu" 151 return currentTime < deadlineFor (frameNr);
157 TRACE (
test,
"Con=%p : transfer buffer %zu" 158 ,
this, filledBuffer.entryID());
161 pushout (filledBuffer);
189 , frameTrackingIndex_()
190 , frameGrid_(getTestTimeGrid())
193 INFO (engine_dbg,
"building in-memory diagnostic output sequence (at %p)",
this);
199 INFO (engine_dbg,
"releasing diagnostic output sequence (at %p)",
this);
206 accessEmittedFrame (uint frameNr)
const 208 if (frameNr < buffProvider_.emittedCnt())
209 return & accessFrame(frameNr);
215 accessEmittedBuffer (uint bufferNr)
const 217 if (bufferNr < buffProvider_.emittedCnt())
218 return & accessBlock(bufferNr);
224 wasAllocated (uint frameNr)
const 226 TRACE (
test,
"query wasAllocated. Con=%p",
this);
228 return contains (frameTrackingIndex_, frameNr);
233 accessFrame (uint frameNr)
const 235 return unConst(
this)->buffProvider_.accessAs<
TestFrame> (frameNr);
239 accessBlock (uint bufferNr)
const 241 return unConst(
this)->buffProvider_.access_emitted (bufferNr);
270 static const uint MAX_CHANNELS = 5;
288 :
public ConnectionManager<TrackingInMemoryBlockSequence>
290 typedef ConnectionManager<TrackingInMemoryBlockSequence> _Base;
293 buildConnection(ConnectionStorage storage)
313 getOutputChannelCount());
326 REQUIRE (!isFree(),
"diagnostic OutputSlot not (yet) connected");
327 REQUIRE (channel <= getOutputChannelCount());
369 REQUIRE (0 == currentFrame_);
370 return outSeq_.accessEmittedFrame (currentFrame_);
377 pos = outSeq_.accessEmittedFrame(currentFrame_);
387 typedef OutputFramesLog::iterator OutFrames;
391 getChannel (uint channel)
393 REQUIRE (channel < MAX_CHANNELS);
394 return OutputFramesLog::build(
396 accessSequence(channel)));
401 frame_was_allocated (uint channel, FrameID nominalFrame)
403 return accessSequence(channel)
404 .wasAllocated(nominalFrame);
409 output_was_emitted (uint channel, FrameID outputFrame)
412 .accessEmittedBuffer(outputFrame);
414 && block->was_used();
419 output_was_closed (uint channel, FrameID outputFrame)
422 .accessEmittedBuffer(outputFrame);
424 && block->was_closed();
static const Time ANYTIME
border condition marker value. ANYTIME <= any time value
Helper for implementing a diagnostic BufferProvider: A block of heap allocated storage, with the capability to store some additional tracking information.
An (abstract) capability to send media data to an external output.
Access point for the advised entity (client).
TrackingInMemoryBlockSequence const & accessSequence(uint channel)
Mock data frame for simulated rendering.
void releaseBuffer(BuffHandle const &)
BufferProvider API: declare done and detach.
Framerate specified as frames per second.
Any copy and copy construction prohibited.
An opaque descriptor to identify the type and further properties of a data buffer.
This header is for including and configuring NoBug.
Steam-Layer implementation namespace root.
Managing lifecycle for a collection of objects.
Simple vector based collection of pointers, managing lifecycle of the pointed-to objects.
ConnectionState * buildState()
hook into the OutputSlot frontend
Token or Atom with distinct identity.
Iteration source interface to abstract a data source, which then can be accessed through IterAdapter ...
Helper for unit tests: Mock output sink.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
Expecting Advice and giving Advice: a cross-cutting collaboration of loosely coupled participants...
Base for OutputSlot standard implementation.
BuffDescr getDescriptor(ARGS ...args)
define a "buffer type" for automatically creating an instance of the template type embedded into the ...
Extension point for Implementation.
Marker types to indicate a literal string and a Symbol.
Dummy implementation of the BufferProvider interface to support writing unit tests.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
BuffHandle lockBuffer(BuffDescr const &)
BufferProvider API: retrieve a single buffer for exclusive use.
Interface for concrete output implementations to talk to the OutputSlot frontend. ...
Special diagnostic connection state implementation, establishing diagnostic output connections for ea...
A front-end to support the buffer management within the render nodes.
simple BufferProvider implementation with additional allocation tracking.
Lumiera error handling (C++ interface).
Interface: Generic output sink.
Handle for a buffer for processing data, abstracting away the actual implementation.
To establish a reference scale for quantised time values.
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
void emitBuffer(BuffHandle const &)
BufferProvider API: state transition to emitted state.
static OutputSlot & build()
build a new Diagnostic Output Slot instance, discard the existing one.
a family of time value like entities and their relationships.
Unit test helper to generate fake test data frames.
uint getOutputChannelCount()
Extension module to build an opaque data source, accessible as Lumiera Forward Iterator.
basic constant internal time value.
T & manage(T *obj)
take ownership of the given object, adding it at the end of the collection
virtual Pos firstResult() override
iteration start: prepare the first element.
Diagnostic output connection for a single channel, allowing to track generated frames and verify the ...
diagnostic facility to verify test data frames written to this Test/Dummy "output".
virtual void nextResult(Pos &pos) override
iteration step: switch on to the next element.
static const FrameRate PAL
predefined constant for PAL framerate
bool contains(SEQ const &cont, typename SEQ::const_reference val)
shortcut for brute-force containment test in any sequential container