Spinnaker SDK C++
4.3.0.189
 
 

 
Loading...
Searching...
No Matches
SpinnakerRelay Class Reference

Spinnaker Relay class that enables forwarding of Spinnaker images from source to destination PC. More...

#include <SpinnakerRelay.h>

Inheritance diagram for SpinnakerRelay:
ISpinnakerRelay

Public Member Functions

 SpinnakerRelay ()
 Default constructor.
 
virtual ~SpinnakerRelay ()
 Default destructor.
 
 SpinnakerRelay (const SpinnakerRelay &processor)
 Copy constructor.
 
SpinnakerRelayoperator= (const SpinnakerRelay &processor)
 Assignment operator.
 
virtual void SetConnectParameters (const ConnectParameters connectParam)
 Sets relay connect parameters.
 
virtual void SetNumBuffers (uint64_t numBuffers)
 Sets number of relay buffers.
 
virtual void AddSource (CameraPtr pCamera)
 Adds a camera as a streaming source to the sender.
 
virtual void RemoveSource (CameraPtr pCamera)
 Removes a camera as a streaming source from the sender.
 
virtual void Connect ()
 Initiates a Spinnaker Relay connection.
 
virtual void Disconnect ()
 Disconnects a Spinnaker Relay connection.
 
virtual bool IsConnected ()
 Returns a boolean value indicating if this relay is connected.
 
virtual bool IsConnecting ()
 Returns a boolean value indicating if the relay is currently attempting to connect.
 
virtual void RegisterEventHandler (EventHandler &eventHandler)
 Registers an image event handler for the receiver.
 
virtual void UnregisterEventHandler (EventHandler &eventHandler)
 Unregisters an event handler from the receiver.
 
virtual ImagePtr GetNextImage ()
 Gets the next image that was received by the receiver.
 
virtual void GetStatistics (RelayStatistics *statistics)
 Returns a RelayStatistics struct containing statistics about the performance of the relay connection: e.g.
 
virtual void ResetStatistics ()
 Resets the statistics about the performance of the relay connection: e.g.
 
- Public Member Functions inherited from ISpinnakerRelay
virtual ~ISpinnakerRelay (void)
 
virtual void SetConnectParameters (const ConnectParameters connectParam)=0
 
virtual void SetNumBuffers (uint64_t numBuffers)=0
 
virtual void AddSource (CameraPtr pCamera)=0
 
virtual void RemoveSource (CameraPtr pCamera)=0
 
virtual void Connect ()=0
 
virtual void Disconnect ()=0
 
virtual bool IsConnected ()=0
 
virtual void RegisterEventHandler (EventHandler &eventHandler)=0
 
virtual void UnregisterEventHandler (EventHandler &eventHandler)=0
 
virtual ImagePtr GetNextImage ()=0
 
virtual void GetStatistics (RelayStatistics *statistics)=0
 

Additional Inherited Members

- Protected Member Functions inherited from ISpinnakerRelay
 ISpinnakerRelay ()
 
 ISpinnakerRelay (const ISpinnakerRelay &)
 
ISpinnakerRelayoperator= (const ISpinnakerRelay &)
 
- Protected Attributes inherited from ISpinnakerRelay
SpinnakerRelayData * m_pSpinnakerRelayData
 

Detailed Description

Spinnaker Relay class that enables forwarding of Spinnaker images from source to destination PC.

Examples
ImageRelay.cpp.

Constructor & Destructor Documentation

◆ SpinnakerRelay() [1/2]

Default constructor.

◆ ~SpinnakerRelay()

virtual ~SpinnakerRelay ( )
virtual

Default destructor.

◆ SpinnakerRelay() [2/2]

SpinnakerRelay ( const SpinnakerRelay processor)

Copy constructor.

Member Function Documentation

◆ AddSource()

virtual void AddSource ( CameraPtr  pCamera)
virtual

Adds a camera as a streaming source to the sender.

Images from this camera will be relayed from the sender to the receiver.

Note that cameras may not be added to a receiver as a source. This must be called after SetConnectParameters() in order to set the role to sender.

Parameters
pCameraThe camera to add as a source.
See also
RemoveSource()

Implements ISpinnakerRelay.

Examples
ImageRelay.cpp.

◆ Connect()

virtual void Connect ( )
virtual

Initiates a Spinnaker Relay connection.

This must be called from both the sender and receiver for the connection to be made.

Note that this must be called after SetConnectParameters() and SetNumBuffers() in order to set the role, other connect parameters, and buffer size.

See also
SetConnectParameters()
SetNumBuffers()
Disconnect()

Implements ISpinnakerRelay.

Examples
ImageRelay.cpp.

◆ Disconnect()

virtual void Disconnect ( )
virtual

Disconnects a Spinnaker Relay connection.

See also
Connect()

Implements ISpinnakerRelay.

Examples
ImageRelay.cpp.

◆ GetNextImage()

virtual ImagePtr GetNextImage ( )
virtual

Gets the next image that was received by the receiver.

See also
SetConnectParameters()
Connect()
Returns
pointer to an Image object

Implements ISpinnakerRelay.

◆ GetStatistics()

virtual void GetStatistics ( RelayStatistics statistics)
virtual

Returns a RelayStatistics struct containing statistics about the performance of the relay connection: e.g.

frame rate, data rate, frame counts.

See also
struct RelayStatistics
Parameters
statisticsA pointer to the struct that will store result

Implements ISpinnakerRelay.

Examples
ImageRelay.cpp.

◆ IsConnected()

virtual bool IsConnected ( )
virtual

Returns a boolean value indicating if this relay is connected.

Returns
Returns true if the relay is connected.

Implements ISpinnakerRelay.

Examples
ImageRelay.cpp.

◆ IsConnecting()

virtual bool IsConnecting ( )
virtual

Returns a boolean value indicating if the relay is currently attempting to connect.

If the relay is not explicitly disconnected using Disconnect(), it will automatically attempt to reconnect unless the connection is re-established or the timeout period specified in SetConnectParameters() expires.

See also
Disconnect()
SetConnectParameters()
struct ConnectParameters
Returns
Returns true if the relay is attempting to connect.
Examples
ImageRelay.cpp.

◆ operator=()

SpinnakerRelay & operator= ( const SpinnakerRelay processor)

Assignment operator.

◆ RegisterEventHandler()

virtual void RegisterEventHandler ( EventHandler eventHandler)
virtual

Registers an image event handler for the receiver.

The relay connect parameters must be set before registering an image event handler, and the role must be receiver.

See also
UnregisterEventHandler()
ImageEventHandler
Parameters
eventHandlerThe event handler to register for the receiver

Implements ISpinnakerRelay.

Examples
ImageRelay.cpp.

◆ RemoveSource()

virtual void RemoveSource ( CameraPtr  pCamera)
virtual

Removes a camera as a streaming source from the sender.

Parameters
pCameraThe camera to remove as a source.
See also
AddSource()

Implements ISpinnakerRelay.

◆ ResetStatistics()

virtual void ResetStatistics ( )
virtual

Resets the statistics about the performance of the relay connection: e.g.

frame rate, data rate, frame counts. Counts are reset to zero and start timer is reset.

See also
GetStatistics()

◆ SetConnectParameters()

virtual void SetConnectParameters ( const ConnectParameters  connectParam)
virtual

Sets relay connect parameters.

Spinnaker Relay can operate in the sender or receiver roles.

Note that the connect parameters must be set first, before calling AddSource(), SetNumBuffers(), RegisterEventHandler(), or Connect().

See also
Connect()
struct ConnectParameters
Parameters
connectParamConnect parameters to set

Implements ISpinnakerRelay.

Examples
ImageRelay.cpp.

◆ SetNumBuffers()

virtual void SetNumBuffers ( uint64_t  numBuffers)
virtual

Sets number of relay buffers.

Note that this must be called after SetConnectParameters().

See also
SetConnectParameters()
Parameters
numBuffersNumber of relay buffers to set

Implements ISpinnakerRelay.

Examples
ImageRelay.cpp.

◆ UnregisterEventHandler()

virtual void UnregisterEventHandler ( EventHandler eventHandler)
virtual

Unregisters an event handler from the receiver.

Event handlers should be unregistered first before calling Disconnect().

See also
RegisterEventHandler()
Parameters
eventHandlerThe event handler to unregister from the receiver

Implements ISpinnakerRelay.

Examples
ImageRelay.cpp.

The documentation for this class was generated from the following file: