diff options
author | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2021-10-06 10:26:00 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2021-10-06 10:44:26 +0300 |
commit | 2b1a8f48f3a414e565cefb809f3e6a7c6aa5f8a7 (patch) | |
tree | 3f274b92d00754e6a5980f07b2c9cefcbf2cae53 /kms++util/inc | |
parent | f691ed65d6bcfff0abbc2d7ce58e560af3ee63dc (diff) |
Split V4L2 code into separate libs
Create v4l2++ library and pyv4l2, which are independent from the rest of
the kms++.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Diffstat (limited to 'kms++util/inc')
-rw-r--r-- | kms++util/inc/kms++util/videodevice.h | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/kms++util/inc/kms++util/videodevice.h b/kms++util/inc/kms++util/videodevice.h deleted file mode 100644 index 3bce4a9..0000000 --- a/kms++util/inc/kms++util/videodevice.h +++ /dev/null @@ -1,88 +0,0 @@ -#pragma once - -#include <string> -#include <memory> -#include <kms++/kms++.h> - -class VideoStreamer; - -class VideoDevice -{ -public: - struct VideoFrameSize { - uint32_t min_w, max_w, step_w; - uint32_t min_h, max_h, step_h; - }; - - VideoDevice(const std::string& dev); - VideoDevice(int fd); - ~VideoDevice(); - - VideoDevice(const VideoDevice& other) = delete; - VideoDevice& operator=(const VideoDevice& other) = delete; - - VideoStreamer* get_capture_streamer(); - VideoStreamer* get_output_streamer(); - - std::vector<std::tuple<uint32_t, uint32_t>> get_discrete_frame_sizes(kms::PixelFormat fmt); - VideoFrameSize get_frame_sizes(kms::PixelFormat fmt); - - int fd() const { return m_fd; } - bool has_capture() const { return m_has_capture; } - bool has_output() const { return m_has_output; } - bool has_m2m() const { return m_has_m2m; } - - static std::vector<std::string> get_capture_devices(); - static std::vector<std::string> get_m2m_devices(); - -private: - int m_fd; - - bool m_has_capture; - bool m_has_mplane_capture; - - bool m_has_output; - bool m_has_mplane_output; - - bool m_has_m2m; - bool m_has_mplane_m2m; - - std::vector<kms::DumbFramebuffer*> m_capture_fbs; - std::vector<kms::DumbFramebuffer*> m_output_fbs; - - std::unique_ptr<VideoStreamer> m_capture_streamer; - std::unique_ptr<VideoStreamer> m_output_streamer; -}; - -class VideoStreamer -{ -public: - enum class StreamerType { - CaptureSingle, - CaptureMulti, - OutputSingle, - OutputMulti, - }; - - VideoStreamer(int fd, StreamerType type); - - std::vector<std::string> get_ports(); - void set_port(uint32_t index); - - std::vector<kms::PixelFormat> get_formats(); - void set_format(kms::PixelFormat fmt, uint32_t width, uint32_t height); - void get_selection(uint32_t& left, uint32_t& top, uint32_t& width, uint32_t& height); - void set_selection(uint32_t& left, uint32_t& top, uint32_t& width, uint32_t& height); - void set_queue_size(uint32_t queue_size); - void queue(kms::DumbFramebuffer* fb); - kms::DumbFramebuffer* dequeue(); - void stream_on(); - void stream_off(); - - int fd() const { return m_fd; } - -private: - int m_fd; - StreamerType m_type; - std::vector<kms::DumbFramebuffer*> m_fbs; -}; |