00001 #ifndef ROS_COMPRESSED_STREAMERS_H_ 00002 #define ROS_COMPRESSED_STREAMERS_H_ 00003 00004 #include <sensor_msgs/CompressedImage.h> 00005 #include "web_video_server/image_streamer.h" 00006 #include "async_web_server_cpp/http_request.hpp" 00007 #include "async_web_server_cpp/http_connection.hpp" 00008 #include "web_video_server/multipart_stream.h" 00009 00010 namespace web_video_server 00011 { 00012 00013 class RosCompressedStreamer : public ImageStreamer 00014 { 00015 public: 00016 RosCompressedStreamer(const async_web_server_cpp::HttpRequest &request, async_web_server_cpp::HttpConnectionPtr connection, 00017 ros::NodeHandle& nh); 00018 virtual void start(); 00019 00020 private: 00021 void imageCallback(const sensor_msgs::CompressedImageConstPtr &msg); 00022 00023 MultipartStream stream_; 00024 ros::Subscriber image_sub_; 00025 }; 00026 00027 class RosCompressedStreamerType : public ImageStreamerType 00028 { 00029 public: 00030 boost::shared_ptr<ImageStreamer> create_streamer(const async_web_server_cpp::HttpRequest &request, 00031 async_web_server_cpp::HttpConnectionPtr connection, 00032 ros::NodeHandle& nh); 00033 std::string create_viewer(const async_web_server_cpp::HttpRequest &request); 00034 }; 00035 00036 } 00037 00038 #endif