3#include <Gfx/Graph/Node.hpp>
4#include <Video/VideoEnums.hpp>
6#include <libavformat/avformat.h>
8#include <ossia/detail/mutex.hpp>
19class VideoNodeRenderer;
20class DirectVideoNodeRenderer;
26 std::atomic_int use_count{};
34 std::shared_ptr<RefcountedFrame> currentFrame()
const noexcept;
35 void updateCurrentFrame(AVFrame* frame);
36 void releaseFramesToFree();
37 void releaseAllFrames();
39 std::shared_ptr<Video::VideoInterface> m_decoder;
41 mutable std::mutex m_frameLock{};
42 std::shared_ptr<RefcountedFrame> m_currentFrame TS_GUARDED_BY(m_frameLock);
44 int64_t m_currentFrameIdx{};
46 std::vector<AVFrame*> m_framesToFree;
47 std::vector<std::shared_ptr<RefcountedFrame>> m_framesInFlight;
55 static AVFrame* nextFrame(
57 std::vector<AVFrame*>& framesToFree, AVFrame*& nextFrame);
59 bool mustReadVideoFrame(
const VideoNode& node);
65 QElapsedTimer m_timer;
66 AVFrame* m_nextFrame{};
67 double m_lastFrameTime{};
68 double m_lastPlaybackTime{-1.};
77 void setOutputFormat(::Video::OutputFormat s);
78 void setTonemap(::Video::Tonemap s);
87 ::Video::OutputFormat m_outputFormat{};
88 ::Video::Tonemap m_tonemap{};
98 std::shared_ptr<Video::VideoInterface> dec, std::optional<double> nativeTempo);
106 void process(
Message&& msg)
override;
107 void update()
override;
117 std::optional<double> m_nativeTempo;
119 QElapsedTimer m_timer;
120 std::atomic_bool m_pause{};
129class SCORE_PLUGIN_GFX_EXPORT CameraNode :
public VideoNodeBase
132 explicit CameraNode(std::shared_ptr<Video::ExternalInput> dec, QString filter = {});
134 virtual ~CameraNode();
138 void process(Message&& msg)
override;
139 void renderedNodesChanged()
override;
141 VideoFrameShare reader;
143 std::atomic_bool must_stop{};
146 friend VideoNodeRenderer;
Renderer for intra-only video codecs with instant seeking.
Definition DirectVideoNodeRenderer.hpp:47
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:176
List of nodes to be rendered to an output.
Definition RenderList.hpp:19
Definition VideoNode.hpp:73
Model for rendering a video.
Definition VideoNode.hpp:95
Definition VideoNodeRenderer.hpp:11
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:12
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:59
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:49
Definition VideoNode.hpp:24
Messages sent from the execution thread to the rendering thread.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:43
Definition VideoNode.hpp:51
Definition VideoNode.hpp:30