30 #ifndef STEAM_PLAY_DIAGNOSTIC_OUTPUT_SLOT_H 31 #define STEAM_PLAY_DIAGNOSTIC_OUTPUT_SLOT_H 53 #include <unordered_set> 80 Symbol gridID(
"DiagnosticOutputSlot-buffer-grid");
82 PGrid testGrid25 = query4grid.getAdvice();
103 typedef std::unordered_set<FrameID> FrameTrackingInfo;
109 FrameTrackingInfo frameTrackingIndex_;
116 trackFrame (FrameID frameNr,
BuffHandle const& newBuffer)
118 TRACE (
test,
"Con=%p : track buffer %zu for frame-#%lu" 119 ,
this, newBuffer.entryID(), frameNr);
120 REQUIRE (!contains (frameTrackingIndex_,frameNr),
121 "attempt to lock already used frame %lu", frameNr);
123 frameTrackingIndex_.insert (frameNr);
128 deadlineFor (FrameID frameNr)
132 return frameGrid_->timeOf (frameNr);
141 claimBufferFor(FrameID frameNr)
143 TRACE (
test,
"Con=%p : lock buffer for frame-#%lu",
this, frameNr);
146 return trackFrame (frameNr,
152 isTimely (FrameID frameNr,
TimeValue currentTime)
154 TRACE (
test,
"Con=%p : timely? frame-#%lu" 160 return currentTime < deadlineFor (frameNr);
166 TRACE (
test,
"Con=%p : transfer buffer %zu" 167 ,
this, filledBuffer.entryID());
170 pushout (filledBuffer);
198 , frameTrackingIndex_()
199 , frameGrid_(getTestTimeGrid())
202 INFO (engine_dbg,
"building in-memory diagnostic output sequence (at %p)",
this);
208 INFO (engine_dbg,
"releasing diagnostic output sequence (at %p)",
this);
215 accessEmittedFrame (uint frameNr)
const 217 if (frameNr < buffProvider_.emittedCnt())
218 return & accessFrame(frameNr);
224 accessEmittedBuffer (uint bufferNr)
const 226 if (bufferNr < buffProvider_.emittedCnt())
227 return & accessBlock(bufferNr);
233 wasAllocated (uint frameNr)
const 235 TRACE (
test,
"query wasAllocated. Con=%p",
this);
237 return contains (frameTrackingIndex_, frameNr);
242 accessFrame (uint frameNr)
const 244 return unConst(
this)->buffProvider_.accessAs<
TestFrame> (frameNr);
248 accessBlock (uint bufferNr)
const 250 return unConst(
this)->buffProvider_.access_emitted (bufferNr);
279 static const uint MAX_CHANNELS = 5;
297 :
public ConnectionManager<TrackingInMemoryBlockSequence>
299 typedef ConnectionManager<TrackingInMemoryBlockSequence> _Base;
302 buildConnection(ConnectionStorage storage)
322 getOutputChannelCount());
335 REQUIRE (!isFree(),
"diagnostic OutputSlot not (yet) connected");
336 REQUIRE (channel <= getOutputChannelCount());
378 REQUIRE (0 == currentFrame_);
379 return outSeq_.accessEmittedFrame (currentFrame_);
386 pos = outSeq_.accessEmittedFrame(currentFrame_);
396 typedef OutputFramesLog::iterator OutFrames;
400 getChannel (uint channel)
402 REQUIRE (channel < MAX_CHANNELS);
403 return OutputFramesLog::build(
405 accessSequence(channel)));
410 frame_was_allocated (uint channel, FrameID nominalFrame)
412 return accessSequence(channel)
413 .wasAllocated(nominalFrame);
418 output_was_emitted (uint channel, FrameID outputFrame)
421 .accessEmittedBuffer(outputFrame);
423 && block->was_used();
428 output_was_closed (uint channel, FrameID outputFrame)
431 .accessEmittedBuffer(outputFrame);
433 && 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.
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.
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...
An opaque descriptor to identify the type and further properties of a data buffer.
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.
BuffHandle lockBuffer(BufferDescriptor const &)
BufferProvider API: retrieve a single buffer for exclusive use.
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
BufferDescriptor getDescriptor()
define a "buffer type" for automatically creating an instance of the template type embedded into the ...