#ifndef DEPTHGUIDE_IMAGE_STREAMER_H #define DEPTHGUIDE_IMAGE_STREAMER_H #include "core/object_manager.h" #include "core/cuda_helper.hpp" #include class image_streamer { public: using io_context = boost::asio::io_context; struct create_config { // image must be valid before start obj_name_type img_name = invalid_obj_name; // extra data will be placed at the start of the stream // receiver must do the same parsing work for proper work obj_name_type ext_name = invalid_obj_name; // data_type std::optional frame_rate; io_context *asio_ctx = nullptr; // for encoder CUcontext *cuda_ctx = nullptr; smart_cuda_stream *stream = nullptr; }; explicit image_streamer(create_config conf); ~image_streamer(); void show(); void change_frame_rate(int fps); using sig_req_size_type = boost::signals2::signal; sig_req_size_type sig_req_size; private: struct impl; std::unique_ptr pimpl; }; #endif //DEPTHGUIDE_IMAGE_STREAMER_H