xrt: Add stream capture type

This commit is contained in:
Jakob Bornecrantz 2020-09-02 11:52:59 +01:00
parent 330279d330
commit 6846ab7637
4 changed files with 19 additions and 3 deletions

View file

@ -676,6 +676,7 @@ v4l2_fs_configure_capture(struct xrt_fs *xfs,
static bool
v4l2_fs_stream_start(struct xrt_fs *xfs,
struct xrt_frame_sink *xs,
enum xrt_fs_capture_type capture_type,
uint32_t descriptor_index)
{
struct v4l2_fs *vid = v4l2_fs(xfs);

View file

@ -47,6 +47,17 @@ struct xrt_fs_mode
enum xrt_stereo_format stereo_format;
};
/*!
* Enum describing which type of capture we are doing.
* @see xrt_fs
* @ingroup xrt_iface
*/
enum xrt_fs_capture_type
{
XRT_FS_CAPTURE_TYPE_TRACKING = 0,
XRT_FS_CAPTURE_TYPE_CALIBRATION = 1,
};
/*!
* @interface xrt_fs
* Frameserver that generates frames. Multiple subframes (like stereo and
@ -85,6 +96,7 @@ struct xrt_fs
*/
bool (*stream_start)(struct xrt_fs *xfs,
struct xrt_frame_sink *xs,
enum xrt_fs_capture_type capture_type,
uint32_t descriptor_index);
/*!
@ -144,9 +156,10 @@ xrt_fs_configure_capture(struct xrt_fs *xfs,
static inline bool
xrt_fs_stream_start(struct xrt_fs *xfs,
struct xrt_frame_sink *xs,
enum xrt_fs_capture_type capture_type,
uint32_t descriptor_index)
{
return xfs->stream_start(xfs, xs, descriptor_index);
return xfs->stream_start(xfs, xs, capture_type, descriptor_index);
}
/*!

View file

@ -374,7 +374,8 @@ scene_render_select(struct gui_scene *scene, struct gui_program *p)
u_sink_quirk_create(cs->xfctx, cali, &qp, &cali);
// Now that we have setup a node graph, start it.
xrt_fs_stream_start(cs->xfs, cali, cs->settings->camera_mode);
xrt_fs_stream_start(cs->xfs, cali, XRT_FS_CAPTURE_TYPE_CALIBRATION,
cs->settings->camera_mode);
#else
gui_scene_delete_me(p, &cs->base);
#endif

View file

@ -213,7 +213,8 @@ p_factory_ensure_frameserver(struct p_factory *fact)
u_sink_quirk_create(&fact->xfctx, xsink, &qp, &xsink);
// Start the stream now.
xrt_fs_stream_start(fact->xfs, xsink, fact->settings.camera_mode);
xrt_fs_stream_start(fact->xfs, xsink, XRT_FS_CAPTURE_TYPE_TRACKING,
fact->settings.camera_mode);
}
#endif