3. API
RTMS library dependency
The RTMS sender/receiver APIs now live in the dedicated
ifw-rtmslib package. That library provides the low-latency RTMS
primitives (extended info packing, sender/receiver classes, logging
helpers) built on top of llnetio. Refer to the ifw-rtmslib user
manual for the authoritative description of those classes and their
configuration knobs.
This manual focuses on the ifw-rtmstools components that build on top of that library: the engineering receiver tooling and the RTMS-to-DDT gateway.
Receiver tooling and DDT gateway
rtmsreceiver_llnetio/rtmsReceiverTool.hpp provides
ifw::rtmstools::llnetio::RtmsReceiverTool, a convenience
subclass that implements HandleSampleUser() by counting samples,
computing interval statistics (both wall-clock and timestamp-based) and
keeping track of lost frames. ReceiverToolStats exposes the sample
counts, rate in Hz, min/max/average intervals, standard deviation and
the total received byte count. The command line utility instantiates
this class and turns the statistics into YAML when the process
terminates.
The rtms2ddtlib_llnetio module bridges RTMS receivers with the DDT
broker and is available both to the CLI receiver and as a reusable
library:
DdtImageowns the pixel buffer plus its width/height/bpp metadata and exposes raw access for the publisher.DdtSendermanages a lock-free single-producer/single-consumer queue and owns theddt::DdtDataPublisherinstance that streams images at the requested interval. Static atomic flags control the background publishing loop.Rtms2DdtGatewayderives from the RTMS receiver base class provided by ifw-rtmslib, validates the incoming geometry (width/height deduced from the extended info), copies payloads intoDdtImageinstances, and pushes them into theDdtSenderqueue.
Typical configuration points include:
DDT broker URI (
zpb.rr://.../broker/<name>) and stream name to publish to.Publishing cadence (seconds) when forwarding RTMS frames.
Validation of incoming geometry (width/height/bpp) before publishing.
Back-pressure handling via the single-producer/single-consumer queue used by
DdtSender.
The gateway automatically reconnects to the broker when it restarts and limits repetitive log messages for missing geometry or absent Basic Image Information in leaders. Tools that embed the gateway should ensure the receiver and sender agree on extended info mode so geometry and datatype are present in the leader when required by DDT.