Class NDISinkBlock
- Namespace
- VisioForge.Core.MediaBlocks.Sinks
- Assembly
- VisioForge.Core.dll
NDI (Network Device Interface) sink block for broadcasting video over IP networks.
public class NDISinkBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals, IMediaBlockInternals2, IMediaBlockDynamicInputsInheritance
Implements
Inherited Members
Extension Methods
Remarks
The NDI sink block enables high-quality, low-latency video transmission over standard Ethernet networks using NewTek's NDI protocol. NDI has become the de facto standard for IP video production, allowing multiple video systems to identify and communicate with one another over IP, and to encode, transmit, and receive high-quality video with minimal latency.
Key Features:
- Ultra-low latency transmission (typically 1 frame)
- Automatic network discovery of NDI sources
- Support for full resolution video with alpha channel
- Multi-channel audio support
- Bi-directional metadata communication
- Multicast and unicast transmission modes
- Hardware acceleration support on compatible systems
Typical Use Cases:
- Live production workflows in broadcast environments
- Multi-camera productions without physical SDI/HDMI cables
- Remote production and contribution feeds
- Virtual sets and augmented reality applications
- Video conferencing and collaboration systems
- Digital signage and display walls
Technical Requirements:
- NDI Runtime (v5 or v6) must be installed on the system
- Gigabit Ethernet network recommended (100 Mbps minimum)
- Video formats: Various resolutions up to 4K and beyond
- Audio: Up to 16 channels of float32 audio
- Color formats: UYVY, BGRA, RGBA with optional alpha
Platform Notes: The implementation differs between platforms. On Windows, it may use direct NDI SDK integration, while on other platforms it uses GStreamer's NDI plugin. The NDI_RUNTIME_DIR_V5 or NDI_RUNTIME_DIR_V6 environment variable must be set.
Constructors
NDISinkBlock(NDISinkSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.NDISinkBlock class with the specified settings.
public NDISinkBlock(NDISinkSettings settings)Parameters
settingsNDISinkSettings-
The VisioForge.Core.Types.X.Sinks.NDISinkSettings object containing configuration for the NDI output, primarily the source name that will identify this sender on the network.
NDISinkBlock(string)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.NDISinkBlock class with a simple name.
public NDISinkBlock(string name)Parameters
namestring-
The NDI source name that will be visible to other NDI devices on the network. This name should be descriptive and unique within your network environment.
Properties
Input
Gets the first input pad from the collection of available inputs.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all available input pads for connecting multiple media streams.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the output pad for this sink block.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads for this sink block.
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets or sets the NDI sink configuration settings.
public NDISinkSettings Settings { get; set; }Property Value
Type
Gets the media block type identifier for the NDI sink.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds this instance.
public override bool Build()Returns
- bool
-
trueif successfull,falseotherwise.
CleanUp()
Cleans up resources and stops NDI transmission.
public void CleanUp()Remarks
This method stops the NDI sender, disposes of buffer sinks (on Windows), or the GStreamer element (on other platforms), and resets the build state. The NDI source will disappear from the network after cleanup.
CreateNewInput(MediaBlockPadMediaType)
Creates a new input pad for connecting a media stream of the specified type.
public MediaBlockPad CreateNewInput(MediaBlockPadMediaType mediaType)Parameters
mediaTypeMediaBlockPadMediaType-
The type of media stream to accept. NDI supports: VisioForge.Core.MediaBlocks.MediaBlockPadMediaType.Video for video streams and VisioForge.Core.MediaBlocks.MediaBlockPadMediaType.Audio for audio streams.
Returns
- MediaBlockPad
-
A new VisioForge.Core.MediaBlocks.MediaBlockPad configured for the specified media type, ready to receive streams for NDI network transmission.
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected override void Dispose(bool disposing)Parameters
disposingbool-
trueto release both managed and unmanaged resources;falseto release only unmanaged resources.
GetCore()
Gets the core GStreamer wrapper element for advanced pipeline integration.
public BaseElement GetCore()Returns
- BaseElement
-
Returns
nullas the NDI sink uses either platform-specific implementations or direct GStreamer elements without a wrapper.
GetElement()
Gets the native GStreamer element for direct GStreamer API access.
public Element GetElement()Returns
- Element
-
Returns
nullas the NDI sink implementation varies by platform and may not expose a single GStreamer element.
GetFilenameOrURL()
Gets the NDI source name that identifies this sender on the network.
public string GetFilenameOrURL()Returns
- string
-
The NDI source name as configured in the settings. This name is what other NDI devices will see when discovering sources.
GetInput(MediaBlockPadMediaType)
Gets an existing input pad that matches the specified media type.
public MediaBlockPad GetInput(MediaBlockPadMediaType mediaType)Parameters
mediaTypeMediaBlockPadMediaType-
The media type to search for among existing input pads.
Returns
- MediaBlockPad
-
The first VisioForge.Core.MediaBlocks.MediaBlockPad that matches the specified media type, or
nullif no matching input pad exists.
IsAvailable()
Determines whether this media block is available. Correct NuGet SDK redist should be included into your project.
public static bool IsAvailable()Returns
- bool
-
trueif this media block is available; otherwise,false.
PostConnect()
Called after all input pads have been connected to perform post-connection setup.
public bool PostConnect()Returns
- bool
-
trueif post-connection setup succeeded;falseon Windows platforms where this step is not needed, or if the setup failed on other platforms.
Remarks
This method is part of the IMediaBlockInternals2 interface and handles platform-specific initialization that must occur after pad connections are established.
SetFilenameOrURL(string)
Sets the NDI source name for network identification.
public void SetFilenameOrURL(string value)Parameters
valuestring-
The new NDI source name. This should be descriptive and unique to help users identify this source among other NDI sources on the network.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context for this media block.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The VisioForge.Core.MediaBlocks.MediaBlocksPipeline that owns this sink block, providing access to the pipeline context and logging facilities.
Remarks
This method is called internally by the pipeline during initialization and should not be called directly by user code.