Class ImageTransportStreamerBase

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class ImageTransportStreamerBase : public web_video_server::StreamerBase

A common base class for all streaming plugins using image_transport to subscribe to image topics.

Subclassed by web_video_server::streamers::JpegSnapshotStreamer, web_video_server::streamers::LibavStreamerBase, web_video_server::streamers::MjpegStreamer, web_video_server::streamers::PngSnapshotStreamer, web_video_server::streamers::PngStreamer

Public Functions

ImageTransportStreamerBase(const async_web_server_cpp::HttpRequest &request, async_web_server_cpp::HttpConnectionPtr connection, rclcpp::Node::WeakPtr node, std::string logger_name = "image_transport_streamer")
virtual ~ImageTransportStreamerBase()
virtual void start()

Starts the streaming process.

virtual void restream_frame(std::chrono::duration<double> max_age)

Restreams the last received image frame if older than max_age.

Protected Functions

virtual cv::Mat decode_image(const sensor_msgs::msg::Image::ConstSharedPtr &msg)
virtual void send_image(const cv::Mat &img, const std::chrono::steady_clock::time_point &time) = 0
virtual void initialize(const cv::Mat &img)

Protected Attributes

image_transport::Subscriber image_sub_
int output_width_
int output_height_
bool invert_
std::string default_transport_
std::string qos_profile_name_
std::chrono::steady_clock::time_point last_frame_
cv::Mat output_size_image_
std::mutex send_mutex_