Hardware-genlock render clock (opt-in): a card's output VBI. More...
Detailed Description
Hardware-genlock render clock (opt-in): a card's output VBI.
The pull facet of the model. A dedicated tick thread blocks on an injected waitForNextTick (the card's WaitForOutputVerticalInterrupt for AJA, VHD_WaitSlotSent for Deltacast, ...) and, on each hardware tick, marshals the render callback onto owner's thread — score's render thread — via a blocking queued invoke (Qt::BlockingQueuedConnection). Blocking is deliberate: the next VBI wait only begins once the current frame has finished rendering, so render stays phase-locked to the card genlock and never bursts ahead of it. This is exactly how PacedFramePump marshals the submit side.
The pull facet is injected (a std::function) so this class carries no vendor SDK dependency — the AJA backend supplies its VBI wait, gfx stays SDK-free.
Contention note: the injected wait is generally a SECOND waiter on the same output VBI the submit pump already waits on. On the Linux AJA driver the VBI is a broadcast wait-queue (every waiter wakes per interrupt), so two waiters is safe; validate on any platform where the tick is an auto-reset event.
Thread-affinity contract for stop(): call it on owner's thread (or with that thread's event loop running). The tick thread may be parked in the blocking invoke waiting for the owner to run the functor; stop() pumps the owner's event queue so that in-flight invoke drains instead of dead-locking the join.
Public Member Functions | |
| ExternalGenlockClock (QObject *owner, std::function< bool()> waitForNextTick) | |
| Kind | kind () const noexcept override |
| void | start (std::function< void()> tick) override |
| Begin delivering ticks. | |
| void | stop () override |
| Stop delivering ticks and release the underlying tick source. | |
Additional Inherited Members | |
Public Types inherited from score::gfx::RenderClock | |
| enum class | Kind { Timer , DisplayVSync , ExternalGenlock } |
Constructor & Destructor Documentation
◆ ExternalGenlockClock()
| score::gfx::ExternalGenlockClock::ExternalGenlockClock | ( | QObject * | owner, |
| std::function< bool()> | waitForNextTick | ||
| ) |
- Parameters
-
owner QObject whose thread the render tick must run on (score's render thread). waitForNextTick blocking pull facet: returns true when a hardware tick (VBI) arrived, false on timeout (the loop re-checks running so stop() stays responsive).
Member Function Documentation
◆ kind()
|
inlineoverridevirtualnoexcept |
Implements score::gfx::RenderClock.
◆ start()
|
overridevirtual |
Begin delivering ticks.
tick is invoked once per render tick, on the render thread. The clock owns the tick source (timer, vsync registration, or hardware wait loop).
Implements score::gfx::RenderClock.
◆ stop()
|
overridevirtual |
Stop delivering ticks and release the underlying tick source.
Implements score::gfx::RenderClock.
The documentation for this class was generated from the following files:
- RenderClock.hpp
- RenderClock.cpp
Public Types inherited from