use depthai::camera::{CameraNode, CameraOutputConfig};
use depthai::common::CameraBoardSocket;
use depthai::device::Device;
use depthai::pipeline::Pipeline;
use depthai::Result;
fn main() -> Result<()> {
println!("Creating pipeline with generic create_with() API...");
let device = Device::new()?;
let pipeline = Pipeline::new().with_device(&device).build()?;
let left = pipeline.create_with::<CameraNode, _>(CameraBoardSocket::CamB)?;
let right = pipeline.create_with::<CameraNode, _>(CameraBoardSocket::CamC)?;
println!("Created left camera node");
println!("Created right camera node");
let left_config = CameraOutputConfig::new((640, 400));
let _left_output = left.request_output(left_config)?;
let right_config = CameraOutputConfig::new((640, 400));
let _right_output = right.request_output(right_config)?;
println!("Configured camera outputs");
let stereo = pipeline.create_node("dai::node::StereoDepth")?;
left.as_node().link(None, None, &stereo, None, Some("left"))?;
right.as_node().link(None, None, &stereo, None, Some("right"))?;
println!("Linked cameras into StereoDepth");
pipeline.start()?;
println!("Pipeline started successfully!");
Ok(())
}