Loading...
Searching...
No Matches
score::gfx::DirectVideoOutputBackend Struct Referenceabstract

Vendor playout backend. Constructed with its vendor-specific settings (video format, pixel format, channel, link, HDR, ...); open() then brings the device up. The node queries geometry/format/planes and drives playout through the registrar + GPU-direct candidates + pacing hooks. More...

Detailed Description

Vendor playout backend. Constructed with its vendor-specific settings (video format, pixel format, channel, link, HDR, ...); open() then brings the device up. The node queries geometry/format/planes and drives playout through the registrar + GPU-direct candidates + pacing hooks.

Public Types

using CustomStage = std::function< bool(const std::uint8_t *src, int srcRowBytes, std::uint8_t *dst, int dstRowBytes, int rows)>
 

Public Member Functions

virtual bool open (GraphicsApi api)=0
 
virtual int width () const noexcept=0
 Negotiated raster geometry (the QRhi scene texture is sized to this).
 
virtual int height () const noexcept=0
 
virtual double frameRate () const noexcept=0
 Frame rate (Hz) — drives the node's manual rendering rate.
 
virtual bool isOpen () const noexcept=0
 True once open() has succeeded (drives canRender()).
 
virtual interop::VideoPixelFormat wireFormat () const noexcept=0
 The on-wire pixel format the card framestore expects (-> makeWireEncoder).
 
virtual interop::VideoPixelFormat encoderFormat () const noexcept
 
virtual bool prefersFloatRender () const noexcept
 
virtual QString colorConversion () const =0
 
virtual std::uint32_t frameByteSize () const noexcept=0
 
virtual int visibleRows () const noexcept=0
 
virtual std::vector< interop::HostStagedPlaneplanes () const =0
 
virtual interop::VendorDmaRegistrar registrar ()=0
 
virtual CustomStage customStage ()
 
virtual interop::FrameMemoryProvider frameMemoryProvider ()
 
virtual bool prefersGpuDownload () const noexcept
 
virtual std::vector< std::function< std::unique_ptr< interop::VideoOutputStrategy >()> > gpuDirectCandidates (QRhi *rhi, GraphicsApi api)=0
 
virtual interop::PacedFramePump::Hooks pacingHooks ()=0
 
virtual std::function< bool()> genlockTickSource ()
 
virtual void quiesce ()
 
virtual void close ()=0
 Tear down the device (stop AutoCirculate/streams, restore task mode, close).
 

Member Typedef Documentation

◆ CustomStage

using score::gfx::DirectVideoOutputBackend::CustomStage = std::function<bool( const std::uint8_t* src, int srcRowBytes, std::uint8_t* dst, int dstRowBytes, int rows)>

CPU-pack hook signature (v210 non-mod-6, 2SI->SQD, byte-swap), matching CpuStagedVideoOutputConfig::customStage.

Member Function Documentation

◆ colorConversion()

virtual QString score::gfx::DirectVideoOutputBackend::colorConversion ( ) const
pure virtual

The RGB->wire colour-conversion shader fragment (e.g. score::gfx:: colorMatrixOut(...)) for the active colour space / HDR mode.

◆ customStage()

virtual CustomStage score::gfx::DirectVideoOutputBackend::customStage ( )
inlinevirtual

Optional CPU pack applied before DMA (v210 non-mod-6, UHD 2SI->SQD, byte swap). Empty = plain row-stride copy.

◆ encoderFormat()

virtual interop::VideoPixelFormat score::gfx::DirectVideoOutputBackend::encoderFormat ( ) const
inlinevirtualnoexcept

The pixel format the GPU encoder should produce. Equals wireFormat() unless a CPU repack bridges them (e.g. AJA v210 at non-mod-6 widths emits UYVY on the GPU and packs to v210 in customStage). Default: wireFormat().

◆ frameByteSize()

virtual std::uint32_t score::gfx::DirectVideoOutputBackend::frameByteSize ( ) const
pure virtualnoexcept

Total framestore byte size (accounts for stride padding) and the number of visible rows to copy; plus the per-plane geometry for CpuStagedVideoOutput.

◆ frameMemoryProvider()

virtual interop::FrameMemoryProvider score::gfx::DirectVideoOutputBackend::frameMemoryProvider ( )
inlinevirtual

Vendor frame memory the GPU can write encoded frames into directly (CpuStagedVideoOutput's direct-readback mode via RhiTextureReadback): acquire() returns the card's next free pooled output frame's bytes. A pointer handed out here comes back either through pacingHooks().submit (schedule that very frame, no copy) or through pacingHooks().discard / cancel (frame dropped — return it to the pool). Empty (default) keeps the host-staged ring + submit-side copy.

◆ genlockTickSource()

virtual std::function< bool()> score::gfx::DirectVideoOutputBackend::genlockTickSource ( )
inlinevirtual

Optional external-genlock tick source (opt-in): a blocking wait that returns true on the next hardware output tick (card VBI), false on timeout. Empty (default) => no hardware genlock available; the node keeps its timer clock. Consumed by ExternalGenlockClock to phase-lock render to the card. This is usually a SECOND waiter on the same output VBI as pacingHooks().waitForTick — safe where the VBI is a broadcast wait-queue (Linux AJA); validate for auto-reset-event platforms.

◆ gpuDirectCandidates()

virtual std::vector< std::function< std::unique_ptr< interop::VideoOutputStrategy >()> > score::gfx::DirectVideoOutputBackend::gpuDirectCandidates ( QRhi *  rhi,
GraphicsApi  api 
)
pure virtual

GPU-direct output strategy candidates for the active graphics API, in priority order (DVP before zero-copy RDMA, etc). Empty => host-staged only. The node feeds these to selectVideoOutputStrategy().

◆ open()

virtual bool score::gfx::DirectVideoOutputBackend::open ( GraphicsApi  api)
pure virtual

Open the device + set the video standard, link/routing, VPID and HDR ANC. Called before the QRhi exists (the node sizes the QRhi to the negotiated geometry), so no QRhi here — api is for vendors that pick a topology by backend. Returns false on failure. Geometry/format/planes valid only after a true return.

◆ pacingHooks()

virtual interop::PacedFramePump::Hooks score::gfx::DirectVideoOutputBackend::pacingHooks ( )
pure virtual

Clock-paced submit hooks (wait on the output VBI / schedule-callback, card back-pressure, and the actual transfer of a frame pointer to the card). The node owns the PacedFramePump built from these.

◆ prefersFloatRender()

virtual bool score::gfx::DirectVideoOutputBackend::prefersFloatRender ( ) const
inlinevirtualnoexcept

Render the scene into an RGBA16F intermediate (true) instead of RGBA8, for >8-bit / HDR wire formats so the encoder sees real precision.

◆ prefersGpuDownload()

virtual bool score::gfx::DirectVideoOutputBackend::prefersGpuDownload ( ) const
inlinevirtualnoexcept

Prefer a GPU-direct (DVP) download in the host-staged path: the node lets CpuStagedVideoOutput DMA the encoder texture straight to a vendor-registered sysmem ring (skipping the QRhi readback) when a GPU-direct backend exists, falling back to CPU readback otherwise. Default false (AJA uses its own gpuDirectCandidates strategy instead). DeckLink opts in.

◆ quiesce()

virtual void score::gfx::DirectVideoOutputBackend::quiesce ( )
inlinevirtual

Stop the card from reading ANY application buffer, synchronously.

Called by DirectVideoOutputNode::destroyOutput() after the pump thread has stopped but BEFORE the GPU-direct strategy and host-staged ring are released. Backends whose submit path hands buffers to an asynchronous / retained queue (DeckLink ScheduleVideoFrame, Deltacast RDMA application- buffer slots) must stop streaming here and wait until the hardware has let go of every in-flight buffer — otherwise the node frees memory the card is still DMA-reading. Synchronous-submit vendors (AJA DMAWriteFrame) keep the default no-op. close() still runs afterwards and must tolerate quiesce() having already stopped the stream.

◆ registrar()

virtual interop::VendorDmaRegistrar score::gfx::DirectVideoOutputBackend::registrar ( )
pure virtual

Pin/unpin adapter for the staging ring (DMABufferLock / VirtualLock / bfAlloc-noop / VHD_CreateSlotEx). May be empty (no pinning).


The documentation for this struct was generated from the following files: