Device Nodes
Node entry. You can click on them to find out more.Inputs and outputs

Node input
input.setBlocking(bool) and input.setQueueSize(num), eg. edgeDetector.inputImage.setQueueSize(10). If the input queue fills up, behavior of the input depends on blocking attribute.Let's say we have linked ColorCamera preview output with NeuralNetwork input input.
If input is set to blocking mode, and input queue fills up, no new messages from ColorCamera will be able to enter the input queue. This means ColorCamera will block and wait with sending its messages until it can push the message to the queue of NeuralNetwork input. If ColorCamera preview is connected to multiple inputs, the same behavior implies, with the messages being pushed sequentially to each input.If blocking is disabled, new messages will push out old messages. This eliminates the risk of pipeline freezing, but can result in dropped messages (eg. ImgFrame).Node output
Pipeline freezing
When all the messages from pool are sent out and none yet returned, that's when the node will block (freeze) and wait until a message is released (not used by any node in the pipeline).
class
dai::Node
variable
Id id
variable
Id inputId
variable
Id outputId
variable
std::string alias
function
Node(const Node &)function
function
Node(Node &&)function
function
std::string createUniqueInputName()function
std::string createUniqueOutputName()function
Pipeline getParentPipeline()function
const Pipeline getParentPipeline()inline function
std::string getAlias()inline function
void setAlias(std::string alias)function
const char * getName()inline function
void start()inline function
void wait()inline function
void stop()function
void stopPipeline()function
void buildStage1()function
void buildStage2()function
void buildStage3()function
std::vector< Output > getOutputs()function
std::vector< Input > getInputs()function
std::vector< Output * > getOutputRefs()function
std::vector< const Output * > getOutputRefs()function
std::vector< Input * > getInputRefs()function
std::vector< const Input * > getInputRefs()function
std::vector< OutputMap * > getOutputMapRefs()function
std::vector< InputMap * > getInputMapRefs()function
Output * getOutputRef(std::string name)function
Output * getOutputRef(std::string group, std::string name)function
Input * getInputRef(std::string name)function
Input * getInputRef(std::string group, std::string name)function
OutputMap * getOutputMapRef(std::string group)function
InputMap * getInputMapRef(std::string group)function
bool isSourceNode()function
~Node()function
const AssetManager & getAssetManager()function
AssetManager & getAssetManager()function
std::vector< uint8_t > loadResource(std::filesystem::path uri)function
std::vector< uint8_t > moveResource(std::filesystem::path uri)inline function
std::shared_ptr< N > create()function
void add(std::shared_ptr< Node > node)function
std::vector< std::shared_ptr< Node > > getAllNodes()function
function
function
void remove(std::shared_ptr< Node > node)function
ConnectionMap getConnectionMap()function
void link(const Node::Output & out, const Node::Input & in)function
void unlink(const Node::Output & out, const Node::Input & in)function
void link(std::shared_ptr< Node > in)function
Node::Output * requestOutput(const Capability & capability, bool onHost)function
std::vector< std::pair< Input &, std::shared_ptr< Capability > > > getRequiredInputs()function
bool runOnHost()inline function
const NodeMap & getNodeMap()inline function
void buildInternal()struct
dai::Node::Connection
variable
Id outputId
variable
std::string outputName
variable
std::string outputGroup
variable
Id inputId
variable
std::string inputName
variable
std::string inputGroup
function
function
Connection(ConnectionInternal c)function
bool operator==(const Connection & rhs)struct
dai::Node::ConnectionInternal
variable
std::weak_ptr< Node > outputNode
variable
std::string outputName
variable
std::string outputGroup
variable
std::weak_ptr< Node > inputNode
variable
std::string inputName
variable
std::string inputGroup
variable
Output * out
variable
Input * in
function
function
bool operator==(const ConnectionInternal & rhs)struct
dai::Node::ConnectionInternal::Hash
function
size_t operator()(const dai::Node::ConnectionInternal & obj)struct
dai::Node::DatatypeHierarchy
variable
DatatypeEnum datatype
variable
bool descendants
inline function
DatatypeHierarchy(DatatypeEnum d, bool c)class
dai::Node::Input
variable
std::vector< DatatypeHierarchy > possibleDatatypes
function
~Input()inline explicit function
Input(Node & par, InputDescription desc, bool ref)inline function
const Node & getParent()Get the parent node
inline function
Node & getParent()Get the parent node
inline function
Type getType()Get type
function
std::string toString()Input to string representation
function
void setWaitForMessage(bool waitForMessage)Overrides default wait for message behavior. Applicable for nodes with multiple inputs. Specifies behavior whether to wait for this input when a Node processes certain data or not.
Parameters
- waitForMessage: Whether to wait for message to arrive to this input or not
function
bool getWaitForMessage()Get behavior whether to wait for this input when a Node processes certain data or not
Returns
Whether to wait for message to arrive to this input or not
function
std::vector< DatatypeHierarchy > getPossibleDatatypes()Get possible datatypes that can be received
function
void setPossibleDatatypes(std::vector< DatatypeHierarchy > types)Set possible datatypes that can be received
function
void setReusePreviousMessage(bool reusePreviousMessage)Equivalent to setWaitForMessage but with inverted logic.
function
bool getReusePreviousMessage()Equivalent to getWaitForMessage but with inverted logic.
function
void setGroup(std::string group)Set group name for this input
function
std::string getGroup()Get group name for this input
function
bool isConnected()Check if this input is connected
function
std::shared_ptr< InputQueue > createInputQueue(unsigned int maxSize, bool blocking)enum
Type
enumerator
SReceiver
enumerator
MReceiver
struct
dai::Node::InputDescription
variable
std::string name
variable
std::string group
variable
bool blocking
variable
int queueSize
variable
std::vector< DatatypeHierarchy > types DEFAULT_TYPES
variable
bool waitForMessage
class
dai::Node::InputMap
variable
std::string name
function
InputMap(Node & parent, InputDescription defaultInput)function
InputMap(Node & parent, std::string name, InputDescription defaultInput)function
Input & operator[](const std::string & key)function
Input & operator[](std::pair< std::string, std::string > groupKey)function
bool has(const std::string & key)class
dai::Node::Output
function
~Output()inline function
Output(Node & par, OutputDescription desc, bool ref)inline function
Node & getParent()inline function
const Node & getParent()function
std::string toString()inline function
std::string getName()Get name of the output
inline function
std::string getGroup()Get group of the output
inline function
void setGroup(std::string group)Set group name for this output
inline function
void setName(std::string name)Set name for this output
inline function
Type getType()Get type of the output
function
std::vector< DatatypeHierarchy > getPossibleDatatypes()Get possible datatypes that can be sent
function
void setPossibleDatatypes(std::vector< DatatypeHierarchy > types)Set possible datatypes that can be sent
function
bool isSamePipeline(const Input & in)Check if this output and given input are on the same pipeline.
Parameters
canConnect for checking if connection is possible
Returns
True if output and input are on the same pipeline
function
bool canConnect(const Input & in)Check if connection is possible
Parameters
- in: Input to connect to
Returns
True if connection is possible, false otherwise
function
std::vector< ConnectionInternal > getConnections()Retrieve all connections from this output
Returns
Vector of connections
inline function
std::vector< QueueConnection > getQueueConnections()Retrieve all queue connections from this output
Returns
Vector of queue connections
function
std::shared_ptr< dai::MessageQueue > createOutputQueue(unsigned int maxSize, bool blocking)function
void link(Input & in)Link current output to input.Throws an error if this output cannot be linked to given input, or if they are already linked
Parameters
- in: Input to link to
function
void link(std::shared_ptr< Node > in)function
void unlink(Input & in)Unlink a previously linked connectionThrows an error if not linked.
Parameters
- in: Input from which to unlink from
function
void send(const std::shared_ptr< ADatatype > & msg)Sends a Message to all connected inputs
Parameters
- msg: Message to send to all connected inputs
function
bool trySend(const std::shared_ptr< ADatatype > & msg)Try sending a message to all connected inputs
Parameters
- msg: Message to send to all connected inputs
Returns
True if ALL connected inputs got the message, false otherwise
struct
dai::Node::Output::QueueConnection
variable
Output * output
variable
std::shared_ptr< MessageQueue > queue
inline function
bool operator==(const QueueConnection & rhs)enum
Type
enumerator
MSender
enumerator
SSender
struct
dai::Node::OutputDescription
variable
std::string name
variable
std::string group
variable
std::vector< DatatypeHierarchy > types DEFAULT_TYPES
class
dai::Node::OutputMap
variable
std::string name
function
OutputMap(Node & parent, std::string name, OutputDescription defaultOutput, bool ref)function
OutputMap(Node & parent, OutputDescription defaultOutput, bool ref)function
Output & operator[](const std::string & key)function
Output & operator[](std::pair< std::string, std::string > groupKey)struct
dai::Node::PairHash
inline function
std::size_t operator()(const std::pair< T1, T2 > & pair)enum