Class StreamerFactoryInterface

Inheritance Relationships

Derived Types

Class Documentation

class StreamerFactoryInterface

A factory interface for creating Streamer instances.

Subclassed by web_video_server::SnapshotStreamerFactoryInterface, web_video_server::streamers::ImageTransportStreamerFactoryBase, web_video_server::streamers::RosCompressedStreamerFactory

Public Functions

virtual ~StreamerFactoryInterface() = default
virtual std::string get_type() = 0

Returns the type of streamer created by this factory.

This should match the “type” query parameter used to select the streamer.

virtual std::shared_ptr<StreamerInterface> create_streamer(const async_web_server_cpp::HttpRequest &request, async_web_server_cpp::HttpConnectionPtr connection, rclcpp::Node::WeakPtr node) = 0

Creates a new Streamer instance.

Parameters:
  • request – The HTTP request that initiated the streamer.

  • connection – The HTTP connection to use for streaming.

  • node – The ROS2 node to use for subscribing to topics.

Returns:

A shared pointer to the created Streamer instance.

virtual std::string create_viewer(const async_web_server_cpp::HttpRequest &request)

Creates HTML code for embedding a viewer for this streamer.

Parameters:

request – The HTTP request that initiated the viewer.

virtual std::vector<std::string> get_available_topics(rclcpp::Node &node)

Returns a list of available topics that can be streamed by this streamer.

Parameters:

node – The ROS2 node to use for discovering topics.

Returns:

A vector of topic names.