The stream to send Images or other data. More...
#include <cvb/gevserver/stream.hpp>
Inherits enable_shared_from_this< Stream >.
Public Member Functions | |
Stream (const ServerPtr &parent) | |
Creates the stream from the given parent server. More... | |
ServerPtr | Parent () |
Gets the parent server object. | |
bool | IsRunning () const |
Gets whether this stream is running. More... | |
std::int64_t | ResendBuffersCount () const |
Gets the number of resend buffers. More... | |
void | SetResendBuffersCount (const std::int64_t &numBuffers) |
Sets the number of resend buffers. More... | |
void | Send (const ImagePtr &image, std::function< void(const ImagePtr &)> imageReleased) |
Sends the given image to the remote client. More... | |
bool | TrySend (const ImagePtr &image, std::function< void(const ImagePtr &)> imageReleased) |
Tries to send the given image to the remote client. More... | |
void | Send (const Image &image) |
Sends the given image to the remote client. More... | |
bool | TrySend (const Image &image) |
Tries to sends the given image to the remote client. More... | |
void | Send (const ImageBufferDescription &bufferDescription, void *basePtr, const std::size_t &bufferSize, std::function< void(void *)> bufferReleased) |
Sends the image at the given basePtr . More... | |
bool | TrySend (const ImageBufferDescription &bufferDescription, void *basePtr, const std::size_t &bufferSize, std::function< void(void *)> bufferReleased) |
Tries to send the image at the given basePtr . More... | |
The stream to send Images or other data.
Creates the stream from the given parent server.
parent | Parent server object. |
|
inline |
Gets whether this stream is running.
Streaming can only be enabled by the remote client. Send is only possible as long as the stream is active (running).
Note that acquisition start/stop is an asynchronous action without any means to synchronize. Use the TrySend methods to avoid exceptions.
true if Parent's GevServer::State is State::AcquisitionEnabled; false otherwise.
|
inline |
Gets the number of resend buffers.
This number specifies for how many full frames a packet resend can be done; set to 0 if no packet resend is to be supported.
|
inline |
Sends the given image to the remote client.
The given image must fit into the payload size set at creation/State::Configuration state.
Packet resend must be disabled (ResendBuffersCount is zero).
image | Image to be sent. |
The image will be copied to the resend buffer.
|
inline |
Sends the image at the given basePtr .
The given image buffer must fit into the payload size set at creation/GevServerState::Configuration state.
If packet resend is enabled (ResendBuffersCount larger than zero), then the given image buffer must remain unchanged until bufferReleased has been called! In case packet resend is disabled bufferReleased will be called immediately.
bufferDescription | Description of the image at basePtr . |
basePtr | Address of the image buffer to send. |
bufferSize | Length in bytes of the buffer at basePtr . |
bufferReleased | Mandatory delegate to be called when the given image buffer is not needed anymore for packet resend. |
|
inline |
Sends the given image to the remote client.
The given image must fit into the payload size set at creation/GevServerState.Configuration state.
If packet resend is enabled (ResendBuffersCount larger than zero), then the given image must remain unchanged until imageReleased has been called! In case packet resend is disabled imageReleased will be called immediately.
image | Image to be sent. |
imageReleased | Delegate to be called when the given image is not needed anymore for packet resend. If null the image will be copied to the resend buffer. |
|
inline |
Sets the number of resend buffers.
This number specifies for how many full frames a packet resend can be done; set to 0 if no packet resend is to be supported.
This property can only be change if the parent is in State::Configuration GevServer::State.
|
inline |
Tries to sends the given image to the remote client.
The given image must fit into the payload size set at creation/State::Configuration state.
Packet resend must be disabled (ResendBuffersCount is zero).
image | Image to be sent. |
The image will be copied to the resend buffer.
|
inline |
Tries to send the image at the given basePtr .
bufferDescription | Description of the image at basePtr . |
basePtr | Address of the image buffer to send. |
bufferSize | Length in bytes of the buffer at basePtr . |
bufferReleased | Delegate to be called when the given image buffer is not needed anymore for packet resend. |
|
inline |
Tries to send the given image to the remote client.
The given image must fit into the payload size set at creation/GevServerState::Configuration state.
If packet resend is enabled (ResendBuffersCount larger than zero), then the given image must remain unchanged until imageReleased has been called! In case packet resend is disabled imageReleased will be called immediately.
image | Image to be sent. |
imageReleased | Delegate to be called when the given image is not needed anymore for packet resend. If null the image will be copied to the resend buffer. |