feat: scaffold project framework with engine, node skeleton, and passthrough node
- CMake build system with vcpkg dependency management - libdmf-node: Node interface, port definitions, WebSocket control server, node runner with MXL lifecycle management - libdmf-engine: Graph model (nodes/edges CRUD, serialization), FlowManager (UUID + V210 NMOS flow definitions), ProcessManager (fork/exec node processes), ApiServer (REST API for graph control) - Passthrough node: reads V210 grains from MXL, copies, writes to MXL - Unit tests for Graph and FlowManager (6 cases, 21 assertions) - MXL SDK as git submodule (symlinked from extern/mxl)
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
|
||||
#include <dmf-node/node.hpp>
|
||||
|
||||
#include <mxl/flow.h>
|
||||
|
||||
#include <unordered_map>
|
||||
#include <optional>
|
||||
|
||||
namespace dmf_node {
|
||||
|
||||
class PassthroughNode : public Node {
|
||||
public:
|
||||
PassthroughNode() = default;
|
||||
|
||||
std::string type() const override { return "passthrough"; }
|
||||
|
||||
std::vector<PortDef> input_ports() const override {
|
||||
return {{"video_in", PortDirection::Input, MediaType::VideoV210}};
|
||||
}
|
||||
|
||||
std::vector<PortDef> output_ports() const override {
|
||||
return {{"video_out", PortDirection::Output, MediaType::VideoV210}};
|
||||
}
|
||||
|
||||
void configure(const nlohmann::json& /*params*/) override {}
|
||||
|
||||
void on_add_writer(const std::string& port_id, mxlFlowWriter writer) override;
|
||||
void on_add_reader(const std::string& port_id, mxlFlowReader reader) override;
|
||||
void on_remove_writer(const std::string& port_id) override;
|
||||
void on_remove_reader(const std::string& port_id) override;
|
||||
|
||||
void process() override;
|
||||
nlohmann::json status() const override;
|
||||
|
||||
private:
|
||||
std::optional<mxlFlowReader> reader_;
|
||||
std::optional<mxlFlowWriter> writer_;
|
||||
mxlInstance mxl_instance_ = nullptr;
|
||||
uint64_t read_index_ = 0;
|
||||
uint64_t write_index_ = 0;
|
||||
uint64_t grains_processed_ = 0;
|
||||
};
|
||||
|
||||
} // namespace dmf_node
|
||||
Reference in New Issue
Block a user