Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
Classes | Typedefs | Enumerations | Functions
rs_internal.h File Reference

Exposes RealSense internal functionality for C compilers. More...

#include "rs_types.h"
#include "rs_context.h"
#include "rs_sensor.h"
#include "rs_frame.h"
#include "rs_option.h"

Go to the source code of this file.

Classes

struct  rs2_video_stream
 All the parameters required to define a video stream. More...
 
struct  rs2_motion_stream
 All the parameters required to define a motion stream. More...
 
struct  rs2_pose_stream
 All the parameters required to define a pose stream. More...
 
struct  rs2_software_video_frame
 All the parameters required to define a video frame. More...
 
struct  rs2_software_motion_frame
 All the parameters required to define a motion frame. More...
 
struct  rs2_software_pose_frame
 All the parameters required to define a pose frame. More...
 
struct  rs2_software_pose_frame::pose_frame_info
 
struct  rs2_software_notification
 All the parameters required to define a sensor notification. More...
 

Typedefs

typedef enum rs2_recording_mode rs2_recording_mode
 
typedef struct rs2_video_stream rs2_video_stream
 All the parameters required to define a video stream. More...
 
typedef struct rs2_motion_stream rs2_motion_stream
 All the parameters required to define a motion stream. More...
 
typedef struct rs2_pose_stream rs2_pose_stream
 All the parameters required to define a pose stream. More...
 
typedef struct rs2_software_video_frame rs2_software_video_frame
 All the parameters required to define a video frame. More...
 
typedef struct rs2_software_motion_frame rs2_software_motion_frame
 All the parameters required to define a motion frame. More...
 
typedef struct rs2_software_pose_frame rs2_software_pose_frame
 All the parameters required to define a pose frame. More...
 
typedef struct rs2_software_notification rs2_software_notification
 All the parameters required to define a sensor notification. More...
 

Enumerations

enum  rs2_recording_mode { RS2_RECORDING_MODE_BLANK_FRAMES, RS2_RECORDING_MODE_COMPRESSED, RS2_RECORDING_MODE_BEST_QUALITY, RS2_RECORDING_MODE_COUNT }
 

Functions

rs2_contextrs2_create_recording_context (int api_version, const char *filename, const char *section, rs2_recording_mode mode, rs2_error **error)
 
rs2_contextrs2_create_mock_context (int api_version, const char *filename, const char *section, rs2_error **error)
 
rs2_contextrs2_create_mock_context_versioned (int api_version, const char *filename, const char *section, const char *min_api_version, rs2_error **error)
 
rs2_devicers2_create_software_device (rs2_error **error)
 
rs2_sensorrs2_software_device_add_sensor (rs2_device *dev, const char *sensor_name, rs2_error **error)
 
void rs2_software_sensor_on_video_frame (rs2_sensor *sensor, rs2_software_video_frame frame, rs2_error **error)
 
void rs2_software_sensor_on_motion_frame (rs2_sensor *sensor, rs2_software_motion_frame frame, rs2_error **error)
 
void rs2_software_sensor_on_pose_frame (rs2_sensor *sensor, rs2_software_pose_frame frame, rs2_error **error)
 
void rs2_software_sensor_on_notification (rs2_sensor *sensor, rs2_software_notification notif, rs2_error **error)
 
void rs2_software_sensor_set_metadata (rs2_sensor *sensor, rs2_frame_metadata_value value, rs2_metadata_type type, rs2_error **error)
 
void rs2_software_device_set_destruction_callback (const rs2_device *dev, rs2_software_device_destruction_callback_ptr on_notification, void *user, rs2_error **error)
 
void rs2_software_device_set_destruction_callback_cpp (const rs2_device *dev, rs2_software_device_destruction_callback *callback, rs2_error **error)
 
void rs2_software_device_create_matcher (rs2_device *dev, rs2_matchers matcher, rs2_error **error)
 
void rs2_software_device_register_info (rs2_device *dev, rs2_camera_info info, const char *val, rs2_error **error)
 
void rs2_software_device_update_info (rs2_device *dev, rs2_camera_info info, const char *val, rs2_error **error)
 
rs2_stream_profilers2_software_sensor_add_video_stream (rs2_sensor *sensor, rs2_video_stream video_stream, rs2_error **error)
 
rs2_stream_profilers2_software_sensor_add_video_stream_ex (rs2_sensor *sensor, rs2_video_stream video_stream, int is_default, rs2_error **error)
 
rs2_stream_profilers2_software_sensor_add_motion_stream (rs2_sensor *sensor, rs2_motion_stream motion_stream, rs2_error **error)
 
rs2_stream_profilers2_software_sensor_add_motion_stream_ex (rs2_sensor *sensor, rs2_motion_stream motion_stream, int is_default, rs2_error **error)
 
rs2_stream_profilers2_software_sensor_add_pose_stream (rs2_sensor *sensor, rs2_pose_stream pose_stream, rs2_error **error)
 
rs2_stream_profilers2_software_sensor_add_pose_stream_ex (rs2_sensor *sensor, rs2_pose_stream pose_stream, int is_default, rs2_error **error)
 
void rs2_software_sensor_add_read_only_option (rs2_sensor *sensor, rs2_option option, float val, rs2_error **error)
 
void rs2_software_sensor_update_read_only_option (rs2_sensor *sensor, rs2_option option, float val, rs2_error **error)
 
void rs2_software_sensor_add_option (rs2_sensor *sensor, rs2_option option, float min, float max, float step, float def, int is_writable, rs2_error **error)
 
void rs2_software_sensor_detach (rs2_sensor *sensor, rs2_error **error)
 

Detailed Description

Exposes RealSense internal functionality for C compilers.

Typedef Documentation

◆ rs2_motion_stream

All the parameters required to define a motion stream.

◆ rs2_pose_stream

All the parameters required to define a pose stream.

◆ rs2_recording_mode

librealsense Recorder is intended for effective unit-testing Currently supports three modes of operation:

◆ rs2_software_motion_frame

All the parameters required to define a motion frame.

◆ rs2_software_notification

All the parameters required to define a sensor notification.

◆ rs2_software_pose_frame

All the parameters required to define a pose frame.

◆ rs2_software_video_frame

All the parameters required to define a video frame.

◆ rs2_video_stream

All the parameters required to define a video stream.

Enumeration Type Documentation

◆ rs2_recording_mode

librealsense Recorder is intended for effective unit-testing Currently supports three modes of operation:

Enumerator
RS2_RECORDING_MODE_BLANK_FRAMES 
RS2_RECORDING_MODE_COMPRESSED 
RS2_RECORDING_MODE_BEST_QUALITY 
RS2_RECORDING_MODE_COUNT 

Function Documentation

◆ rs2_create_mock_context()

rs2_context* rs2_create_mock_context ( int  api_version,
const char *  filename,
const char *  section,
rs2_error **  error 
)

Create librealsense context that given a file will respond to calls exactly as the recording did if the user calls a method that was either not called during recording or violates causality of the recording error will be thrown

Parameters
[in]api_versionrealsense API version as provided by RS2_API_VERSION macro
[in]filenamestring representing the name of the file to play back from
[in]sectionstring representing the name of the section within existing recording
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
context object, should be released by rs2_delete_context

◆ rs2_create_mock_context_versioned()

rs2_context* rs2_create_mock_context_versioned ( int  api_version,
const char *  filename,
const char *  section,
const char *  min_api_version,
rs2_error **  error 
)

Create librealsense context that given a file will respond to calls exactly as the recording did if the user calls a method that was either not called during recording or violates causality of the recording error will be thrown

Parameters
[in]api_versionrealsense API version as provided by RS2_API_VERSION macro
[in]filenamestring representing the name of the file to play back from
[in]sectionstring representing the name of the section within existing recording
[in]min_api_versionreject any file that was recorded before this version
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
context object, should be released by rs2_delete_context

◆ rs2_create_recording_context()

rs2_context* rs2_create_recording_context ( int  api_version,
const char *  filename,
const char *  section,
rs2_recording_mode  mode,
rs2_error **  error 
)

Create librealsense context that will try to record all operations over librealsense into a file

Parameters
[in]api_versionrealsense API version as provided by RS2_API_VERSION macro
[in]filenamestring representing the name of the file to record
[in]sectionstring representing the name of the section within existing recording
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
context object, should be released by rs2_delete_context

◆ rs2_create_software_device()

rs2_device* rs2_create_software_device ( rs2_error **  error)

Create software device to enable use librealsense logic without getting data from backend but inject the data from outside

Parameters
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
software device object, should be released by rs2_delete_device

◆ rs2_software_device_add_sensor()

rs2_sensor* rs2_software_device_add_sensor ( rs2_device dev,
const char *  sensor_name,
rs2_error **  error 
)

Add sensor to the software device

Parameters
[in]devthe software device
[in]sensor_namethe name of the sensor
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
software sensor object, should be released by rs2_delete_sensor

◆ rs2_software_device_create_matcher()

void rs2_software_device_create_matcher ( rs2_device dev,
rs2_matchers  matcher,
rs2_error **  error 
)

Set the wanted matcher type that will be used by the syncer

Parameters
[in]devthe software device
[in]matchermatcher type
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_device_register_info()

void rs2_software_device_register_info ( rs2_device dev,
rs2_camera_info  info,
const char *  val,
rs2_error **  error 
)

Register a camera info value for the software device

Parameters
[in]devthe software device
[in]infoidentifier for the camera info to add.
[in]valstring value for this new camera info.
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_device_set_destruction_callback()

void rs2_software_device_set_destruction_callback ( const rs2_device dev,
rs2_software_device_destruction_callback_ptr  on_notification,
void *  user,
rs2_error **  error 
)

set callback to be notified when a specific software device is destroyed

Parameters
[in]devsoftware device
[in]on_notificationfunction pointer to register as callback
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_device_set_destruction_callback_cpp()

void rs2_software_device_set_destruction_callback_cpp ( const rs2_device dev,
rs2_software_device_destruction_callback callback,
rs2_error **  error 
)

set callback to be notified when a specific software device is destroyed

Parameters
[in]devsoftware device
[in]callbackcallback object created from c++ application. ownership over the callback object is moved into the relevant device lock
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_device_update_info()

void rs2_software_device_update_info ( rs2_device dev,
rs2_camera_info  info,
const char *  val,
rs2_error **  error 
)

Update an existing camera info value for the software device

Parameters
[in]devthe software device
[in]infoidentifier for the camera info to add.
[in]valstring value for this new camera info.
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_motion_stream()

rs2_stream_profile* rs2_software_sensor_add_motion_stream ( rs2_sensor sensor,
rs2_motion_stream  motion_stream,
rs2_error **  error 
)

Add motion stream to sensor

Parameters
[in]sensorthe software sensor
[in]motion_streamall the stream components
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_motion_stream_ex()

rs2_stream_profile* rs2_software_sensor_add_motion_stream_ex ( rs2_sensor sensor,
rs2_motion_stream  motion_stream,
int  is_default,
rs2_error **  error 
)

Add motion stream to sensor

Parameters
[in]sensorthe software sensor
[in]motion_streamall the stream components
[in]is_defaultwhether or not the stream should be a default stream for the device
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_option()

void rs2_software_sensor_add_option ( rs2_sensor sensor,
rs2_option  option,
float  min,
float  max,
float  step,
float  def,
int  is_writable,
rs2_error **  error 
)

Add an option to sensor

Parameters
[in]sensorthe software sensor
[in]optionthe wanted option
[in]minthe minimum value which will be accepted for this option
[in]maxthe maximum value which will be accepted for this option
[in]stepthe granularity of options which accept discrete values, or zero if the option accepts continuous values
[in]defthe initial value of the option
[in]is_writableshould the option be read-only or not
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_pose_stream()

rs2_stream_profile* rs2_software_sensor_add_pose_stream ( rs2_sensor sensor,
rs2_pose_stream  pose_stream,
rs2_error **  error 
)

Add pose stream to sensor

Parameters
[in]sensorthe software sensor
[in]pose_streamall the stream components
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_pose_stream_ex()

rs2_stream_profile* rs2_software_sensor_add_pose_stream_ex ( rs2_sensor sensor,
rs2_pose_stream  pose_stream,
int  is_default,
rs2_error **  error 
)

Add pose stream to sensor

Parameters
[in]sensorthe software sensor
[in]pose_streamall the stream components
[in]is_defaultwhether or not the stream should be a default stream for the device
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_read_only_option()

void rs2_software_sensor_add_read_only_option ( rs2_sensor sensor,
rs2_option  option,
float  val,
rs2_error **  error 
)

Add read only option to sensor

Parameters
[in]sensorthe software sensor
[in]optionthe wanted option
[in]valthe initial value
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_video_stream()

rs2_stream_profile* rs2_software_sensor_add_video_stream ( rs2_sensor sensor,
rs2_video_stream  video_stream,
rs2_error **  error 
)

Add video stream to sensor

Parameters
[in]sensorthe software sensor
[in]video_streamall the stream components
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_add_video_stream_ex()

rs2_stream_profile* rs2_software_sensor_add_video_stream_ex ( rs2_sensor sensor,
rs2_video_stream  video_stream,
int  is_default,
rs2_error **  error 
)

Add video stream to sensor

Parameters
[in]sensorthe software sensor
[in]video_streamall the stream components
[in]is_defaultwhether or not the stream should be a default stream for the device
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_detach()

void rs2_software_sensor_detach ( rs2_sensor sensor,
rs2_error **  error 
)

Sensors hold the parent device in scope via a shared_ptr. This function detaches that so that the software sensor doesn't keep the software device alive. Note that this is dangerous as it opens the door to accessing freed memory if care isn't taken.

Parameters
[in]sensorthe software sensor
[out]errorif non-null, recieves any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_on_motion_frame()

void rs2_software_sensor_on_motion_frame ( rs2_sensor sensor,
rs2_software_motion_frame  frame,
rs2_error **  error 
)

Inject motion frame to software sonsor

Parameters
[in]sensorthe software sensor
[in]frameall the frame components
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_on_notification()

void rs2_software_sensor_on_notification ( rs2_sensor sensor,
rs2_software_notification  notif,
rs2_error **  error 
)

Inject notification to software sonsor

Parameters
[in]sensorthe software sensor
[in]notifall the notification components
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_on_pose_frame()

void rs2_software_sensor_on_pose_frame ( rs2_sensor sensor,
rs2_software_pose_frame  frame,
rs2_error **  error 
)

Inject pose frame to software sonsor

Parameters
[in]sensorthe software sensor
[in]frameall the frame components
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_on_video_frame()

void rs2_software_sensor_on_video_frame ( rs2_sensor sensor,
rs2_software_video_frame  frame,
rs2_error **  error 
)

Inject video frame to software sonsor

Parameters
[in]sensorthe software sensor
[in]frameall the frame components
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_set_metadata()

void rs2_software_sensor_set_metadata ( rs2_sensor sensor,
rs2_frame_metadata_value  value,
rs2_metadata_type  type,
rs2_error **  error 
)

Set frame metadata for the upcoming frames

Parameters
[in]sensorthe software sensor
[in]valuemetadata key to set
[in]typemetadata value
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored

◆ rs2_software_sensor_update_read_only_option()

void rs2_software_sensor_update_read_only_option ( rs2_sensor sensor,
rs2_option  option,
float  val,
rs2_error **  error 
)

Update the read only option added to sensor

Parameters
[in]sensorthe software sensor
[in]optionthe wanted option
[in]valthe wanted value
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored