2 #include <Media/Libav.hpp>
4 #include <Video/FrameQueue.hpp>
5 #include <Video/Rescale.hpp>
6 #include <Video/VideoInterface.hpp>
8 #include <libavformat/avformat.h>
9 #include <libswscale/swscale.h>
12 #include <ossia/detail/lockfree_queue.hpp>
14 #include <score_plugin_media_export.h>
17 #include <condition_variable>
33 bool open(
const std::string& inputFile) noexcept;
34 bool load(
const std::string& inputFile) noexcept;
36 const std::string& file()
const noexcept {
return m_inputFile; }
38 int64_t duration()
const noexcept;
40 void seek(int64_t flicks);
42 AVFrame* dequeue_frame() noexcept
override;
43 void release_frame(AVFrame*) noexcept
override;
46 void buffer_thread() noexcept;
47 void close_file() noexcept;
48 bool seek_impl(int64_t dts) noexcept;
49 AVFrame* read_frame_impl() noexcept;
50 bool open_stream() noexcept;
51 void close_video() noexcept;
53 static const constexpr
int frames_to_buffer = 16;
55 std::string m_inputFile;
59 std::condition_variable m_condVar;
63 std::atomic_int64_t m_seekTo = -1;
64 std::atomic_int64_t m_last_dequeued_dts = 0;
65 std::atomic_int64_t m_dequeued = 0;
67 std::atomic_bool m_running{};
Definition: VideoDecoder.hpp:28
Definition: Rescale.hpp:36
Definition: Rescale.hpp:45
Definition: VideoInterface.hpp:37