mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-04 06:06:17 +00:00
d/dai: Refactor a bit so we can at compile time support OAK-D
This commit is contained in:
parent
764ec63cc6
commit
96248931cc
|
@ -89,6 +89,12 @@ struct depthai_fs
|
||||||
|
|
||||||
dai::Device *device;
|
dai::Device *device;
|
||||||
dai::DataOutputQueue *queue;
|
dai::DataOutputQueue *queue;
|
||||||
|
|
||||||
|
dai::ColorCameraProperties::SensorResolution sensor_resoultion;
|
||||||
|
dai::CameraImageOrientation image_orientation;
|
||||||
|
dai::ColorCameraProperties::ColorOrder color_order;
|
||||||
|
uint32_t fps;
|
||||||
|
bool interleaved;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -329,10 +335,26 @@ depthai_fs_single_rgb(struct xrt_frame_context *xfctx)
|
||||||
depthai->node.break_apart = depthai_fs_node_break_apart;
|
depthai->node.break_apart = depthai_fs_node_break_apart;
|
||||||
depthai->node.destroy = depthai_fs_node_destroy;
|
depthai->node.destroy = depthai_fs_node_destroy;
|
||||||
depthai->ll = debug_get_log_option_depthai_log();
|
depthai->ll = debug_get_log_option_depthai_log();
|
||||||
depthai->width = 1280;
|
|
||||||
depthai->height = 800; // Constant for now
|
|
||||||
depthai->device = d;
|
depthai->device = d;
|
||||||
|
|
||||||
|
if (true) {
|
||||||
|
depthai->width = 1280;
|
||||||
|
depthai->height = 800;
|
||||||
|
depthai->sensor_resoultion = dai::ColorCameraProperties::SensorResolution::THE_800_P;
|
||||||
|
depthai->image_orientation = dai::CameraImageOrientation::ROTATE_180_DEG;
|
||||||
|
depthai->fps = 60; // 120?
|
||||||
|
depthai->interleaved = true;
|
||||||
|
depthai->color_order = dai::ColorCameraProperties::ColorOrder::RGB;
|
||||||
|
} else {
|
||||||
|
depthai->width = 1920;
|
||||||
|
depthai->height = 1080;
|
||||||
|
depthai->sensor_resoultion = dai::ColorCameraProperties::SensorResolution::THE_1080_P;
|
||||||
|
depthai->image_orientation = dai::CameraImageOrientation::AUTO;
|
||||||
|
depthai->fps = 118;
|
||||||
|
depthai->interleaved = true;
|
||||||
|
depthai->color_order = dai::ColorCameraProperties::ColorOrder::RGB;
|
||||||
|
}
|
||||||
|
|
||||||
// Some debug printing.
|
// Some debug printing.
|
||||||
depthai_print_connected_cameras(depthai);
|
depthai_print_connected_cameras(depthai);
|
||||||
|
|
||||||
|
@ -345,11 +367,11 @@ depthai_fs_single_rgb(struct xrt_frame_context *xfctx)
|
||||||
auto xlinkOut = p.create<dai::node::XLinkOut>();
|
auto xlinkOut = p.create<dai::node::XLinkOut>();
|
||||||
xlinkOut->setStreamName("preview");
|
xlinkOut->setStreamName("preview");
|
||||||
colorCam->setPreviewSize(depthai->width, depthai->height);
|
colorCam->setPreviewSize(depthai->width, depthai->height);
|
||||||
colorCam->setResolution(dai::ColorCameraProperties::SensorResolution::THE_800_P);
|
colorCam->setResolution(depthai->sensor_resoultion);
|
||||||
colorCam->setInterleaved(true);
|
colorCam->setImageOrientation(depthai->image_orientation);
|
||||||
colorCam->setImageOrientation(dai::CameraImageOrientation::ROTATE_180_DEG);
|
colorCam->setInterleaved(depthai->interleaved);
|
||||||
colorCam->setFps(60);
|
colorCam->setFps(depthai->fps);
|
||||||
colorCam->setColorOrder(dai::ColorCameraProperties::ColorOrder::RGB);
|
colorCam->setColorOrder(depthai->color_order);
|
||||||
|
|
||||||
// Link plugins CAM -> XLINK
|
// Link plugins CAM -> XLINK
|
||||||
colorCam->preview.link(xlinkOut->input);
|
colorCam->preview.link(xlinkOut->input);
|
||||||
|
|
Loading…
Reference in a new issue