Fawkes API
Fawkes Development Version
|
#include <>>
Public Member Functions | |
DynamicMJPEGStreamWebReply (std::shared_ptr< WebviewJpegStreamProducer > stream_producer) | |
Constructor. More... | |
DynamicMJPEGStreamWebReply (const DynamicMJPEGStreamWebReply &other) | |
Copy Constructor. More... | |
virtual | ~DynamicMJPEGStreamWebReply () |
Destructor. More... | |
DynamicMJPEGStreamWebReply & | operator= (const DynamicMJPEGStreamWebReply &other) |
Assignment operator. More... | |
virtual size_t | size () |
virtual size_t | next_chunk (size_t pos, char *buffer, size_t buf_max_size) |
virtual void | handle_buffer (std::shared_ptr< WebviewJpegStreamProducer::Buffer > buffer) |
![]() | |
DynamicWebReply (Code code) | |
Constructor. More... | |
virtual size_t | chunk_size () |
Chunksize. More... | |
![]() | |
WebReply (Code code) | |
Constructor. More... | |
virtual | ~WebReply () |
Destructor. More... | |
Code | code () const |
Get response code. More... | |
void | set_code (Code code) |
Set response code. More... | |
void | add_header (const std::string &header, const std::string &content) |
Add a HTTP header. More... | |
void | add_header (const std::string &header_string) |
Add a HTTP header. More... | |
const HeaderMap & | headers () const |
get headers. More... | |
void | set_caching (bool caching) |
Enable or disable caching for this specific reply. More... | |
void | set_request (WebRequest *request) |
Set associated request. More... | |
WebRequest * | get_request () const |
Get associated request. More... | |
void | pack_caching () |
Called just before the reply is sent. More... | |
![]() | |
virtual | ~Subscriber () |
Destructor. More... | |
Dynamic raw file transfer reply. This dynamic file transfer reply transmits the given file with a mime type determined with libmagic.
Definition at line 39 of file mjpeg_reply.h.
fawkes::DynamicMJPEGStreamWebReply::DynamicMJPEGStreamWebReply | ( | std::shared_ptr< WebviewJpegStreamProducer > | stream_producer | ) |
Constructor.
stream_producer | stream producer to query for JPEG buffers |
Definition at line 47 of file mjpeg_reply.cpp.
References fawkes::WebReply::add_header().
fawkes::DynamicMJPEGStreamWebReply::DynamicMJPEGStreamWebReply | ( | const DynamicMJPEGStreamWebReply & | other | ) |
Copy Constructor.
other | instance to copy from |
Definition at line 63 of file mjpeg_reply.cpp.
References fawkes::WebReply::add_header().
|
virtual |
Destructor.
Definition at line 76 of file mjpeg_reply.cpp.
|
virtual |
Notification if a new buffer is available.
buffer | new buffer |
Implements fawkes::WebviewJpegStreamProducer::Subscriber.
Definition at line 107 of file mjpeg_reply.cpp.
References fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::WaitCondition::wake_all().
|
virtual |
Get data of next chunk.
pos | position in the stream. Note that a certain position may be called several times. |
buffer | buffer to store data in |
buf_max_size | maximum size in bytes of data that can be put into buffer |
Implements fawkes::DynamicWebReply.
Definition at line 116 of file mjpeg_reply.cpp.
References fawkes::Mutex::lock(), fawkes::Mutex::unlock(), and fawkes::WaitCondition::wait().
DynamicMJPEGStreamWebReply & fawkes::DynamicMJPEGStreamWebReply::operator= | ( | const DynamicMJPEGStreamWebReply & | other | ) |
Assignment operator.
other | instance to copy from |
Definition at line 88 of file mjpeg_reply.cpp.
References fawkes::WebReply::add_header().
|
virtual |
Total size of the web reply. Return the total size of the reply if known, or -1 if it is not known. In the latter case your next_chunk() method has to return -1 at some point to end the transfer. If possible by any means return a meaningful value, as it will improve the experience of users, especially for long transfers!
Implements fawkes::DynamicWebReply.
Definition at line 101 of file mjpeg_reply.cpp.