Pleora Technologies Inc. eBUS SDK v7.0.1.7536 API



PvCameraBridge Class Reference

Bridge between a PvDevice and a camera connected through a serial port. More...

#include <PvCameraBridge.h>

Public Member Functions

 PvCameraBridge (PvDevice *aDevice, PvDeviceSerial aPort, PvStream *aStream=NULL)
 Constructor. More...
 
virtual ~PvCameraBridge ()
 Destructor.
 
PvGenParameterArrayGetParameters ()
 Returns the GenICam parameter array for the camera. More...
 
bool IsConnected ()
 Checks if the bridge is connected to a camera. More...
 
PvResult Disconnect ()
 Disconnects from the camera. More...
 
PvResult Recover ()
 Deprecated, do not use. More...
 
PvDeviceSerial GetPort () const
 Returns the serial port used by this bridge. More...
 
PvDeviceGetDevice ()
 Returns the PvDevice used by this bridge. More...
 
PvStreamGetStream ()
 Returns the PvStream used by this bridge. More...
 
PvResult StartAcquisition ()
 Starts image acquisition on the camera. More...
 
PvResult StopAcquisition ()
 Stops image acquisition on the camera. More...
 
bool GetParametersSyncEnabled () const
 Returns whether parameter synchronization is enabled. More...
 
void SetParametersSyncEnabled (bool aEnabled)
 Enables or disables parameter synchronization. More...
 
PvString GetSource () const
 Returns the current source name for parameters sync and acquisition start/stop. More...
 
void SetSource (const PvString &aSource)
 Sets the source name for parameters sync and acquisition start/stop. More...
 
PvResult RegisterEventSink (PvCameraBridgeEventSink *aEventSink)
 Registers an event sink to receive notifications. More...
 
PvResult UnregisterEventSink (PvCameraBridgeEventSink *aEventSink)
 Unregisters a previously registered event sink. More...
 
PvResult ConnectPleoraCameraFile (const PvString &aPath)
 Connects to a camera using a Pleora Camera File. More...
 
PvResult GetPleoraCameraFileParserErrors (PvStringList &aErrors)
 Returns parser errors from the last Pleora Camera File load. More...
 
PvResult GetPleoraCameraFilePath (PvString &aPath) const
 Returns the path of the currently loaded Pleora Camera File. More...
 
PvResult ProbeCLProtocol (const PvString &aTemplate, PvString &aCameraID, PvStringList &aXMLIDs)
 Probes a camera using CameraLink Protocol to retrieve its identification. More...
 
PvResult ConnectCLProtocol (const PvString &aTemplate, const PvString &aXMLID="")
 Connects to a camera using CameraLink Protocol. More...
 
PvResult GetCLProtocolTemplate (PvString &aTemplate) const
 Returns the CameraLink Protocol template currently in use. More...
 
PvResult GetCLProtocolCameraID (PvString &aCameraID) const
 Returns the camera ID from the CameraLink Protocol connection. More...
 
PvResult GetCLProtocolXMLID (PvString &aXMLID) const
 Returns the XML ID used for the CameraLink Protocol connection. More...
 
PvResult GetGenCPXMLIDs (PvStringList &aXMLIDs)
 Returns the list of XML IDs available for GenCP connection. More...
 
PvResult ConnectGenCP (const PvString &aXMLID="")
 Connects to a camera using GenCP. More...
 
PvResult GetGenCPXMLID (PvString &aXMLID) const
 Returns the XML ID used for the GenCP connection. More...
 
PvResult Save (const PvString &aPrefix, PvConfigurationWriter &aWriter)
 Saves the camera bridge configuration. More...
 
PvResult Load (const PvString &aPrefix, PvConfigurationReader &aReader, PvStringList &aErrors)
 Loads the camera bridge configuration. More...
 
uint64_t GetBytesSentToCamera () const
 Returns the total number of bytes sent to the camera. More...
 
uint64_t GetBytesReceivedFromCamera () const
 Returns the total number of bytes received from the camera. More...
 
void ResetStatistics ()
 Resets communication statistics. More...
 

Static Public Member Functions

static PvResult GetCLProtocolTemplates (PvStringList &aTemplates)
 Returns the list of available CameraLink Protocol templates. More...
 
static bool IsPoCLSupported (PvDevice *aDevice)
 Checks if Power over Camera Link (PoCL) is supported by the device. More...
 
static bool IsPoCLEnabled (PvDevice *aDevice)
 Checks if Power over Camera Link (PoCL) is currently enabled. More...
 
static PvResult SetPoCLEnabled (PvDevice *aDevice, bool aEnabled)
 Enables or disables Power over Camera Link (PoCL). More...
 

Detailed Description

Bridge between a PvDevice and a camera connected through a serial port.

Used to provide a GenApi interface to a frame grabber camera.

PvCameraBridge provides communication with cameras connected through serial ports (RS-232, Camera Link, etc.) and supports multiple protocols including Pleora Camera File (PCF), CameraLink Protocol (CLP), and GenCP.

Can be used to provide a camera bridge to:

  • A GenCP compliant camera
  • A camera that can be controlled through a CLProtocol library
  • A camera described by a Pleora Camera file (for future use only)

The Pleora Camera Files are intended for future use. Contact your Pleora representative if you would like to learn more about this feature.

Constructor & Destructor Documentation

◆ PvCameraBridge()

PvCameraBridge::PvCameraBridge ( PvDevice aDevice,
PvDeviceSerial  aPort,
PvStream aStream = NULL 
)

Constructor.

Parameters
[in]aDeviceThe PvDevice to use for communication.
[in]aPortThe serial port to use for camera communication.
[in]aStreamOptional PvStream for image acquisition.
[in]aDeviceDevice (typically a frame grabber) the camera is connected to.
[in]aPortSerial port on the device used to interface the camera.
[in]aStreamStream objects used to received images from the frame grabber and camera.

Member Function Documentation

◆ ConnectCLProtocol()

PvResult PvCameraBridge::ConnectCLProtocol ( const PvString aTemplate,
const PvString aXMLID = "" 
)

Connects to a camera using CameraLink Protocol.

Connects the camera bridge using CLProtocol.

Parameters
[in]aTemplateThe CameraLink Protocol template to use.
[in]aXMLIDOptional XML ID to use. If empty, the first matching ID is used.
Returns
Result of the operation.
Parameters
[in]aTemplateThe CLProtocol device template.
[in]aXMLIDthe XML ID to use to build the GenApi interface. If not provided, the first available is used.
Returns
Includes:

◆ ConnectGenCP()

PvResult PvCameraBridge::ConnectGenCP ( const PvString aXMLID = "")

Connects to a camera using GenCP.

Connects the camera bridge to a GenCP camera.

Parameters
[in]aXMLIDOptional XML ID to use. If empty, the first matching ID is used.
Returns
Result of the operation.
Parameters
[in]aXMLIDthe XML ID to use to build the GenApi interface. If not provided, the first manifest entry is used.
Returns
Includes:

◆ ConnectPleoraCameraFile()

PvResult PvCameraBridge::ConnectPleoraCameraFile ( const PvString aPath)

Connects to a camera using a Pleora Camera File.

Connects the camera bridge using a Pleora Camera File.

Parameters
[in]aPathPath to the Pleora Camera File (.pcf).
Returns
Result of the operation.

A Pleora Camera File is a YAML file made of ID, init sequence and parameter description sectons that can be used to setup a camera bridge.

The Pleora Camera Files are intended for future use. Please contact your Pleora representative if you would like to learn more about this feature.

Parameters
[in]aPathPath to the Pleora Camera File.
Returns
Includes:

◆ Disconnect()

PvResult PvCameraBridge::Disconnect ( )

Disconnects from the camera.

Disconnects the camera bridge.

Returns
Result of the operation.
Includes:

◆ GetBytesReceivedFromCamera()

uint64_t PvCameraBridge::GetBytesReceivedFromCamera ( ) const

Returns the total number of bytes received from the camera.

Returns how many bytes were received from the camera through the bridge.

Returns
Bytes received count.
Bytes received from the camera.

◆ GetBytesSentToCamera()

uint64_t PvCameraBridge::GetBytesSentToCamera ( ) const

Returns the total number of bytes sent to the camera.

Returns how many bytes were sent to the camera through the bridge.

Returns
Bytes sent count.
Bytes sent to the camera.

◆ GetCLProtocolCameraID()

PvResult PvCameraBridge::GetCLProtocolCameraID ( PvString aCameraID) const

Returns the camera ID from the CameraLink Protocol connection.

If the bridge is using CLProtocol returns the controller camera ID.

Parameters
[out]aCameraIDThe camera ID.
Returns
Result of the operation.
Parameters
[out]aCameraIDCLProtocol controller camera ID.
Returns
Includes:

◆ GetCLProtocolTemplate()

PvResult PvCameraBridge::GetCLProtocolTemplate ( PvString aTemplate) const

Returns the CameraLink Protocol template currently in use.

If the bridge is using CLProtocol returns the CLProtocol device template.

Parameters
[out]aTemplateThe template name.
Returns
Result of the operation.
Parameters
[out]aTemplateString where the CLProtocol device template is copied.
Returns
Includes:

◆ GetCLProtocolTemplates()

PvResult PvCameraBridge::GetCLProtocolTemplates ( PvStringList aTemplates)
static

Returns the list of available CameraLink Protocol templates.

Lists all avaiable CLProtocol device templates.

Parameters
[out]aTemplatesList of template names.
Returns
Result of the operation.

This function can succeed and aTemplates be empty if the enumeration is successful but no CLProtocol device templates are found.

Parameters
[out]aTemplatesList of string representing all available CLProtocol device templates.
Returns
Includes:

◆ GetCLProtocolXMLID()

PvResult PvCameraBridge::GetCLProtocolXMLID ( PvString aXMLID) const

Returns the XML ID used for the CameraLink Protocol connection.

If the bridge is using CLProtocol returns the CLProtocol XML ID.

Parameters
[out]aXMLIDThe XML ID.
Returns
Result of the operation.
Parameters
[out]aXMLIDCLProtocol XML ID.
Returns
Includes:

◆ GetDevice()

PvDevice * PvCameraBridge::GetDevice ( )

Returns the PvDevice used by this bridge.

Returns the device controller used by the camera bridge.

Returns
Pointer to the PvDevice.
Device pointer.

◆ GetGenCPXMLID()

PvResult PvCameraBridge::GetGenCPXMLID ( PvString aXMLID) const

Returns the XML ID used for the GenCP connection.

If the bridge is using GenCP returns the selected XML ID.

Parameters
[out]aXMLIDThe XML ID.
Returns
Result of the operation.
Parameters
[in]aXMLIDXML ID of the connected GenCP camera.
Returns
Includes:

◆ GetGenCPXMLIDs()

PvResult PvCameraBridge::GetGenCPXMLIDs ( PvStringList aXMLIDs)

Returns the list of XML IDs available for GenCP connection.

Returns all available GenCP XML IDs.

Parameters
[out]aXMLIDsList of XML IDs.
Returns
Result of the operation.
Parameters
[out]aXMLIDsA string list populated with the ID of all available GenApi XML IDs.
Returns
Includes:

◆ GetParameters()

PvGenParameterArray * PvCameraBridge::GetParameters ( )

Returns the GenICam parameter array for the camera.

Returns the GenApi interface of the camera.

Returns
Pointer to the parameter array.
GenApi interface of the camera or NULL if not connected.

◆ GetParametersSyncEnabled()

bool PvCameraBridge::GetParametersSyncEnabled ( ) const

Returns whether parameter synchronization is enabled.

Whether or not camera-to-grabber smart parameters synchronization is enabled.

Returns
True if enabled, false otherwise.
True if enabled.

◆ GetPleoraCameraFileParserErrors()

PvResult PvCameraBridge::GetPleoraCameraFileParserErrors ( PvStringList aErrors)

Returns parser errors from the last Pleora Camera File load.

Provides a list resulting from a failure of parsing a Pleora Camera File with ConnectPleoraCameraFile.

Parameters
[out]aErrorsList of error messages.
Returns
Result of the operation.
Parameters
[out]aErrorsList of strings containing the errors reported by the parser.
Returns
Includes:

◆ GetPleoraCameraFilePath()

PvResult PvCameraBridge::GetPleoraCameraFilePath ( PvString aPath) const

Returns the path of the currently loaded Pleora Camera File.

If the bridge is setup from a Pleora Camera File, returns the YAML configuration file path.

Parameters
[out]aPathPath to the Pleora Camera File.
Returns
Result of the operation.
Parameters
[out]aPathString where the path is copied to.
Returns
Includes:

◆ GetPort()

PvDeviceSerial PvCameraBridge::GetPort ( ) const

Returns the serial port used by this bridge.

Returns the device serial port used by the camera bridge.

Returns
The serial port.
Device serial port.

◆ GetSource()

PvString PvCameraBridge::GetSource ( ) const

Returns the current source name for parameters sync and acquisition start/stop.

Returns the streaming source on which parameter sync is performed, if enabled.

Returns
The source name.
Streaming source used for parameter synchronization.

◆ GetStream()

PvStream * PvCameraBridge::GetStream ( )

Returns the PvStream used by this bridge.

Returns the stream used by the camera bridge.

Returns
Pointer to the PvStream, or NULL if none.

Optional, can be NULL.

Returns
Stream pointer.

◆ IsConnected()

bool PvCameraBridge::IsConnected ( )

Checks if the bridge is connected to a camera.

Returns true if the bridge is currently connected.

Returns
True if connected, false otherwise.
True if connected.

◆ IsPoCLEnabled()

bool PvCameraBridge::IsPoCLEnabled ( PvDevice aDevice)
static

Checks if Power over Camera Link (PoCL) is currently enabled.

Static method which reports if PoCL is enabled on a device.

Parameters
[in]aDeviceThe device to check.
Returns
True if PoCL is enabled, false otherwise.
Parameters
[in]aDeviceThe device on which PoCL is tested.

PoCL can be enabled/disabled individually on each connector. Here we report that PoCL is enabled if it is enabled on at least one connector.

True is returned if PoCL is enabled on all availble connectors.

Returns
True if PoCL is enabled on the device.

◆ IsPoCLSupported()

bool PvCameraBridge::IsPoCLSupported ( PvDevice aDevice)
static

Checks if Power over Camera Link (PoCL) is supported by the device.

Static method which reports if PoCL is supported on a device.

Parameters
[in]aDeviceThe device to check.
Returns
True if PoCL is supported, false otherwise.
Parameters
[in]aDeviceThe device on which PoCL tested as being supported.
Returns
True if PoCL is supported on the device.

◆ Load()

PvResult PvCameraBridge::Load ( const PvString aPrefix,
PvConfigurationReader aReader,
PvStringList aErrors 
)

Loads the camera bridge configuration.

Restores a the camera bridge.

Parameters
[in]aPrefixPrefix for configuration entries.
[in]aReaderConfiguration reader to use.
[out]aErrorsList of errors encountered during load.
Returns
Result of the operation.

The load works on a best effort basis. Whatever can be restored will be restored.

The order to properties in the aPropertyList is not important.

Parameters
[in]aPrefixThe prefix to used to identify this camera bridge in the persistence data.
[in]aReaderConfiguration reader used to read back the camera bridge state.
[out]aErrorsA list where all persistence errors are appended.
Returns
Includes:

◆ ProbeCLProtocol()

PvResult PvCameraBridge::ProbeCLProtocol ( const PvString aTemplate,
PvString aCameraID,
PvStringList aXMLIDs 
)

Probes a camera using CameraLink Protocol to retrieve its identification.

Probes for a CLProtocol camera and returns the camera ID and all its available GenApi XML IDs if found.

Parameters
[in]aTemplateThe CameraLink Protocol template to use.
[out]aCameraIDThe camera ID retrieved from the camera.
[out]aXMLIDsList of XML IDs that match the camera.
Returns
Result of the operation.
Parameters
[in]aTemplateThe CL Protocol device template. See GetCLProtocolTemplates.
[out]aCameraIDA string containing the CLProtocol device identifier for the camera.
[out]aXMLIDsA string list populated with the ID of all available GenApi XML IDs.
Returns
Includes:

◆ Recover()

PvResult PvCameraBridge::Recover ( )

Deprecated, do not use.

Deprecated.

Returns
Result of the operation.

Instead, on disconnect event use Save to store the serial bridge state. After reconnection, use Load to bring it back.

Returns
Includes:

◆ RegisterEventSink()

PvResult PvCameraBridge::RegisterEventSink ( PvCameraBridgeEventSink aEventSink)

Registers an event sink to receive notifications.

Register an event sink used for callbacks.

Parameters
[in]aEventSinkPointer to the event sink to register.
Returns
Result of the operation.
Parameters
[in]aEventSinkA pointer to the event sink.
Returns
Includes:

◆ ResetStatistics()

void PvCameraBridge::ResetStatistics ( )

Resets communication statistics.

Resets the camera bridge statistics.

◆ Save()

PvResult PvCameraBridge::Save ( const PvString aPrefix,
PvConfigurationWriter aWriter 
)

Saves the camera bridge configuration.

Persists the current display thread configuration.

Parameters
[in]aPrefixPrefix for configuration entries.
[in]aWriterConfiguration writer to use.
Returns
Result of the operation.

This call builds a list of properties containing pairs of names/values.

Parameters
[in]aPrefixThe prefix to used to identify this camera bridge in the persistence data.
[in]aWriterConfiguration writer used to persist the camera bridge state.
Returns
Includes:

◆ SetParametersSyncEnabled()

void PvCameraBridge::SetParametersSyncEnabled ( bool  aEnabled)

Enables or disables parameter synchronization.

Sets whether or not camera-to-grabber smart parameters synchronization is enabled.

Parameters
[in]aEnabledTrue to enable, false to disable.
[in]aEnabledTrue to enable synchronization.

◆ SetPoCLEnabled()

PvResult PvCameraBridge::SetPoCLEnabled ( PvDevice aDevice,
bool  aEnabled 
)
static

Enables or disables Power over Camera Link (PoCL).

Enables or disables PoCL on all connectors of a device.

Parameters
[in]aDeviceThe device to configure.
[in]aEnabledTrue to enable PoCL, false to disable.
Returns
Result of the operation.
Parameters
[in]aDeviceThe device on which PoCL is enabled or disabled.
[in]aEnabledTrue to enable PoCL, false to disable it.
Returns
Includes:

◆ SetSource()

void PvCameraBridge::SetSource ( const PvString aSource)

Sets the source name for parameters sync and acquisition start/stop.

Sets the streaming source on which parameter sync is performed, if enabled.

Parameters
[in]aSourceThe source name.

If not using a multi-source device, leave empty. If using a multi-source device, set to the SourceSelector of the source the camera belongs to.

Parameters
[in]aSourceString-based representation of the streaming source from the SourceSelector GenApi parameter.

◆ StartAcquisition()

PvResult PvCameraBridge::StartAcquisition ( )

Starts image acquisition on the camera.

Starts the acquisition on the camera.

Returns
Result of the operation.

Uses the GenApi interface to set TLParamsLocked and execute the AcquisitionStart command if these parameters exist. If they do not exist the function still succeeds.

Some cameras only stream if AcquisitionStart/AcquisitionStop and TLParamsLocked are managed properly. In a generic camera bridge application it is recommended to always call StartAcquisition and StopAcquisition on the camera bridge after starting and before stopping acquisition on the device (grabber) itself.

Returns
Includes:

◆ StopAcquisition()

PvResult PvCameraBridge::StopAcquisition ( )

Stops image acquisition on the camera.

Stops the acquisition on the camera.

Returns
Result of the operation.

Uses the GenApi interface to execute the AcquisitionStop command and set TLParamsLocked to 0 if these parameters exist. If they do not exist the function still succeeds.

Returns
Includes:

◆ UnregisterEventSink()

PvResult PvCameraBridge::UnregisterEventSink ( PvCameraBridgeEventSink aEventSink)

Unregisters a previously registered event sink.

Unregister an event sink.

Parameters
[in]aEventSinkPointer to the event sink to unregister.
Returns
Result of the operation.
Parameters
[in]aEventSinkA pointer to the event sink.
Returns
Includes:
See also
RegisterEventSink

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

Copyright (c) 2002-2026 Pleora Technologies Inc.
www.pleora.com