CVBpy 15.0
Stream Class Reference

The stream to send Images or other data. More...

Inherits object.

Public Member Functions

None send (self, cvb.Image image, Optional[Callable[[cvb.Image], None]] image_released)
 Sends the given image to the remote client. More...
 
bool try_send (self, cvb.Image image, Optional[Callable[[cvb.Image], None]] image_released)
 Tries to send the given image to the remote client. More...
 

Properties

 is_running = property
 bool: Gets whether this stream is running. More...
 
 resend_buffers_count = property
 int: Gets or sets the number of resend buffers. More...
 

Detailed Description

The stream to send Images or other data.

Member Function Documentation

◆ send()

None send (   self,
cvb.Image  image,
Optional[Callable[[cvb.Image], None]]  image_released 
)

Sends the given image to the remote client.

The given image must fit into the payload size set at creation / State.Configuration state. If packet resend is enabled (Stream.resend_buffers_count is larger than zero), then the given must remain unchanged until image_released has been called! In case packet resend is disabled image_released will be called immediately. If no callback is given, packet resend must be disabled (Stream.resend_buffers_count is zero).

Parameters

image : cvb.Image An image to be sent.

image_released : Optional[Callable[[cvb.Image], None]] Delegate to be called when the given image is not needed anymore for packet resend.If None is set then the image will be copied to the resend buffer.

◆ try_send()

bool try_send (   self,
cvb.Image  image,
Optional[Callable[[cvb.Image], None]]  image_released 
)

Tries to send the given image to the remote client.

If packet resend is enabled (Stream.resend_buffers_count is larger than zero), then the given image must remain unchanged until image_released has been called! In case packet resend is disabled image_released will be called immediately. If no callback is given, packet resend must be disabled (Stream.resend_buffers_count is zero).

Parameters

image : cvb.Image An image to be sent.

image_released : Optional[Callable[[cvb.Image], None]] Delegate to be called when the given image is not needed anymore for packet resend. If None is set the image will be copied to the resend buffer.

Returns

bool True if successfully sent; False on any error. Parameter errors and disposed exception will still be thrown.

Property Documentation

◆ is_running

is_running = property
static

bool: 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 try_send() method to avoid exceptions. True if parent's state is cvb.gevserver.State.AcquisitionEnabled; False otherwise.

◆ resend_buffers_count

resend_buffers_count = property
static

int: Gets or 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 only if the parent is in State.Configuration.