Table of Contents

Class UDPMPEGTSSinkBlock

Namespace
VisioForge.Core.MediaBlocks.Sinks
Assembly
VisioForge.Core.dll

Provides a media sink for streaming MPEG-TS content over UDP to a single destination.

public class UDPMPEGTSSinkBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals, IMediaBlockDynamicInputs

Inheritance

Implements

Inherited Members

Extension Methods

Examples

var settings = new UDPSinkSettings
{
    Host = "192.168.1.100",
    Port = 5004,
    TTL = 64
};

var udpSink = new UDPMPEGTSSinkBlock(settings);

var videoInput = udpSink.CreateNewInput(MediaBlockPadMediaType.Video);
var audioInput = udpSink.CreateNewInput(MediaBlockPadMediaType.Audio);

pipeline.Connect(h264Encoder.Output, videoInput);
pipeline.Connect(aacEncoder.Output, audioInput);

Remarks

The UDPMPEGTSSinkBlock combines MPEG-TS multiplexing with UDP streaming to enable low-latency media transport. It multiplexes audio and video streams into MPEG-TS format and transmits them using the UDP protocol.

Key features include:

  • Low-latency UDP streaming
  • MPEG-TS multiplexing for multiple audio/video streams
  • Unicast and multicast support
  • Dynamic input creation for multiple streams
  • Configurable TTL, QoS, and buffer sizes

The block expects pre-encoded streams compatible with MPEG-TS format (H.264/H.265 video, AAC/MP3 audio). It first multiplexes streams into MPEG-TS, then transmits via UDP.

Constructors

UDPMPEGTSSinkBlock(UDPSinkSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.UDPMPEGTSSinkBlock class with the specified settings.

public UDPMPEGTSSinkBlock(UDPSinkSettings settings)

Parameters

settings UDPSinkSettings

The UDP sink configuration settings.

Properties

Input

Gets the first input.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets the inputs.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the output.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets the outputs.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Type

Gets the type.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds the UDP MPEG-TS sink block.

public override bool Build()

Returns

bool

true if the block was successfully built; otherwise, false.

CleanUp()

Cleans up.

public void CleanUp()

CreateNewInput(MediaBlockPadMediaType)

Creates a new input pad for the specified media type.

public MediaBlockPad CreateNewInput(MediaBlockPadMediaType mediaType)

Parameters

mediaType MediaBlockPadMediaType

The type of media stream (video, audio, or subtitle) for the new input.

Returns

MediaBlockPad

A new VisioForge.Core.MediaBlocks.MediaBlockPad configured for the specified media type.

Dispose(bool)

Releases unmanaged and - optionally - managed resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

GetCore()

Gets core.

public BaseElement GetCore()

Returns

BaseElement

VisioForge.Core.GStreamer.Base.BaseElement.

GetElement()

Gets the element.

public Element GetElement()

Returns

Element

Gst.Element.

GetFilenameOrURL()

Gets the UDP streaming URL.

public string GetFilenameOrURL()

Returns

string

The configured UDP URL as a string.

GetInput(MediaBlockPadMediaType)

Retrieves an existing input pad of the specified media type.

public MediaBlockPad GetInput(MediaBlockPadMediaType mediaType)

Parameters

mediaType MediaBlockPadMediaType

The media type to search for.

Returns

MediaBlockPad

The first VisioForge.Core.MediaBlocks.MediaBlockPad matching the specified type, or null if none exists.

IsAvailable()

Determines whether the UDP MPEG-TS sink functionality is available in the current environment.

public static bool IsAvailable()

Returns

bool

true if UDP streaming with MPEG-TS is supported; otherwise, false.

SetFilenameOrURL(string)

Sets the UDP streaming URL.

public void SetFilenameOrURL(string value)

Parameters

value string

The new UDP URL string.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the context.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The pipeline.

See Also