Function rs2_create_context_ex

Function Documentation

rs2_context *rs2_create_context_ex(int api_version, const char *json_settings, rs2_error **error)

Creates RealSense context that is required for the rest of the API, and accepts a settings JSON.

Parameters:
  • api_version[in] Users are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version.

  • json_settings[in] Pointer to a string containing a JSON configuration to use, or null if none Possible <setting>:<default-value> : inherit: true - (bool) whether to inherit and override library configuration file values: the ‘context’ key in the file is taken as-is ‘<executable-name>/context’ is merged, if it exists then the context-settings are merged dds: {} - (requires BUILD_WITH_DDS) false disables DDS; otherwise the DDS settings: domain: 0 - (int) the number of the DDS domain [0-232] participant: <exe name> - (string) the name of the participant (see additional settings in realdds/doc/device.md#Settings) format-conversion: full - (string) how to convert formats full: provide all conversions (e.g., YUYV -> RGB8 etc.) basic: use mostly raw camera formats (no RGB8 etc.); convert interleaved (Y8I -> 2xY8) raw: leave all formats from camera as they are options-update-interval: 1000 - (uint32_t) time interval in milliseconds for option value change notifications (see rs2_set_options_changed_callback)

  • error[out] If non-null, receives any error that occurs during this call, otherwise, errors are ignored.

Returns:

Context object