From bc31233570eb780c874c4db85014e75307a24481 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 7 Apr 2020 18:55:19 +0100 Subject: [PATCH] xrt: Add new "settings" interface for sharing camera settings across components --- doc/changes/xrt/mr.266.md | 1 + src/xrt/include/xrt/xrt_settings.h | 57 ++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 doc/changes/xrt/mr.266.md create mode 100644 src/xrt/include/xrt/xrt_settings.h diff --git a/doc/changes/xrt/mr.266.md b/doc/changes/xrt/mr.266.md new file mode 100644 index 000000000..9f2ffab07 --- /dev/null +++ b/doc/changes/xrt/mr.266.md @@ -0,0 +1 @@ +Add a new settings interface for trasnporting camera settings, in `xrt/xrt_settings.h`. diff --git a/src/xrt/include/xrt/xrt_settings.h b/src/xrt/include/xrt/xrt_settings.h new file mode 100644 index 000000000..e8ff40df3 --- /dev/null +++ b/src/xrt/include/xrt/xrt_settings.h @@ -0,0 +1,57 @@ +// Copyright 2020, Collabora, Ltd. +// SPDX-License-Identifier: BSL-1.0 +/*! + * @file + * @brief Common settings structs to be transferred between different parts of + * Monadon. + * @author Jakob Bornecrantz + * @ingroup xrt_iface + */ + +#pragma once + +#include "xrt/xrt_compiler.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/*! + * @ingroup xrt_iface + * @{ + */ + +/*! + * Camera type. + */ +enum xrt_settings_camera_type +{ + XRT_SETTINGS_CAMERA_TYPE_REGULAR_MONO = 0, + XRT_SETTINGS_CAMERA_TYPE_REGULAR_SBS = 1, + XRT_SETTINGS_CAMERA_TYPE_PS4 = 2, + XRT_SETTINGS_CAMERA_TYPE_LEAP_MOTION = 3, +}; + +#define XRT_SETTINGS_CAMERA_NAME_LENGTH 256 +#define XRT_SETTINGS_PATH_LENGTH 1024 + +/*! + * Holding enough information to recreate a tracking pipeline. + */ +struct xrt_settings_tracking +{ + char camera_name[XRT_SETTINGS_CAMERA_NAME_LENGTH]; + int camera_mode; + enum xrt_settings_camera_type camera_type; + char calibration_path[XRT_SETTINGS_PATH_LENGTH]; +}; + +/*! + * @} + */ + + +#ifdef __cplusplus +} +#endif