Skip to main content

RDI API Reference

Types

NameDescription
rdi_result_tGeneral plugin function result
rdi_image_format_tType of image format Note: Images are expected to be in non-linear color space (gamma-encoded)
rdi_image_type_tType of sensor image
rdi_lens_model_tLens model types
rdi_lq_tLink quality (LQ)
rdi_plugin_flags_tRDI plugin flags
rdi_position_sPosition information
rdi_orientation_sOrientation information
rdi_image_sImage used for a frame.
rdi_frame_sFrame containing image and metadata Allocate a frame using the alloc() function.
rdi_context_sContext for the current stream const char* is pointer to null-terminated UTF-8 string.
rdi_func_sRDI functions
rdi_plugin_decl_sRDI declaration

Type Aliases

NameDescription
rdi_plugin_func_tFunction signature

Macros

NameDescription
RDI_PLUGIN_EXPORT
RDI_API_VERSION

Variables

NameDescription
modelLens parameters with model-specific parameters Lens model
width[const] Image width in pixels
height[const] Image height in pixels

Functions

NameDescription
rdi_get_plugin_declGet 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

NameDescription
lat_degLatitude in degrees (WGS84)
lon_degLongitude in degrees (WGS84)
alt_mAltitude 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

NameDescription
yaw_degYaw angle in degrees (0 = north, 90 = east)
pitch_degPitch angle in degrees (positive = up)
roll_degRoll 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

NameDescription
format[const] Image format
width[const] Image width in pixels
height[const] Image height in pixels
stride[const] Bytes per row
typeImage type
bufferImage 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

NameDescription
timestamp_usCapture timestamp in microseconds
frame_numberShould be increasing per frame in a stream
lensLens models with parameters
imageImage data
positionMetadata fields Position information
orientationOrientation 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

NameDescription
userdataPointer to userdata (optional).
identifierUsed to identify a specific stream.
filepathPath to stream.
urlComplete URL, see below for broken into parts.
url_schemeURL parts.
url_portPort extracted from the url, or 0 if not specified (no default port by scheme).
url_queryPercent-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

NameDescription
frame_submitFrame
parse_iso_time_usUtil Parse time into microseconds (UTC) from ISO8601 time.
current_time_usGet 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

NameDescription
initrdi_plugin_func_t init
runrdi_plugin_func_t run
shutdownrdi_plugin_func_t shutdown
flagsSee rdi_plugin_flags_t definition
filepath_ext_filterSpace-separated file extensions relevant for the plugin, e.g. "mp4 mov ts"
configPointer 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