34 const std::string& inputDevice,
const std::string& format,
int w,
int h,
35 double fps,
int codec,
int pixelfmt)
noexcept;
37 bool start()
noexcept override;
38 void stop()
noexcept override;
40 AVFrame* dequeue_frame()
noexcept override;
41 void release_frame(AVFrame* frame)
noexcept override;
43 bool notifyFormatChange(
44 int new_w,
int new_h, AVPixelFormat new_pixfmt)
noexcept override;
47 void buffer_thread()
noexcept;
48 void close_file()
noexcept;
49 AVFrame* read_frame_impl()
noexcept;
50 bool open_stream()
noexcept;
51 void close_stream()
noexcept;
52 bool alloc_format_context()
noexcept;
53 ReadFrame read_one_frame(AVFramePointer frame, AVPacket& packet);
55 static const constexpr int frames_to_buffer = 1;
58 static const constexpr auto open_timeout = std::chrono::milliseconds(2000);
60 static const constexpr auto read_timeout = std::chrono::milliseconds(5000);
64 AVCodecID m_requestedCodec{AV_CODEC_ID_NONE};
65 AVPixelFormat m_requestedPixfmt{AV_PIX_FMT_NONE};
69 std::string m_inputKind;
70 std::string m_inputDevice;
72 std::atomic_bool m_running{};