RDI API Reference
Types
| Name | Description |
|---|---|
| rdi_result_t | General plugin function result |
| rdi_image_format_t | Type of image format Note: Images are expected to be in non-linear color space (gamma-encoded) |
| rdi_image_type_t | Type of sensor image |
| rdi_lens_model_t | Lens model types |
| rdi_lq_t | Link quality (LQ) |
| rdi_plugin_flags_t | RDI plugin flags |
| rdi_position_s | Position information |
| rdi_orientation_s | Orientation information |
| rdi_image_s | Image used for a frame. |
| rdi_frame_s | Frame containing image and metadata Allocate a frame using the alloc() function. |
| rdi_context_s | Context for the current stream const char* is pointer to null-terminated UTF-8 string. |
| rdi_func_s | RDI functions |
| rdi_plugin_decl_s | RDI declaration |
Type Aliases
| Name | Description |
|---|---|
| rdi_plugin_func_t | Function signature |
Macros
| Name | Description |
|---|---|
| RDI_PLUGIN_EXPORT | |
| RDI_API_VERSION |
Variables
| Name | Description |
|---|---|
| model | Lens parameters with model-specific parameters Lens model |
| width | [const] Image width in pixels |
| height | [const] Image height in pixels |
Functions
| Name | Description |
|---|---|
| rdi_get_plugin_decl | Get the declaration of the RDI plugin (return static data). |
Type Alias Details
rdi_plugin_func_t
typedef rdi_result_t (*rdi_plugin_func_t)(rdi_func_t*, rdi_context_t*)
Function signature
Macro Details
RDI_API_VERSION
#define RDI_API_VERSION
RDI_PLUGIN_EXPORT
#define RDI_PLUGIN_EXPORT
Variable Details
height
uint32_t height
[const] Image height in pixels
model
rdi_lens_model_t model
Lens parameters with model-specific parameters Lens model
width
uint32_t width
[const] Image width in pixels
Function Details
rdi_get_plugin_decl
const rdi_plugin_decl_t* rdi_get_plugin_decl(void)
Get the declaration of the RDI plugin (return static data).
rdi_result_t
enum rdi_result_t
General plugin function result
RDI_RESULT_STREAM_COMPLETED : Clean end of stream (e.g., EOF for file, graceful RTSP close)
RDI_RESULT_ERROR_STREAM_DISRUPTED : Stream broken/disconnected (e.g., network error, connection lost)
rdi_image_format_t
enum rdi_image_format_t
Type of image format Note: Images are expected to be in non-linear color space (gamma-encoded)
rdi_image_type_t
enum rdi_image_type_t
Type of sensor image
rdi_lens_model_t
enum rdi_lens_model_t
Lens model types
rdi_lq_t
enum rdi_lq_t
Link quality (LQ)
rdi_plugin_flags_t
enum rdi_plugin_flags_t
RDI plugin flags
RDI_FLAG_SUPPORTS_LIVE = (1ULL << 0) : Supports live streamed video (e.g. via rtsp://)
RDI_FLAG_SUPPORTS_FILE = (1ULL << 1) : Supports loading recorded streams from file (e.g. file:// or native filepath)
rdi_position_s
struct rdi_position_s
Position information
Variables
| Name | Description |
|---|---|
| lat_deg | Latitude in degrees (WGS84) |
| lon_deg | Longitude in degrees (WGS84) |
| alt_m | Altitude in meters (above sea level) |
Variable Details
lat_deg
double lat_deg
Latitude in degrees (WGS84)
lon_deg
double lon_deg
Longitude in degrees (WGS84)
alt_m
double alt_m
Altitude in meters (above sea level)
rdi_orientation_s
struct rdi_orientation_s
Orientation information
Variables
| Name | Description |
|---|---|
| yaw_deg | Yaw angle in degrees (0 = north, 90 = east) |
| pitch_deg | Pitch angle in degrees (positive = up) |
| roll_deg | Roll angle in degrees (positive = right) |
Variable Details
yaw_deg
double yaw_deg
Yaw angle in degrees (0 = north, 90 = east)
pitch_deg
double pitch_deg
Pitch angle in degrees (positive = up)
roll_deg
double roll_deg
Roll angle in degrees (positive = right)
rdi_image_s
struct rdi_image_s
Image used for a frame. Allocating a frame, using rdi_frame_alloc(), will also allocate and initialize the image data buffer.
Variables
| Name | Description |
|---|---|
| format | [const] Image format |
| width | [const] Image width in pixels |
| height | [const] Image height in pixels |
| stride | [const] Bytes per row |
| type | Image type |
| buffer | Image data buffer |
Variable Details
format
rdi_image_format_t format
[const] Image format
width
uint32_t width
[const] Image width in pixels
height
uint32_t height
[const] Image height in pixels
stride
uint32_t stride
[const] Bytes per row
type
rdi_image_type_t type
Image type
buffer
void* buffer
Image data buffer
rdi_frame_s
struct rdi_frame_s
Frame containing image and metadata Allocate a frame using the alloc() function.
Variables
| Name | Description |
|---|---|
| timestamp_us | Capture timestamp in microseconds |
| frame_number | Should be increasing per frame in a stream |
| lens | Lens models with parameters |
| image | Image data |
| position | Metadata fields Position information |
| orientation | Orientation information |
Variable Details
timestamp_us
int64_t timestamp_us
Capture timestamp in microseconds
frame_number
uint64_t frame_number
Should be increasing per frame in a stream
lens
rdi_lens_t lens
Lens models with parameters
image
rdi_image_t image
Image data
position
rdi_position_t position
Metadata fields Position information
orientation
rdi_orientation_t orientation
Orientation information
rdi_context_s
struct rdi_context_s
Context for the current stream const char* is pointer to null-terminated UTF-8 string. The pointer might be NULL.
Variables
| Name | Description |
|---|---|
| userdata | Pointer to userdata (optional). |
| identifier | Used to identify a specific stream. |
| filepath | Path to stream. |
| url | Complete URL, see below for broken into parts. |
| url_scheme | URL parts. |
| url_port | Port extracted from the url, or 0 if not specified (no default port by scheme). |
| url_query | Percent-encoded |
Variable Details
userdata
void* userdata
Pointer to userdata (optional). Handled freely by plugin.
identifier
const char* identifier
Used to identify a specific stream. Empty string if not used.
filepath
const char* filepath
Path to stream. NULL if not used. Absolute file path on file system.
url
const char* url
Complete URL, see below for broken into parts. file:// will be treated as a URL.
url_scheme
const char* url_scheme
URL parts. (If url is valid, neither of these will be NULL pointers.)
url_port
unsigned int url_port
Port extracted from the url, or 0 if not specified (no default port by scheme).
url_query
const char* url_query
Percent-encoded
rdi_func_s
struct rdi_func_s
RDI functions
Variables
| Name | Description |
|---|---|
| frame_submit | Frame |
| parse_iso_time_us | Util Parse time into microseconds (UTC) from ISO8601 time. |
| current_time_us | Get current time in microseconds (UTC). |
Variable Details
frame_submit
void (*frame_submit)(rdi_context_t* context, rdi_frame_t* frame, const char* stream_id)
Frame
parse_iso_time_us
int64_t (*parse_iso_time_us)(const char* time_str)
Util Parse time into microseconds (UTC) from ISO8601 time. Returns -1 on error.
current_time_us
int64_t (*current_time_us)()
Get current time in microseconds (UTC).
rdi_plugin_decl_s
struct rdi_plugin_decl_s
RDI declaration
Variables
| Name | Description |
|---|---|
| init | rdi_plugin_func_t init |
| run | rdi_plugin_func_t run |
| shutdown | rdi_plugin_func_t shutdown |
| flags | See rdi_plugin_flags_t definition |
| filepath_ext_filter | Space-separated file extensions relevant for the plugin, e.g. "mp4 mov ts" |
| config | Pointer to null-terminated UTF-8 string containing a JSON document |
Variable Details
init
rdi_plugin_func_t init
rdi_plugin_func_t init
run
rdi_plugin_func_t run
rdi_plugin_func_t run
shutdown
rdi_plugin_func_t shutdown
rdi_plugin_func_t shutdown
flags
uint64_t flags
See rdi_plugin_flags_t definition
filepath_ext_filter
const char* filepath_ext_filter
Space-separated file extensions relevant for the plugin, e.g. "mp4 mov ts"
config
const char* config
Pointer to null-terminated UTF-8 string containing a JSON document