How aravisproject/aravis works
1. Purpose and principal workflow
Aravis is a GLib/GObject C library for acquiring video from GenICam industrial cameras over Gigabit Ethernet and USB3, with a simulator, GStreamer source, GenTL producer API, and desktop viewer. The principal interactive workflow is initiated when a desktop user launches the viewer: the viewer launcher initializes GTK and GStreamer, configures Aravis acquisition options, creates the viewer application, and hands execution to its application event loop; the viewer’s camera-to-display wiring is not included in the sampled source.
2. Components
Applications and callers
• Desktop User — path: null; launches and operates the documented simple video viewer.
• Viewer Launcher — viewer/main.c; parses acquisition/debug options, initializes GTK/GStreamer, constructs ArvViewer, applies network/USB policies, and runs it as a GApplication.
• Viewer Application — viewer/arvviewer.c; owns the viewer application/UI behavior invoked by the launcher, though its implementation was not sampled.
• GStreamer Pipeline Application — path: null; an external GStreamer client can instantiate the documented aravissrc source element.
• GenTL Consumer Application — path: null; an external GenTL client calls the producer-facing C API.
• GenICam Industrial Camera — path: null; the external camera device from which the library acquires video via Ethernet or USB3.
Core acquisition and GenICam model
• Public Aravis API — src/arv.h; provides the umbrella public include surface consumed by applications and extensions.
• Camera Facade — src/arvcamera.c; exposes camera-level operations such as region, pixel format, frame rate, gain, exposure, acquisition control, payload sizing, and stream creation.
• Device Feature Access — src/arvdevice.c; applies camera-device feature strings and represents lower-level device access behind the camera facade.
• Interface and Discovery Layer — src/arvinterface.c; represents camera-facing interfaces, with system-level discovery also organized in the adjacent interface/system source family.
• Acquisition Stream — src/arvstream.c; owns the generic stream abstraction into which clients provide reusable acquisition buffers.
• Frame Buffer — src/arvbuffer.c; represents payload storage, including chunk-data payloads.
• GenICam Feature Model — src/arvgc.c; constructs and evaluates the GenICam feature graph used to resolve typed camera and chunk features.
• Chunk Metadata Parser — src/arvchunkparser.c; creates an independent GenICam model from XML, attaches an acquired buffer to it, and reads typed boolean, string, integer, or float chunk values.
Transport and device implementations
• GigE Vision Device Control — src/arvgvdevice.c; implements the Gigabit-Ethernet camera device backend documented by the project.
• GigE Vision Stream — src/arvgvstream.c; implements Ethernet streaming behavior and exposes packet-resend/timeout settings used by the viewer and GStreamer source.
• USB3 Vision Transport — src/arvuvstream.c; provides the USB acquisition-stream backend; README documents optional libusb-based USB support.
• Virtual V4L2 Backend — src/arvv4l2device.c; provides a distinct V4L2-oriented device backend present in the library source tree.
• Ethernet Camera Simulator — src/arvfakecamera.c; provides the basic Ethernet camera simulator documented in the README.
Interoperability
• GStreamer Aravis Source — gst/gstaravis.c; implements the aravissrc GstPushSrc, negotiates camera capabilities, configures camera features, creates a stream, and prequeues Aravis buffers.
• GenTL Device Adapter — src/gentl/dev.c; maps GenTL device handles to ArvCamera objects and exposes camera IDs, remote-device ports, and GigE stream-channel information through GenTL entry points.
3. Relationships
• Desktop User -> Viewer Launcher: launches; the launcher is the executable main entry point.
• Viewer Launcher -> Viewer Application: creates, configures, and runs; it calls arv_viewer_new, arv_viewer_set_options, and g_application_run.
• Viewer Launcher -> Public Aravis API: initializes and configures acquisition policies; it includes the public API and passes register-cache, range-check, GigE, and USB options to the viewer.
• Viewer Launcher -> GStreamer Pipeline Application: initializes the GStreamer runtime used by the viewer process; it calls gst_init, but the viewer’s subsequent pipeline construction is unsampled.
• GStreamer Pipeline Application -> GStreamer Aravis Source: instantiates/configures; the source is documented as the aravissrc element.
• GStreamer Aravis Source -> Camera Facade: reads capabilities and configures acquisition; direct calls obtain bounds/formats and set pixel format, region, frame rate, gain, exposure, and acquisition state.
• GStreamer Aravis Source -> Device Feature Access: applies arbitrary configured feature strings; it obtains the camera device and calls the device feature setter.
• GStreamer Aravis Source -> Acquisition Stream: creates and configures; it creates a camera stream and sets GigE packet-resend behavior when applicable.
• GStreamer Aravis Source -> Frame Buffer: allocates and queues; it creates payload-sized buffers and pushes them onto the stream.
• Chunk Metadata Parser -> GenICam Feature Model: constructs and queries; it creates a GenICam model from XML and resolves requested feature nodes.
• Chunk Metadata Parser -> Frame Buffer: attaches payload context for chunk extraction; it sets the supplied buffer on its GenICam model before evaluating chunk values.
• GenTL Consumer Application -> GenTL Device Adapter: invokes the producer API; adapter functions accept GenTL device handles.
• GenTL Device Adapter -> Camera Facade: reads camera identity and GigE stream-channel information; it calls camera ID, device, and GigE channel APIs.
• Camera Facade -> GenICam Industrial Camera: controls and acquires from; this is the repository’s documented camera-acquisition role, with GigE/USB backend selection details not established in sampled call sites.
• GigE Vision Device Control -> GenICam Industrial Camera: communicates over Gigabit Ethernet; README documents this transport implementation.
• USB3 Vision Transport -> GenICam Industrial Camera: communicates over USB3; README documents this transport implementation.
4. Coverage limits
The sampled files do not include ArvViewer implementation, generic camera/device/stream internals, or the omitted portions of gstaravis.c that deliver completed frames downstream. Therefore, exact viewer UI-to-camera/pipeline wiring, discovery ordering, protocol selection, simulator startup paths, and V4L2 behavior cannot be established conclusively.
Main entry points: gstaravis.c GStreamer Aravis Source · main.c Viewer Launcher · arvcamera.c Camera Facade · arvchunkparser.c Chunk Metadata Parser
Components 17
Applications and Callers
- Desktop User
- Viewer Launcher
viewer/main.c - Viewer Application · Viewer implementation was not sampled.
viewer/arvviewer.c - GStreamer Pipeline Application
- GenTL Consumer Application
Core Acquisition Model
- Public Aravis API
src/arv.h - Camera Facade
src/arvcamera.c - Device Feature Access
src/arvdevice.c - Acquisition Stream
src/arvstream.c - Frame Buffer
src/arvbuffer.c - GenICam Feature Model
src/arvgc.c - Chunk Metadata Parser
src/arvchunkparser.c
Transport Backends
- GenICam Industrial Camera
- GigE Vision Device Control
src/arvgvdevice.c - USB3 Vision Transport
src/arvuvstream.c
Interoperability
- GStreamer Aravis Source
gst/gstaravis.c - GenTL Device Adapter
src/gentl/dev.c
Connections 16
- Desktop User → Viewer Launcher: launches · Viewer executable main entry point.
- Viewer Launcher → Viewer Application: creates and runs
- Viewer Launcher → Public Aravis API: configures policies
- Viewer Launcher → GStreamer Pipeline Application: initializes runtime · Initializes GStreamer for the viewer process.
- GStreamer Pipeline Application → GStreamer Aravis Source: instantiates · Uses the documented aravissrc element.
- GStreamer Aravis Source → Camera Facade: configures acquisition
- GStreamer Aravis Source → Device Feature Access: sets features
- GStreamer Aravis Source → Acquisition Stream: creates and configures
- GStreamer Aravis Source → Frame Buffer: allocates and queues
- Chunk Metadata Parser → GenICam Feature Model: constructs and queries
- Chunk Metadata Parser → Frame Buffer: attaches payload · Sets the supplied buffer for chunk extraction.
- GenTL Consumer Application → GenTL Device Adapter: invokes API
- GenTL Device Adapter → Camera Facade: reads camera data · Reads camera identity and GigE stream-channel information.
- Camera Facade → GenICam Industrial Camera: controls and acquires
- GigE Vision Device Control → GenICam Industrial Camera: communicates over Ethernet
- USB3 Vision Transport → GenICam Industrial Camera: communicates over USB3