Files
DMF-Studio/nodes/passthrough/src/passthrough_node.hpp
T
Johanness 5b5ffa1308 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)
2026-05-26 01:32:50 +03:00

46 lines
1.2 KiB
C++

#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