3#include <Gfx/Graph/Node.hpp>
5#include <libavformat/avformat.h>
7#include <ossia/detail/mutex.hpp>
18class VideoNodeRenderer;
24 std::atomic_int use_count{};
32 std::shared_ptr<RefcountedFrame> currentFrame()
const noexcept;
33 void updateCurrentFrame(AVFrame* frame);
34 void releaseFramesToFree();
35 void releaseAllFrames();
37 std::shared_ptr<Video::VideoInterface> m_decoder;
39 mutable std::mutex m_frameLock{};
40 std::shared_ptr<RefcountedFrame> m_currentFrame TS_GUARDED_BY(m_frameLock);
42 int64_t m_currentFrameIdx{};
44 std::vector<AVFrame*> m_framesToFree;
45 std::vector<std::shared_ptr<RefcountedFrame>> m_framesInFlight;
53 static AVFrame* nextFrame(
55 std::vector<AVFrame*>& framesToFree, AVFrame*& nextFrame);
57 bool mustReadVideoFrame(
const VideoNode& node);
63 QElapsedTimer m_timer;
64 AVFrame* m_nextFrame{};
65 double m_lastFrameTime{};
66 double m_lastPlaybackTime{-1.};
89 std::shared_ptr<Video::VideoInterface> dec, std::optional<double> nativeTempo);
97 void process(
Message&& msg)
override;
98 void update()
override;
108 std::optional<double> m_nativeTempo;
110 QElapsedTimer m_timer;
111 std::atomic_bool m_pause{};
120class SCORE_PLUGIN_GFX_EXPORT CameraNode :
public VideoNodeBase
123 explicit CameraNode(std::shared_ptr<Video::ExternalInput> dec, QString filter = {});
125 virtual ~CameraNode();
129 void process(Message&& msg)
override;
130 void renderedNodesChanged()
override;
132 VideoFrameShare reader;
134 std::atomic_bool must_stop{};
137 friend VideoNodeRenderer;
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:110
List of nodes to be rendered to an output.
Definition RenderList.hpp:19
Definition VideoNode.hpp:71
Model for rendering a video.
Definition VideoNode.hpp:86
Definition VideoNodeRenderer.hpp:11
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:12
ScaleMode
How to resize a texture to adapt it to a viewport.
Definition Scale.hpp:10
Definition VideoInterface.hpp:37
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:51
Definition VideoNode.hpp:22
Messages sent from the execution thread to the rendering thread.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:45
Definition VideoNode.hpp:49
Definition VideoNode.hpp:28