AravisDetectorPlugin#

The aravis plugin follows the general folder structure for a frameProcessor plugin:

  • AravisPlugin

    • include

      • AravisDetectorPlugin.h

    • src

      • AravisDetectorPlugin.cpp

      • AravisDetectorPluginLib.cpp

Flow diagram#

Within the Odin-data stack frame processor plugins are normally called by the frame processor app whenever the frame receiver signals a new buffer. The Aravis Plugin bypasses this by acquiring the images directly from the camera. This process is enabled using a callback function that is automatically called by the GObject library function g_callback_function. The plugin then acquires the buffer, transforms it into a frame object and passes it along the chain (or tree) of plugins. A more general description can be seen in the following graph:

Frame Processor App
Frame Processor App
--config JSON file
--config JSON file
Aravis Detector Plugin
Thread
#1
Thread...
#2
#2
Constructor:
Starts new status
thread
Constructor:...
Parse JSON configs
Parse JSON configs
If start/stop
If start/stop
If find cameras
If find cameras
Find and list cameras
Find and list c...
If connect camera
If connect camera
Connect camera
Connect camera
If set camera param
If set camera param
Set exposure/frame rate/etc
Set exposure/fr...
If data set value
If data set value
Set file name/data set name
Set file name/d...
If connected to camera/streaming
If connected to came...
Read configs
Read configs
Wait 1
second
Wait 1...
Start stream
Start stream
  • Check connection to camera
  • Stop any previous streams
  • Set camera acquisition mode to continuous
  • Create stream object and allocate N buffers
  • Setup Callback
  • Start acquisition
Check connection to cameraStop any pre...
Acquire_buffer
Acquire_buffer
Process buffer into
DataFrameBlock
Process buffer into...
Process frame
Process frame
Push to next Plugin(s)
Push to next Plugin(s)
Camera
Buffer
acquired
Camera...
Plugin Stack
Plugin Stack
Odin Control server
Odin Control...
Text is not SVG - cannot display

Main process thread#

The plugin is controlled by passing configuration values to the frame processor (see user explanations). The config values are then parsed by the parse_configs function illustrated by the parse JSON configs block. As the config values are parsed, each value calls the corresponding function to execute the command. The graph does NOT illustrate each config and function and rather groups them together for clarity.

The start stream parameter enables continuous mode capture. To do this it allocates a group of buffer images in a stream object and enables callback signals from the camera. The camera then signals each finished buffer, which in turn start the buffer processing chain.

Status thread#

The status thread is started by the constructor and repeatedly polls the camera and stream objects for config values at a set frequency of 1 Hz.