Skip to content

Commit c4a52f6

Browse files
authored
Merge pull request #1323 from luxonis/lnotspotl/internal_xlink
Move XLink nodes nad XLink properties to a new dai::internal namespace
2 parents 5254a77 + be1ac9e commit c4a52f6

32 files changed

+117
-309
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ set(TARGET_CORE_SOURCES
242242
src/pipeline/ThreadedNode.cpp
243243
src/pipeline/DeviceNode.cpp
244244
src/pipeline/DeviceNodeGroup.cpp
245-
src/pipeline/node/XLinkIn.cpp
246-
src/pipeline/node/XLinkOut.cpp
245+
src/pipeline/node/internal/XLinkIn.cpp
246+
src/pipeline/node/internal/XLinkOut.cpp
247247
src/pipeline/node/ColorCamera.cpp
248248
src/pipeline/node/Camera.cpp
249249
src/pipeline/node/Thermal.cpp
@@ -277,8 +277,8 @@ set(TARGET_CORE_SOURCES
277277
src/pipeline/node/test/MyProducer.cpp
278278
src/pipeline/node/test/MyConsumer.cpp
279279
src/pipeline/node/UVC.cpp
280-
src/pipeline/node/host/XLinkInHost.cpp
281-
src/pipeline/node/host/XLinkOutHost.cpp
280+
src/pipeline/node/internal/XLinkInHost.cpp
281+
src/pipeline/node/internal/XLinkOutHost.cpp
282282
src/pipeline/node/host/HostNode.cpp
283283
src/pipeline/node/host/RGBD.cpp
284284
src/pipeline/datatype/DatatypeEnum.cpp

bindings/python/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ set(SOURCE_LIST
7171

7272
src/pipeline/node/NodeBindings.cpp
7373

74-
src/pipeline/node/XLinkInBindings.cpp
75-
src/pipeline/node/XLinkOutBindings.cpp
7674
src/pipeline/node/ColorCameraBindings.cpp
7775
src/pipeline/node/CameraBindings.cpp
7876
src/pipeline/node/MonoCameraBindings.cpp

bindings/python/src/pipeline/PipelineBindings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
#include "depthai/pipeline/node/UVC.hpp"
3737
#include "depthai/pipeline/node/VideoEncoder.hpp"
3838
#include "depthai/pipeline/node/Warp.hpp"
39-
#include "depthai/pipeline/node/XLinkIn.hpp"
40-
#include "depthai/pipeline/node/XLinkOut.hpp"
39+
#include "depthai/pipeline/node/internal/XLinkIn.hpp"
40+
#include "depthai/pipeline/node/internal/XLinkOut.hpp"
4141

4242
// depthai/
4343
#include <memory>

bindings/python/src/pipeline/node/Common.hpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// Map of python node classes and call to pipeline to create it
1616
extern std::vector<std::pair<py::handle, std::function<std::shared_ptr<dai::Node>(dai::Pipeline&, py::object class_)>>> pyNodeCreateMap;
1717
extern py::handle daiNodeModule;
18+
extern py::handle daiNodeInternalModule;
1819

1920
template <typename T, typename DERIVED = dai::DeviceNode>
2021
py::class_<T, DERIVED, std::shared_ptr<T>> addNode(const char* name, const char* docstring = nullptr) {
@@ -23,6 +24,13 @@ py::class_<T, DERIVED, std::shared_ptr<T>> addNode(const char* name, const char*
2324
return node;
2425
}
2526

27+
template <typename T, typename DERIVED = dai::DeviceNode>
28+
py::class_<T, DERIVED, std::shared_ptr<T>> addNodeInternal(const char* name, const char* docstring = nullptr) {
29+
auto node = py::class_<T, DERIVED, std::shared_ptr<T>>(daiNodeInternalModule, name, docstring);
30+
pyNodeCreateMap.push_back(std::make_pair(node, [](dai::Pipeline& p, py::object class_) { return p.create<T>(); }));
31+
return node;
32+
}
33+
2634
template <typename T, typename DERIVED = dai::DeviceNode>
2735
py::class_<T, DERIVED, std::shared_ptr<T>> addNodeAbstract(const char* name, const char* docstring = nullptr) {
2836
auto node = py::class_<T, DERIVED, std::shared_ptr<T>>(daiNodeModule, name, docstring);
@@ -36,7 +44,8 @@ py::class_<T, DERIVED, std::shared_ptr<T>> addNodeAbstract(const char* name, con
3644
// Macro helpers
3745
#define ADD_NODE(NodeName) addNode<NodeName>(#NodeName, DOC(dai, node, NodeName))
3846
#define ADD_NODE_DERIVED(NodeName, Derived) addNode<NodeName, Derived>(#NodeName, DOC(dai, node, NodeName))
47+
#define ADD_NODE_INTERNAL(NodeName) addNodeInternal<NodeName>(#NodeName, DOC(dai, node, internal, NodeName))
3948
#define ADD_NODE_ABSTRACT(NodeName) addNodeAbstract<NodeName>(#NodeName, DOC(dai, node, NodeName))
4049
#define ADD_NODE_DERIVED_ABSTRACT(NodeName, Derived) addNodeAbstract<NodeName, Derived>(#NodeName, DOC(dai, node, NodeName))
4150
#define ADD_NODE_DOC(NodeName, docstring) addNode<NodeName>(#NodeName, docstring)
42-
#define ADD_NODE_DERIVED_DOC(NodeName, Derived, docstring) addNode<NodeName, Derived>(#NodeName, docstring)
51+
#define ADD_NODE_DERIVED_DOC(NodeName, Derived, docstring) addNode<NodeName, Derived>(#NodeName, docstring)

bindings/python/src/pipeline/node/NodeBindings.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ void delImplicitPipeline() {
4242
// Map of python node classes and call to pipeline to create it
4343
std::vector<std::pair<py::handle, std::function<std::shared_ptr<dai::Node>(dai::Pipeline&, py::object class_)>>> pyNodeCreateMap;
4444
py::handle daiNodeModule;
45+
py::handle daiNodeInternalModule;
4546

4647
std::vector<std::pair<py::handle, std::function<std::shared_ptr<dai::Node>(dai::Pipeline&, py::object class_)>>> NodeBindings::getNodeCreateMap() {
4748
return pyNodeCreateMap;
@@ -126,8 +127,6 @@ py::class_<Map, holder_type> bindNodeMap(py::handle scope, const std::string& na
126127
return cl;
127128
}
128129

129-
void bind_xlinkin(pybind11::module& m, void* pCallstack);
130-
void bind_xlinkout(pybind11::module& m, void* pCallstack);
131130
void bind_benchmark(pybind11::module& m, void* pCallstack);
132131
void bind_colorcamera(pybind11::module& m, void* pCallstack);
133132
void bind_camera(pybind11::module& m, void* pCallstack);
@@ -174,8 +173,6 @@ void NodeBindings::addToCallstack(std::deque<StackFunction>& callstack) {
174173
callstack.push_front(NodeBindings::bind);
175174

176175
// Bind all other nodes
177-
callstack.push_front(bind_xlinkin);
178-
callstack.push_front(bind_xlinkout);
179176
callstack.push_front(bind_benchmark);
180177
callstack.push_front(bind_colorcamera);
181178
callstack.push_front(bind_camera);
@@ -226,6 +223,7 @@ void NodeBindings::bind(pybind11::module& m, void* pCallstack) {
226223
//// Bindings for actual nodes
227224
// Move properties into nodes and nodes under 'node' submodule
228225
daiNodeModule = m.def_submodule("node");
226+
daiNodeInternalModule = m.def_submodule("node").def_submodule("internal");
229227

230228
// Properties
231229
py::class_<Node, std::shared_ptr<Node>> pyNode(m, "Node", DOC(dai, Node));

bindings/python/src/pipeline/node/XLinkInBindings.cpp

Lines changed: 0 additions & 42 deletions
This file was deleted.

bindings/python/src/pipeline/node/XLinkOutBindings.cpp

Lines changed: 0 additions & 42 deletions
This file was deleted.

cmake/Depthai/DepthaiDeviceRVC4Config.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ set(DEPTHAI_DEVICE_RVC4_MATURITY "snapshot")
44

55
# "version if applicable"
66
# set(DEPTHAI_DEVICE_RVC4_VERSION "0.0.1+93f7b75a885aa32f44c5e9f53b74470c49d2b1af")
7-
set(DEPTHAI_DEVICE_RVC4_VERSION "0.0.1+de316010b7d2fdffb639e349886068a955ad4d72")
7+
set(DEPTHAI_DEVICE_RVC4_VERSION "0.0.1+8cef4c0d8e3434775e4cd1d537acf671858eaab6")

cmake/Depthai/DepthaiDeviceSideConfig.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")
33

44
# "full commit hash of device side binary"
5-
set(DEPTHAI_DEVICE_SIDE_COMMIT "2d460d1aa7b59037fa0c76d02a1d269d2c3d6571")
5+
set(DEPTHAI_DEVICE_SIDE_COMMIT "c5fce2452ec689a72d5eb22181a967c7e66a02bd")
66

77
# "version if applicable"
88
set(DEPTHAI_DEVICE_SIDE_VERSION "")

include/depthai/pipeline/node/host/Record.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <depthai/pipeline/ThreadedNode.hpp>
44

55
// shared
6-
#include <depthai/properties/XLinkOutProperties.hpp>
6+
#include <depthai/properties/internal/XLinkOutProperties.hpp>
77

88
// project
99
#include <depthai/pipeline/datatype/Buffer.hpp>
@@ -18,6 +18,8 @@
1818
namespace dai {
1919
namespace node {
2020

21+
using XLinkOutProperties = ::dai::internal::XLinkOutProperties;
22+
2123
/**
2224
* @brief RecordVideo node, used to record a video source stream to a file
2325
*/

0 commit comments

Comments
 (0)