How nariakiiwatani/ofxndi works
Project type and purpose
• This is an open-source C++ addon (“ofxNDI”) for the openFrameworks toolkit that wraps the NewTek NDI (Network Device Interface) SDK.
• Its primary goal is to let openFrameworks apps send, receive, record, route, and otherwise manipulate audio/video streams over IP using NDI.
High-level file-structure analysis
• Top level
– example-* folders: multiple live examples (senders, receivers, router, recorder, videograbber, videocaster).
– libs/NDI: upstream NewTek NDI SDK headers + platform libs.
– src/: the actual addon source—core wrapper classes (ofxNDIReceiver, ofxNDISender, Finder, Recorder, Router, Genlock, PTZ, etc.) and a utils subfolder.
– redist/: packaged installers for redistribution (Mac).
– addon_config.mk, windows-copy-to-bin: build/deployment scripts for different platforms.
• Patterns
– Modular C++ classes each encapsulating one NDI SDK feature.
– Examples structured as standalone openFrameworks apps that link against the addon.
– Cross-platform support via platform-specific library folders under libs/NDI.
README insights
• Confirms cross-platform support (Mac, iOS*, Linux, Windows), missing iOS libs due to size.
• Warns that some SDK features are untested, and mobile receivers aren’t supported by the SDK.
Main components
a. openFrameworks Application Layer
• ofApp (main.cpp → ofApp.cpp/h) for each example.
• Your own OF-based UI/rendering logic that calls into ofxNDI classes.
b. ofxNDI Addon Layer
• Core modules:
– NDIFinder: discovers available sources on the network
– ofxNDISender / SendStream: wraps NDI send API
– ofxNDIReceiver / RecvStream: wraps NDI receive API
– ofxNDIRecorder: records streams to disk
– ofxNDIRouter: implements NDI routing (program → preview busses)
– ofxNDIGenlock, ofxNDIPTZ: advanced sync and camera controls
• Utilities: VideoCaster, VideoGrabber for seamless OF integration
c. NDI SDK Native Layer
• libs/NDI/include + libs/NDI/lib: the official NewTek NDI C/C++ libraries
• Platform-specific binaries (osx, windows, linux)
d. NDI Network Fabric
• Represents the UDP multicast/unicast flows carrying compressed frames/audio
e. Build & Deployment
• addon_config.mk (Linux/Mac MAKE build)
• windows-copy-to-bin (Windows post-build script)
• redist installers (Mac PKG)
Relationships and data flows
• For receive: NDI Network → NDI.SDK → ofxNDIReceiver → ofApp
• NDIFinder polls over the network to discover live sources → application
• Recorder / Router classes sit beside Sender/Receiver, hooking into the same NDI SDK and network flows
• Utilities wrap low-level frame buffers into OF textures/sounds
Architectural patterns & design principles
• Layered architecture:
– Presentation (OF application)
– Adapter/Wrapper (ofxNDI addon classes)
– Third-party SDK (NDI native libs)
• Single-responsibility: each class handles one SDK feature
• Dependency isolation: no direct NDI SDK calls in examples—everything goes through the wrapper