#include #include #include #include "depthai/depthai.hpp" class TestPassthrough : public dai::node::CustomThreadedNode { public: Input input = dai::Node::Input{*this, {}}; Output output = dai::Node::Output{*this, {}}; void run() override { while(mainLoop()) { auto buffer = input.get(); if(buffer) { std::cout << "The passthrough node received a buffer!" << std::endl; output.send(buffer); } } } }; class TestSink : public dai::node::CustomThreadedNode { public: Input input = dai::Node::Input{*this, {}}; void run() override { while(mainLoop()) { auto buffer = input.get(); if(buffer) { std::cout << "The sink node received a buffer!" << std::endl; } } } }; class TestSource : public dai::node::CustomThreadedNode { public: Output output = dai::Node::Output{*this, {}}; void run() override { while(mainLoop()) { auto buffer = std::make_shared(); std::cout << "The source node is sending a buffer!" << std::endl; output.send(buffer); std::this_thread::sleep_for(std::chrono::seconds(1)); } } }; int main() { dai::Pipeline pipeline(false); auto source = pipeline.create(); auto passthrough = pipeline.create(); auto sink = pipeline.create(); source->output.link(passthrough->input); passthrough->output.link(sink->input); pipeline.start(); while(true) { std::this_thread::sleep_for(std::chrono::seconds(1)); std::cout << "Pipeline is running..." << std::endl; } return 0; }