VideoTools
|
A class for reading images from a publication channel and distributing them to multiple client objects. More...
#include <gvimageinput.h>
Public Member Functions | |
ImageInput (Gr::ImageConverter &, const std::string &channel_name, bool lazy_open) | |
Constructor. | |
~ImageInput () | |
Destructor. | |
int | fd () const |
Returns the publication channel file descriptor, or -1 if close()d. More... | |
bool | handleReadEvent () |
Called to process a read event on the file descriptor. More... | |
std::string | info () const |
Returns the channel info. | |
void | close () |
Closes the input channel, releasing resources. | |
bool | open () |
Tries to re-open the input channel some time after handleReadEvent() has returned false. More... | |
Public Member Functions inherited from Gv::ImageInputSource | |
ImageInputSource (Gr::ImageConverter &, const std::string &source_name=std::string()) | |
Constructor. | |
virtual | ~ImageInputSource () |
Destructor. | |
size_t | handlers () const |
Returns the number of registered handlers. | |
void | addImageInputHandler (ImageInputHandler &) |
Adds a handler for image callbacks. | |
void | removeImageInputHandler (ImageInputHandler &) |
Removes a handler for image callbacks. | |
std::string | name () const |
Returns the source name, as passed to the constructor. | |
Additional Inherited Members | |
Protected Member Functions inherited from Gv::ImageInputSource | |
bool | sendImageInput (Gr::Image, ImageInputHandler *one_handler_p=nullptr) |
Sends a new image to all registered handlers, or optionally to just one of them. More... | |
void | sendNonImageInput (Gr::Image non_image, const std::string &type_str, ImageInputHandler *one_handler_p=nullptr) |
Sends non-image data to registered handlers (or one). | |
A class for reading images from a publication channel and distributing them to multiple client objects.
Definition at line 168 of file gvimageinput.h.
int Gv::ImageInput::fd | ( | ) | const |
Returns the publication channel file descriptor, or -1 if close()d.
Definition at line 185 of file gvimageinput.cpp.
bool Gv::ImageInput::handleReadEvent | ( | ) |
Called to process a read event on the file descriptor.
All registered handlers are notified of any new images. Returns false if the publisher has disappeared, in which case the user should remove the fd() from the event loop and then call close().
Definition at line 190 of file gvimageinput.cpp.
bool Gv::ImageInput::open | ( | ) |
Tries to re-open the input channel some time after handleReadEvent() has returned false.
Returns true on success.
Definition at line 173 of file gvimageinput.cpp.