feat: NDI in node receives and writes audio flow
- FlowDef.hpp: add make_audio_flow_def (NMOS IS-04 audio/Lnn flow)
- NDIReceiver: replace capture_v210 with capture() — single recv call
dispatches to FrameKind::{Video,Audio,None}; AudioInfo struct carries
sample_rate/channels/samples/channel_stride
- ndiin: optional audio writer when graph wires audio_flow_id; single
loop with 5ms NDI poll; audio grains written immediately on arrival;
video grains written when mxlGetCurrentIndex reaches video_index
- build_graph: rename ndiin video port flow_id → video_flow_id; add
audio_flow_id edge (no sink yet — wired to ndiin only)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+11
-4
@@ -39,16 +39,23 @@ static std::string gen_uuid() {
|
||||
static dmf::FlowGraph build_graph() {
|
||||
dmf::FlowGraph g;
|
||||
const std::string video_flow = gen_uuid();
|
||||
const std::string audio_flow = gen_uuid();
|
||||
g.nodes = {
|
||||
{ "ndiin", "ndiin", {} },
|
||||
{ "fakesink", "fakesink", {} },
|
||||
{ "ndiout", "ndiout", {} },
|
||||
};
|
||||
const nlohmann::json video_fmt = {
|
||||
{"kind","video"}, {"width",1920}, {"height",1080}, {"fps_num",25}, {"fps_den",1}
|
||||
};
|
||||
const nlohmann::json audio_fmt = {
|
||||
{"kind","audio"}, {"sample_rate",48000}, {"channels",2}, {"bit_depth",32}
|
||||
};
|
||||
g.edges = {
|
||||
{ video_flow, "ndiin", "flow_id", "fakesink", "flow_id",
|
||||
{ {"kind","video"}, {"width",1920}, {"height",1080}, {"fps_num",25}, {"fps_den",1} } },
|
||||
{ video_flow, "ndiin", "flow_id", "ndiout", "flow_id",
|
||||
{ {"kind","video"}, {"width",1920}, {"height",1080}, {"fps_num",25}, {"fps_den",1} } },
|
||||
{ video_flow, "ndiin", "video_flow_id", "fakesink", "flow_id", video_fmt },
|
||||
{ video_flow, "ndiin", "video_flow_id", "ndiout", "flow_id", video_fmt },
|
||||
// audio_flow_id wired to ndiin only — no sink node yet, readers added later
|
||||
{ audio_flow, "ndiin", "audio_flow_id", "", "", audio_fmt },
|
||||
};
|
||||
return g;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user