multipart_stream.h
Go to the documentation of this file.
1 #ifndef MULTIPART_STREAM_H_
2 #define MULTIPART_STREAM_H_
3 
4 #include <ros/ros.h>
6 
7 #include <queue>
8 
9 namespace web_video_server
10 {
11 
12 struct PendingFooter {
14  boost::weak_ptr<std::string> contents;
15 };
16 
18 public:
20  const std::string& boundry="boundarydonotcross",
21  std::size_t max_queue_size=1);
22 
23  void sendInitialHeader();
24  void sendPartHeader(const ros::Time &time, const std::string& type, size_t payload_size);
25  void sendPartFooter(const ros::Time &time);
26  void sendPartAndClear(const ros::Time &time, const std::string& type, std::vector<unsigned char> &data);
27  void sendPart(const ros::Time &time, const std::string& type, const boost::asio::const_buffer &buffer,
29 
30 private:
31  bool isBusy();
32 
33 private:
34  const std::size_t max_queue_size_;
36  std::string boundry_;
37  std::queue<PendingFooter> pending_footers_;
38 };
39 
40 }
41 
42 #endif
boost::shared_ptr< HttpConnection >
ros.h
web_video_server::MultipartStream::sendPart
void sendPart(const ros::Time &time, const std::string &type, const boost::asio::const_buffer &buffer, async_web_server_cpp::HttpConnection::ResourcePtr resource)
Definition: multipart_stream.cpp:54
web_video_server::MultipartStream::sendPartHeader
void sendPartHeader(const ros::Time &time, const std::string &type, size_t payload_size)
Definition: multipart_stream.cpp:23
web_video_server::MultipartStream::connection_
async_web_server_cpp::HttpConnectionPtr connection_
Definition: multipart_stream.h:35
web_video_server::MultipartStream::sendInitialHeader
void sendInitialHeader()
Definition: multipart_stream.cpp:14
web_video_server::PendingFooter::timestamp
ros::Time timestamp
Definition: multipart_stream.h:13
http_connection.hpp
web_video_server
Definition: h264_streamer.h:9
web_video_server::MultipartStream::sendPartAndClear
void sendPartAndClear(const ros::Time &time, const std::string &type, std::vector< unsigned char > &data)
Definition: multipart_stream.cpp:44
web_video_server::PendingFooter::contents
boost::weak_ptr< std::string > contents
Definition: multipart_stream.h:14
web_video_server::MultipartStream::pending_footers_
std::queue< PendingFooter > pending_footers_
Definition: multipart_stream.h:37
web_video_server::MultipartStream::MultipartStream
MultipartStream(async_web_server_cpp::HttpConnectionPtr &connection, const std::string &boundry="boundarydonotcross", std::size_t max_queue_size=1)
Definition: multipart_stream.cpp:7
ros::Time
web_video_server::MultipartStream::sendPartFooter
void sendPartFooter(const ros::Time &time)
Definition: multipart_stream.cpp:35
web_video_server::MultipartStream::boundry_
std::string boundry_
Definition: multipart_stream.h:36
web_video_server::MultipartStream::isBusy
bool isBusy()
Definition: multipart_stream.cpp:65
web_video_server::MultipartStream::max_queue_size_
const std::size_t max_queue_size_
Definition: multipart_stream.h:34
web_video_server::PendingFooter
Definition: multipart_stream.h:12
web_video_server::MultipartStream
Definition: multipart_stream.h:17


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