mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
d/dai, st/gui, t/common: Make DepthAI frameserver work with multicam sinks
This commit is contained in:
parent
9cf124254e
commit
e26a272c17
|
@ -894,11 +894,11 @@ depthai_fs_slam_stream_start(struct xrt_fs *xfs, struct xrt_slam_sinks *sinks)
|
|||
struct depthai_fs *depthai = depthai_fs(xfs);
|
||||
DEPTHAI_DEBUG(depthai, "DepthAI: SLAM stream start called");
|
||||
|
||||
depthai->sink[0] = nullptr; // 0 == CamA-4L / RGB
|
||||
depthai->sink[1] = sinks->left; // 1 == CamB-2L / Left Gray
|
||||
depthai->sink[2] = sinks->right; // 2 == CamC-2L / Right Gray
|
||||
depthai->sink[3] = nullptr; // 3 == CamD-4L
|
||||
if (depthai->want_cameras && sinks->left != NULL && sinks->right != NULL) {
|
||||
depthai->sink[0] = nullptr; // 0 == CamA-4L / RGB
|
||||
depthai->sink[1] = sinks->cams[0]; // 1 == CamB-2L / Left Gray
|
||||
depthai->sink[2] = sinks->cams[1]; // 2 == CamC-2L / Right Gray
|
||||
depthai->sink[3] = nullptr; // 3 == CamD-4L
|
||||
if (depthai->want_cameras && sinks->cams[0] != NULL && sinks->cams[1] != NULL) {
|
||||
os_thread_helper_start(&depthai->image_thread, depthai_mainloop, depthai);
|
||||
}
|
||||
if (depthai->want_imu && sinks->imu != NULL) {
|
||||
|
|
|
@ -94,10 +94,10 @@ gui_scene_hand_tracking_demo(struct gui_program *p)
|
|||
struct xrt_slam_sinks gen_lock = {0};
|
||||
u_sink_force_genlock_create( //
|
||||
&usysd->xfctx, //
|
||||
hand_sinks->left, //
|
||||
hand_sinks->right, //
|
||||
&gen_lock.left, //
|
||||
&gen_lock.right); //
|
||||
hand_sinks->cams[0], //
|
||||
hand_sinks->cams[1], //
|
||||
&gen_lock.cams[0], //
|
||||
&gen_lock.cams[1]); //
|
||||
|
||||
xrt_fs_slam_stream_start(the_fs, &gen_lock);
|
||||
|
||||
|
|
|
@ -224,7 +224,7 @@ create_depthai_stereo(struct camera_window *cw)
|
|||
struct xrt_frame_sink *tmp = &cw->base.sink;
|
||||
|
||||
struct xrt_slam_sinks sinks;
|
||||
u_sink_combiner_create(&cw->camera.xfctx, tmp, &sinks.left, &sinks.right);
|
||||
u_sink_combiner_create(&cw->camera.xfctx, tmp, &sinks.cams[0], &sinks.cams[1]);
|
||||
|
||||
// Now that we have setup a node graph, start it.
|
||||
xrt_fs_slam_stream_start(cw->camera.xfs, &sinks);
|
||||
|
|
|
@ -313,16 +313,16 @@ ns_setup_depthai_device(struct ns_builder *nsb,
|
|||
struct xrt_frame_sink *entry_right_sink = NULL;
|
||||
|
||||
#ifdef XRT_BUILD_DRIVER_HANDTRACKING
|
||||
u_sink_split_create(&usysd->xfctx, slam_sinks->left, hand_sinks->left, &entry_left_sink);
|
||||
u_sink_split_create(&usysd->xfctx, slam_sinks->right, hand_sinks->right, &entry_right_sink);
|
||||
u_sink_split_create(&usysd->xfctx, slam_sinks->cams[0], hand_sinks->cams[0], &entry_left_sink);
|
||||
u_sink_split_create(&usysd->xfctx, slam_sinks->cams[1], hand_sinks->cams[1], &entry_right_sink);
|
||||
#else
|
||||
entry_left_sink = slam_sinks->left;
|
||||
entry_right_sink = slam_sinks->right;
|
||||
entry_left_sink = slam_sinks->cams[0];
|
||||
entry_right_sink = slam_sinks->cams[1];
|
||||
#endif
|
||||
|
||||
entry_sinks = (struct xrt_slam_sinks){
|
||||
.left = entry_left_sink,
|
||||
.right = entry_right_sink,
|
||||
.cams[0] = entry_left_sink,
|
||||
.cams[1] = entry_right_sink,
|
||||
.imu = slam_sinks->imu,
|
||||
.gt = slam_sinks->gt,
|
||||
};
|
||||
|
@ -330,8 +330,8 @@ ns_setup_depthai_device(struct ns_builder *nsb,
|
|||
struct xrt_slam_sinks dummy_slam_sinks = {0};
|
||||
dummy_slam_sinks.imu = entry_sinks.imu;
|
||||
|
||||
u_sink_force_genlock_create(&usysd->xfctx, entry_sinks.left, entry_sinks.right, &dummy_slam_sinks.left,
|
||||
&dummy_slam_sinks.right);
|
||||
u_sink_force_genlock_create(&usysd->xfctx, entry_sinks.cams[0], entry_sinks.cams[1], &dummy_slam_sinks.cams[0],
|
||||
&dummy_slam_sinks.cams[1]);
|
||||
|
||||
xrt_fs_slam_stream_start(the_fs, &dummy_slam_sinks);
|
||||
|
||||
|
|
Loading…
Reference in a new issue