52 static_assert(std::is_standard_layout_v<FrameServerBase>,
53 "glue base must be standard layout for pointer recovery");
54 static_assert(is_non_virtual_base_v<FrameServerBase, T>,
55 "glue base must be a non-virtual base of T for pointer recovery");
57 auto &xfs = *getXFS();
61 xfs.enumerate_modes = enumerateModesWrap;
62 xfs.configure_capture = configureCaptureWrap;
63 xfs.stream_start = streamStartWrap;
64 xfs.stream_stop = streamStopWrap;
65 xfs.is_running = isRunningWrap;
67 if constexpr (functions.slam) {
68 xfs.slam_stream_start = slamStreamStartWrap;
75 derived()
const noexcept
77 return static_cast<const T &
>(*this);
83 return static_cast<T &
>(*this);
87 fromXFS(
const xrt_fs *xfs)
noexcept
93 fromXFS(
xrt_fs *xfs)
noexcept
99 getXFS()
const noexcept
101 return &mFrameServer;
107 return &mFrameServer;
123#define GET(xfs) (*fromXFS(xfs))
126 enumerateModesWrap(
struct xrt_fs *xfs,
struct xrt_fs_mode **out_modes, uint32_t *out_count)
noexcept
128 return GET(xfs).enumerateModes(out_modes, out_count);
135 return GET(xfs).configureCapture(cp);
140 streamStartWrap(
struct xrt_fs *xfs,
143 uint32_t descriptor_index)
noexcept
145 return GET(xfs).streamStart(xs, capture_type, descriptor_index);
152 return GET(xfs).slamStreamStart(sinks);
157 streamStopWrap(
struct xrt_fs *xfs)
noexcept
159 return GET(xfs).streamStop();
164 isRunningWrap(
struct xrt_fs *xfs,
bool *out_is_running)
noexcept
166 return GET(xfs).isRunning(*out_is_running);
CRTP glue wrapper for xrt_fs.
Definition g_frameserver.hpp:48
Catch guards for glue classes.
Shared type traits for glue classes.
void u_frameserver_populate_function_pointers(struct xrt_fs *xfs)
Populate the frameserver's function pointers with default implementations.
Definition u_frameserver.c:17
enum xrt_result xrt_result_t
Result type used across Monado.
xrt_fs_capture_type
Enum describing which type of capture we are doing.
Definition xrt_frameserver.h:59
@ XRT_ERROR_UNCAUGHT_EXCEPTION
C++ code threw an exception that wasn't caught.
Definition xrt_results.h:264
Selects which optional functions that the FrameServerBase wrapper should set.
Definition g_frameserver.hpp:29
bool slam
xrt_fs::slam_stream_start
Definition g_frameserver.hpp:31
A object that is sent frames.
Definition xrt_frame.h:58
Controlling the camera capture parameters.
Definition xrt_frameserver.h:36
Definition xrt_frameserver.h:46
Frameserver that generates frames.
Definition xrt_frameserver.h:72
Container of pointers to sinks that could be used for a SLAM system.
Definition xrt_tracking.h:214
Misc helpers for xrt_fs implementations.
Frameserver interface for video drivers.