Loading...
Searching...
No Matches
DirectVideoOutputBackend.hpp
Go to the documentation of this file.
1#pragma once
2
23#include <Gfx/Graph/RenderState.hpp> // GraphicsApi
25#include <Gfx/Graph/interop/CpuStagedVideoOutput.hpp> // HostStagedPlane
29
30#include <score_plugin_gfx_export.h>
31
32#include <QString>
33
34#include <cstdint>
35#include <functional>
36#include <memory>
37#include <vector>
38
39class QRhi;
40class QRhiTexture;
41
42namespace score::gfx
43{
44
52struct SCORE_PLUGIN_GFX_EXPORT DirectVideoOutputBackend
53{
56 using CustomStage = std::function<bool(
57 const std::uint8_t* src, int srcRowBytes, std::uint8_t* dst,
58 int dstRowBytes, int rows)>;
59
61
67 virtual bool open(GraphicsApi api) = 0;
68
70 virtual int width() const noexcept = 0;
71 virtual int height() const noexcept = 0;
72
74 virtual double frameRate() const noexcept = 0;
75
77 virtual bool isOpen() const noexcept = 0;
78
80 virtual interop::VideoPixelFormat wireFormat() const noexcept = 0;
81
85 virtual interop::VideoPixelFormat encoderFormat() const noexcept
86 {
87 return wireFormat();
88 }
89
92 virtual bool prefersFloatRender() const noexcept { return false; }
93
96 virtual QString colorConversion() const = 0;
97
100 virtual std::uint32_t frameByteSize() const noexcept = 0;
101 virtual int visibleRows() const noexcept = 0;
102 virtual std::vector<interop::HostStagedPlane> planes() const = 0;
103
106 virtual interop::VendorDmaRegistrar registrar() = 0;
107
110 virtual CustomStage customStage() { return {}; }
111
120
126 virtual bool prefersGpuDownload() const noexcept { return false; }
127
131 virtual std::vector<std::function<std::unique_ptr<interop::VideoOutputStrategy>()>>
132 gpuDirectCandidates(QRhi* rhi, GraphicsApi api) = 0;
133
138
146 virtual std::function<bool()> genlockTickSource() { return {}; }
147
159 virtual void quiesce() { }
160
162 virtual void close() = 0;
163};
164
165} // namespace score::gfx
Vendor-neutral host-staged video OUTPUT helper.
Vendor-neutral VBI/clock-paced frame submission.
Vendor-supplied pin / unpin callbacks shared by the GPU-direct and host-staged output helpers.
Vendor-neutral interface for GPU-direct video OUTPUT strategies.
Vendor-neutral pixel format vocabulary + descriptive metadata.
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:11
GraphicsApi
Available graphics APIs to use.
Definition RenderState.hpp:22
STL namespace.
Vendor playout backend. Constructed with its vendor-specific settings (video format,...
Definition DirectVideoOutputBackend.hpp:53
virtual bool open(GraphicsApi api)=0
virtual interop::FrameMemoryProvider frameMemoryProvider()
Definition DirectVideoOutputBackend.hpp:119
virtual int width() const noexcept=0
Negotiated raster geometry (the QRhi scene texture is sized to this).
virtual std::uint32_t frameByteSize() const noexcept=0
virtual bool prefersGpuDownload() const noexcept
Definition DirectVideoOutputBackend.hpp:126
virtual void close()=0
Tear down the device (stop AutoCirculate/streams, restore task mode, close).
virtual void quiesce()
Definition DirectVideoOutputBackend.hpp:159
std::function< bool(const std::uint8_t *src, int srcRowBytes, std::uint8_t *dst, int dstRowBytes, int rows)> CustomStage
Definition DirectVideoOutputBackend.hpp:58
virtual interop::PacedFramePump::Hooks pacingHooks()=0
virtual std::function< bool()> genlockTickSource()
Definition DirectVideoOutputBackend.hpp:146
virtual std::vector< std::function< std::unique_ptr< interop::VideoOutputStrategy >()> > gpuDirectCandidates(QRhi *rhi, GraphicsApi api)=0
virtual bool prefersFloatRender() const noexcept
Definition DirectVideoOutputBackend.hpp:92
virtual QString colorConversion() const =0
Vendor destination-frame memory for the direct-readback mode.
Definition CpuStagedVideoOutput.hpp:118
Definition PacedFramePump.hpp:58