8 #include <bnb/types/base_types.hpp>
9 #include <bnb/spal/camera/base_mocker.hpp>
10 #include <bnb/utils/defs.hpp>
12 #if !BNB_OS_EMSCRIPTEN
14 #include <opencv2/core/core.hpp>
15 #include <opencv2/videoio.hpp>
23 typedef std::optional<cv::Rect> rect_t;
26 camera_video_mocker(
const camera_base::push_frame_cb_t& cb, uint32_t frame_rate,
const std::string& input_file,
const rect_t& clip_area);
27 camera_video_mocker(
const camera_base::push_frame_cb_t& cb,
const std::string& input_file,
const rect_t& clip_area = std::nullopt);
30 void set_device_by_index(uint32_t device_index)
override;
31 void set_device_by_id(
const std::string& device_id)
override;
34 void update_image_content()
final;
37 uint32_t m_frame_width;
38 uint32_t m_frame_height;
39 uint32_t m_frame_size;
41 cv::VideoCapture m_capture;
42 std::optional<cv::Rect> m_clip_area;