image_streamer.h
Go to the documentation of this file.
1 #ifndef IMAGE_STREAMER_H_
2 #define IMAGE_STREAMER_H_
3 
4 #include <ros/ros.h>
6 #include <opencv2/opencv.hpp>
9 
10 namespace web_video_server
11 {
12 
14 {
15 public:
18  ros::NodeHandle& nh);
19 
20  virtual void start() = 0;
21  virtual ~ImageStreamer();
22 
23  bool isInactive()
24  {
25  return inactive_;
26  }
27  ;
28 
32  virtual void restreamFrame(double max_age) = 0;
33 
34  std::string getTopic()
35  {
36  return topic_;
37  }
38  ;
39 protected:
43  bool inactive_;
45  std::string topic_;
46 };
47 
48 
50 {
51 public:
53  ros::NodeHandle& nh);
55  virtual void start();
56 
57 protected:
58  virtual void sendImage(const cv::Mat &, const ros::Time &time) = 0;
59  virtual void restreamFrame(double max_age);
60  virtual void initialize(const cv::Mat &);
61 
65  bool invert_;
66  std::string default_transport_;
67 
70  boost::mutex send_mutex_;
71 
72 private:
75 
76  void imageCallback(const sensor_msgs::ImageConstPtr &msg);
77 };
78 
80 {
81 public:
84  ros::NodeHandle& nh) = 0;
85 
86  virtual std::string create_viewer(const async_web_server_cpp::HttpRequest &request) = 0;
87 };
88 
89 }
90 
91 #endif
web_video_server::ImageTransportImageStreamer::sendImage
virtual void sendImage(const cv::Mat &, const ros::Time &time)=0
web_video_server::ImageTransportImageStreamer::initialize
virtual void initialize(const cv::Mat &)
Definition: image_streamer.cpp:49
web_video_server::ImageTransportImageStreamer::invert_
bool invert_
Definition: image_streamer.h:65
web_video_server::ImageStreamer
Definition: image_streamer.h:13
image_transport::ImageTransport
web_video_server::ImageTransportImageStreamer::default_transport_
std::string default_transport_
Definition: image_streamer.h:66
boost::shared_ptr< HttpConnection >
web_video_server::ImageStreamer::inactive_
bool inactive_
Definition: image_streamer.h:43
web_video_server::ImageTransportImageStreamer
Definition: image_streamer.h:49
web_video_server::ImageStreamerType::create_viewer
virtual std::string create_viewer(const async_web_server_cpp::HttpRequest &request)=0
web_video_server::ImageStreamerType::create_streamer
virtual boost::shared_ptr< ImageStreamer > create_streamer(const async_web_server_cpp::HttpRequest &request, async_web_server_cpp::HttpConnectionPtr connection, ros::NodeHandle &nh)=0
web_video_server::ImageStreamer::isInactive
bool isInactive()
Definition: image_streamer.h:23
ros.h
web_video_server::ImageStreamerType
Definition: image_streamer.h:79
image_transport::Subscriber
web_video_server::ImageTransportImageStreamer::last_frame
ros::Time last_frame
Definition: image_streamer.h:68
web_video_server::ImageStreamer::~ImageStreamer
virtual ~ImageStreamer()
Definition: image_streamer.cpp:15
web_video_server::ImageTransportImageStreamer::restreamFrame
virtual void restreamFrame(double max_age)
Definition: image_streamer.cpp:53
web_video_server::ImageStreamer::topic_
std::string topic_
Definition: image_streamer.h:45
http_server.hpp
web_video_server::ImageTransportImageStreamer::imageCallback
void imageCallback(const sensor_msgs::ImageConstPtr &msg)
Definition: image_streamer.cpp:84
web_video_server::ImageTransportImageStreamer::output_height_
int output_height_
Definition: image_streamer.h:64
web_video_server::ImageTransportImageStreamer::start
virtual void start()
Definition: image_streamer.cpp:33
web_video_server::ImageStreamer::restreamFrame
virtual void restreamFrame(double max_age)=0
web_video_server::ImageTransportImageStreamer::initialized_
bool initialized_
Definition: image_streamer.h:74
web_video_server::ImageTransportImageStreamer::~ImageTransportImageStreamer
virtual ~ImageTransportImageStreamer()
Definition: image_streamer.cpp:29
async_web_server_cpp::HttpRequest
web_video_server::ImageTransportImageStreamer::output_width_
int output_width_
Definition: image_streamer.h:63
web_video_server::ImageTransportImageStreamer::image_sub_
image_transport::Subscriber image_sub_
Definition: image_streamer.h:62
web_video_server::ImageTransportImageStreamer::ImageTransportImageStreamer
ImageTransportImageStreamer(const async_web_server_cpp::HttpRequest &request, async_web_server_cpp::HttpConnectionPtr connection, ros::NodeHandle &nh)
Definition: image_streamer.cpp:19
web_video_server
Definition: h264_streamer.h:9
web_video_server::ImageStreamer::request_
async_web_server_cpp::HttpRequest request_
Definition: image_streamer.h:41
image_transport.h
web_video_server::ImageTransportImageStreamer::it_
image_transport::ImageTransport it_
Definition: image_streamer.h:73
web_video_server::ImageTransportImageStreamer::send_mutex_
boost::mutex send_mutex_
Definition: image_streamer.h:70
ros::Time
web_video_server::ImageStreamer::image_sub_
image_transport::Subscriber image_sub_
Definition: image_streamer.h:44
web_video_server::ImageStreamer::nh_
ros::NodeHandle nh_
Definition: image_streamer.h:42
web_video_server::ImageStreamer::start
virtual void start()=0
web_video_server::ImageTransportImageStreamer::output_size_image
cv::Mat output_size_image
Definition: image_streamer.h:69
web_video_server::ImageStreamer::ImageStreamer
ImageStreamer(const async_web_server_cpp::HttpRequest &request, async_web_server_cpp::HttpConnectionPtr connection, ros::NodeHandle &nh)
Definition: image_streamer.cpp:8
http_request.hpp
web_video_server::ImageStreamer::connection_
async_web_server_cpp::HttpConnectionPtr connection_
Definition: image_streamer.h:38
web_video_server::ImageStreamer::getTopic
std::string getTopic()
Definition: image_streamer.h:34
ros::NodeHandle


web_video_server
Author(s): Mitchell Wills
autogenerated on Wed Mar 2 2022 01:13:35