2#include <Gfx/Graph/NodeRenderer.hpp>
3#include <Gfx/Graph/VideoNode.hpp>
4#include <Video/VideoInterface.hpp>
11struct AVFormatContext;
18#include <libavutil/pixfmt.h>
29struct PixelFormatInfo;
61 void init(
RenderList& renderer, QRhiResourceUpdateBatch& res)
override;
62 void runRenderPass(
RenderList&, QRhiCommandBuffer& commands,
Edge& edge)
override;
63 void update(
RenderList& renderer, QRhiResourceUpdateBatch& res,
Edge* edge)
override;
69 RenderList& renderer,
Edge& edge, QRhiResourceUpdateBatch& res)
override;
81 bool seekAndDecode(int64_t flicks);
82 bool isSequentialRead(int64_t flicks)
const;
83 bool readNextPacketRaw();
84 bool readNextPacketAVCodec();
86 void createGpuDecoder(QRhi& rhi);
88 std::unique_ptr<GPUVideoDecoder> tryCreateZeroCopyDecoder(QRhi& rhi);
93 AVPixelFormat selectHardwareAcceleration(
95 bool setupHardwareDecoder(
96 const void* codec, AVPixelFormat hwPixFmt);
97 static enum AVPixelFormat negotiateHWFormat(
98 AVCodecContext* ctx,
const enum AVPixelFormat* pix_fmts);
99 void transferHWFrame();
102 std::string m_filePath;
105 double m_flicks_per_dts{};
106 double m_dts_per_flicks{};
107 bool m_useAVCodec{
true};
110 AVFormatContext* m_formatContext{};
111 AVCodecContext* m_codecContext{};
112 const void* m_codec{};
113 AVStream* m_avstream{};
114 AVFrame* m_decodedFrame{};
117 AVBufferRef* m_hwDeviceCtx{};
118 AVPixelFormat m_hwPixelFormat{AV_PIX_FMT_NONE};
119 AVPixelFormat m_hwSwFormat{AV_PIX_FMT_NONE};
120 std::vector<const char*> m_vkEnabledExtensions;
121 AVFrame* m_swTransferFrame{};
124 bool m_hwSwFormatChecked{
false};
125 bool m_zeroCopyFailed{
false};
126 bool m_sharedVulkanDevice{
false};
131 QRhiBuffer* m_processUBO{};
132 QRhiBuffer* m_materialUBO{};
136 float scale_w{}, scale_h{};
137 float tex_w{}, tex_h{};
140 std::unique_ptr<GPUVideoDecoder> m_gpu;
141 QShader m_cachedVertexShader;
142 QShader m_cachedFragmentShader;
145 int64_t m_lastRequestedFlicks{-1};
146 int64_t m_lastDecodedDts{INT64_MIN};
147 bool m_recomputeScale{
true};
Renderer for intra-only video codecs with instant seeking.
Definition DirectVideoNodeRenderer.hpp:47
bool hasOutputPassForEdge(Edge &edge) const override
Check if this renderer already has an output pass for the given edge.
Definition DirectVideoNodeRenderer.cpp:1492
void initState(RenderList &renderer, QRhiResourceUpdateBatch &res) override
Definition DirectVideoNodeRenderer.cpp:1263
void removeOutputPass(RenderList &renderer, Edge &edge) override
Definition DirectVideoNodeRenderer.cpp:1480
void addOutputPass(RenderList &renderer, Edge &edge, QRhiResourceUpdateBatch &res) override
Create a pass for a new output edge (pipeline, SRB, processUBO).
Definition DirectVideoNodeRenderer.cpp:1461
void releaseState(RenderList &renderer) override
Definition DirectVideoNodeRenderer.cpp:1498
Renderer for a given node.
Definition NodeRenderer.hpp:11
List of nodes to be rendered to an output.
Definition RenderList.hpp:30
Definition VideoNode.hpp:73
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:11
GraphicsApi
Available graphics APIs to use.
Definition RenderState.hpp:22
ScaleMode
How to resize a texture to adapt it to a viewport.
Definition Scale.hpp:10
Connection between two score::gfx::Port.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:103
Port of a score::gfx::Node.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:82
Useful abstraction for storing all the data related to a render target.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:152