3#include <Gfx/Graph/Node.hpp>
4#include <Video/VideoEnums.hpp>
6#include <libavformat/avformat.h>
8#include <ossia/detail/mutex.hpp>
20class VideoNodeRenderer;
21class DirectVideoNodeRenderer;
27 std::atomic_int use_count{};
35 std::shared_ptr<RefcountedFrame> currentFrame()
const noexcept;
36 void updateCurrentFrame(AVFrame* frame);
37 void releaseFramesToFree();
38 void releaseAllFrames();
40 std::shared_ptr<Video::VideoInterface> m_decoder;
42 mutable std::mutex m_frameLock{};
43 std::shared_ptr<RefcountedFrame> m_currentFrame TS_GUARDED_BY(m_frameLock);
45 int64_t m_currentFrameIdx{};
47 std::vector<AVFrame*> m_framesToFree;
48 std::vector<std::shared_ptr<RefcountedFrame>> m_framesInFlight;
59 static AVFrame* nextFrame(
61 std::vector<AVFrame*>& framesToFree, AVFrame*& nextFrame,
bool showing);
63 bool mustReadVideoFrame(
const VideoNode& node);
69 QElapsedTimer m_timer;
70 AVFrame* m_nextFrame{};
71 double m_lastFrameTime{};
72 double m_lastPlaybackTime{-1.};
77 int m_backwardSeekGeneration{-1};
78 double m_earliestFrameTime{std::numeric_limits<double>::infinity()};
86 void setOutputFormat(::Video::OutputFormat s);
87 void setTonemap(::Video::Tonemap s);
88 void setDecodingSettings(QString hardwareDecode,
int threads);
97 ::Video::OutputFormat m_outputFormat{};
98 ::Video::Tonemap m_tonemap{};
102 int m_decodingThreads{};
112 std::shared_ptr<Video::VideoInterface> dec, std::optional<double> nativeTempo);
120 void process(
Message&& msg)
override;
121 void update()
override;
131 std::optional<double> m_nativeTempo;
133 QElapsedTimer m_timer;
136 std::atomic_bool m_pause{};
145class SCORE_PLUGIN_GFX_EXPORT CameraNode :
public VideoNodeBase
148 explicit CameraNode(std::shared_ptr<Video::ExternalInput> dec, QString filter = {});
150 virtual ~CameraNode();
154 void process(Message&& msg)
override;
155 void renderedNodesChanged()
override;
157 VideoFrameShare reader;
159 std::atomic_bool must_stop{};
162 friend VideoNodeRenderer;
Renderer for intra-only video codecs with instant seeking.
Definition DirectVideoNodeRenderer.hpp:50
Renderer for a given node.
Definition NodeRenderer.hpp:11
Common base class for nodes that map to score processes.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:216
List of nodes to be rendered to an output.
Definition RenderList.hpp:33
Definition VideoNode.hpp:82
QString m_hardwareDecode
Definition VideoNode.hpp:101
Model for rendering a video.
Definition VideoNode.hpp:109
Definition VideoNodeRenderer.hpp:88
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:11
PlaybackMode
How to choose the video renderer.
Definition Scale.hpp:21
ScaleMode
How to resize a texture to adapt it to a viewport.
Definition Scale.hpp:10
Definition VideoInterface.hpp:91
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:51
Definition VideoNode.hpp:25
Messages sent from the execution thread to the rendering thread.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:45
Definition VideoNode.hpp:52
Definition VideoNode.hpp:31