3#include <Gfx/Graph/Node.hpp>
5#include <libavformat/avformat.h>
7#include <ossia/detail/mutex.hpp>
18class VideoNodeRenderer;
19class DirectVideoNodeRenderer;
25 std::atomic_int use_count{};
33 std::shared_ptr<RefcountedFrame> currentFrame()
const noexcept;
34 void updateCurrentFrame(AVFrame* frame);
35 void releaseFramesToFree();
36 void releaseAllFrames();
38 std::shared_ptr<Video::VideoInterface> m_decoder;
40 mutable std::mutex m_frameLock{};
41 std::shared_ptr<RefcountedFrame> m_currentFrame TS_GUARDED_BY(m_frameLock);
43 int64_t m_currentFrameIdx{};
45 std::vector<AVFrame*> m_framesToFree;
46 std::vector<std::shared_ptr<RefcountedFrame>> m_framesInFlight;
54 static AVFrame* nextFrame(
56 std::vector<AVFrame*>& framesToFree, AVFrame*& nextFrame);
58 bool mustReadVideoFrame(
const VideoNode& node);
64 QElapsedTimer m_timer;
65 AVFrame* m_nextFrame{};
66 double m_lastFrameTime{};
67 double m_lastPlaybackTime{-1.};
93 std::shared_ptr<Video::VideoInterface> dec, std::optional<double> nativeTempo);
101 void process(
Message&& msg)
override;
102 void update()
override;
112 std::optional<double> m_nativeTempo;
114 QElapsedTimer m_timer;
115 std::atomic_bool m_pause{};
124class SCORE_PLUGIN_GFX_EXPORT CameraNode :
public VideoNodeBase
127 explicit CameraNode(std::shared_ptr<Video::ExternalInput> dec, QString filter = {});
129 virtual ~CameraNode();
133 void process(Message&& msg)
override;
134 void renderedNodesChanged()
override;
136 VideoFrameShare reader;
138 std::atomic_bool must_stop{};
141 friend VideoNodeRenderer;
Renderer for intra-only video codecs with instant seeking.
Definition DirectVideoNodeRenderer.hpp:35
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:72
Model for rendering a video.
Definition VideoNode.hpp:90
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:41
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:49
Definition VideoNode.hpp:23
Messages sent from the execution thread to the rendering thread.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:43
Definition VideoNode.hpp:50
Definition VideoNode.hpp:29