Class UDPRAWSourceBlock
- Namespace
- VisioForge.Core.MediaBlocks.Sources
- Assembly
- VisioForge.Core.dll
UDP RAW source block. Receives a live UDP stream (MPEG-TS, RTP, or raw elementary) and exposes parsed but still-encoded video (and optional audio) without decoding. Intended for passthrough recording or remuxing — for example, splitting a UDP feed into MP4/MKV files without re-encoding.
public class UDPRAWSourceBlock : SourceMediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Remarks
Pipeline construction by VisioForge.Core.Types.X.Sources.UDPRAWSourceSettings.Mode:
-
Auto / MPEGTS:
udpsrc → parsebin. parsebin auto-detects the container (MPEG-TS is the common "UDP video" case), demuxes and parses every stream, and exposes them still encoded via dynamic pads. -
RTP:
udpsrc(caps=application/x-rtp …) → rtpXdepay → parser. The video codec is taken from VisioForge.Core.Types.X.Sources.UDPRAWSourceSettings.VideoCodec (a bare UDP socket carries no SDP); optional RTP audio (VisioForge.Core.Types.X.Sources.UDPRAWSourceSettings.AudioCodec) arrives on a separate port (VisioForge.Core.Types.X.Sources.UDPRAWSourceSettings.AudioPort). -
Raw:
udpsrc(caps=video/… ) → parserfor a single elementary video stream selected by VisioForge.Core.Types.X.Sources.UDPRAWSourceSettings.VideoCodec.
The exposed video/audio output pads carry encoded data, so connecting them to a muxer sink
(such as MP4SinkBlock / MKVSinkBlock) records without re-encoding.
In Auto/MPEGTS mode every common codec is exposed. When a codec maps to a timestamp-inferring GstBaseParse parser (video: h264parse/h265parse/vp9parse/av1parse/mpegvideoparse/mpeg4videoparse/jpegparse; audio: aacparse/mpegaudioparse/ac3parse/opusparse/flacparse) the parser is inserted so every passthrough buffer carries a PTS — a strict muxer such as mp4mux/qtmux otherwise aborts with "Buffer has no PTS". Any codec without a matching parser (for example VP8, raw PCM) is linked through unparsed as a passthrough rather than dropped, since dropping a connected pad would starve a downstream muxer.
Constructors
UDPRAWSourceBlock(UDPRAWSourceSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.UDPRAWSourceBlock class.
public UDPRAWSourceBlock(UDPRAWSourceSettings settings)Parameters
settingsUDPRAWSourceSettings-
The UDP RAW source settings.
Properties
AudioOutput
Gets the encoded audio output pad. Non-null when VisioForge.Core.Types.X.Sources.UDPRAWSourceSettings.AudioEnabled
is set AND either VisioForge.Core.Types.X.Sources.UDPRAWSourceSettings.Mode is VisioForge.Core.Types.X.Sources.UDPRAWSourceMode.Auto /
VisioForge.Core.Types.X.Sources.UDPRAWSourceMode.MPEGTS, or the mode is VisioForge.Core.Types.X.Sources.UDPRAWSourceMode.RTP with a
configured VisioForge.Core.Types.X.Sources.UDPRAWSourceSettings.AudioPort; otherwise null (the Raw mode is
video-only).
public MediaBlockPad AudioOutput { get; }Property Value
Input
Gets the primary input pad (always null for source blocks).
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads (empty for source blocks).
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the primary output pad (video).
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads.
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets the UDP RAW source settings.
public UDPRAWSourceSettings Settings { get; }Property Value
Type
Gets the type of this media block.
public override MediaBlockType Type { get; }Property Value
VideoOutput
Gets the encoded video output pad.
public MediaBlockPad VideoOutput { get; }Property Value
Methods
Build()
Builds the block within the pipeline context.
public override bool Build()Returns
- bool
-
trueon success; otherwisefalse.
CleanUp()
Cleans up all GStreamer resources used by the block.
public void CleanUp()Dispose(bool)
Releases resources used by the block.
protected override void Dispose(bool disposing)Parameters
disposingbool-
trueto release managed and unmanaged resources.
GetCore()
Gets the core element wrapper (none for this composite block).
public BaseElement GetCore()Returns
- BaseElement
-
Always null.
GetElement()
Gets the native GStreamer source element.
public Element GetElement()Returns
- Element
-
The udpsrc element.
IsAvailable()
Determines whether this block is available. Requires the GStreamer udpsrc element.
public static bool IsAvailable()Returns
- bool
-
trueif available; otherwisefalse.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context for this block.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The parent pipeline.