3 #include <Gfx/Graph/Node.hpp>
5 #include <libavformat/avformat.h>
7 #include <ossia/detail/mutex.hpp>
13 struct VideoInterface;
18 class 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.};
88 std::shared_ptr<Video::VideoInterface> dec, std::optional<double> nativeTempo);
96 void process(
Message&& msg)
override;
97 void update()
override;
107 std::optional<double> m_nativeTempo;
109 QElapsedTimer m_timer;
110 std::atomic_bool m_pause{};
122 explicit CameraNode(std::shared_ptr<Video::ExternalInput> dec);
128 void process(
Message&& msg)
override;
129 void renderedNodesChanged()
override;
133 std::atomic_bool must_stop{};
Model for rendering a camera feed.
Definition: VideoNode.hpp:120
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:85
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