2 #include <Media/Libav.hpp>
5 #include <Video/FrameQueue.hpp>
6 #include <Video/Rescale.hpp>
7 #include <Video/VideoInterface.hpp>
9 #include <libavformat/avformat.h>
10 #include <libswscale/swscale.h>
13 #include <ossia/detail/lockfree_queue.hpp>
15 #include <score_plugin_media_export.h>
18 #include <condition_variable>
29 virtual bool start() noexcept = 0;
30 virtual void stop() noexcept = 0;
42 const std::string& inputDevice,
const std::string& format,
int w,
int h,
43 double fps,
int codec,
int pixelfmt) noexcept;
45 bool start() noexcept
override;
46 void stop() noexcept
override;
48 AVFrame* dequeue_frame() noexcept
override;
49 void release_frame(AVFrame* frame) noexcept
override;
52 void buffer_thread() noexcept;
53 void close_file() noexcept;
54 AVFrame* read_frame_impl() noexcept;
55 bool open_stream() noexcept;
56 void close_stream() noexcept;
57 ReadFrame read_one_frame(AVFramePointer frame, AVPacket& packet);
59 static const constexpr
int frames_to_buffer = 1;
61 AVCodecID m_requestedCodec{AV_CODEC_ID_NONE};
62 AVPixelFormat m_requestedPixfmt{AV_PIX_FMT_NONE};
66 std::string m_inputKind;
67 std::string m_inputDevice;
69 std::atomic_bool m_running{};
Definition: Rescale.hpp:45
Definition: VideoInterface.hpp:38
Definition: VideoInterface.hpp:31