Class WHIPSinkBlock
- Namespace
- VisioForge.Core.MediaBlocks.Sinks
- Assembly
- VisioForge.Core.dll
WHIP (WebRTC-HTTP Ingestion Protocol) sink block for streaming media to WHIP-compatible servers such as MediaMTX, Janus, and other WebRTC servers.
public class WHIPSinkBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals, IMediaBlockDynamicInputsInheritance
Implements
Inherited Members
Extension Methods
Remarks
The WHIP sink block enables live streaming of audio and video content to WebRTC servers using the WHIP protocol. Video must be H.264 encoded and audio must be Opus encoded. The block internally handles RTP payloading.
Typical Use Cases:
- Live streaming to MediaMTX WebRTC endpoints
- Ultra-low latency WebRTC broadcasting
- WebRTC-based video conferencing server ingestion
Constructors
WHIPSinkBlock(WHIPSinkSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sinks.WHIPSinkBlock class.
public WHIPSinkBlock(WHIPSinkSettings settings)Parameters
settingsWHIPSinkSettings-
The WHIP sink settings containing the endpoint URL and connection parameters.
Properties
Input
Gets the first input pad.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the output pad. Always null for sink blocks.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads. Always empty for sink blocks.
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets or sets the WHIP sink settings.
public WHIPSinkSettings Settings { get; set; }Property Value
Type
Gets the media block type identifier.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the WHIP sink pipeline components. Internally creates RTP payloaders (rtph264pay for video, rtpopuspay for audio) and links them to the whipsink element.
public override bool Build()Returns
- bool
-
trueif successful;falseotherwise.
CleanUp()
Cleans up resources.
public void CleanUp()CreateNewInput(MediaBlockPadMediaType)
Creates a new input pad for connecting a media stream of the specified type. Video input expects H.264 encoded stream, audio input expects Opus encoded stream.
public MediaBlockPad CreateNewInput(MediaBlockPadMediaType mediaType)Parameters
mediaTypeMediaBlockPadMediaType-
The type of media stream to accept.
Returns
- MediaBlockPad
-
A new VisioForge.Core.MediaBlocks.MediaBlockPad configured for the specified media type.
Dispose(bool)
Releases resources.
protected override void Dispose(bool disposing)Parameters
disposingbool-
Whether to release managed resources.
GetCore()
Gets the core GStreamer wrapper element.
public BaseElement GetCore()Returns
- BaseElement
-
The VisioForge.Core.GStreamer.Base.BaseElement wrapper.
GetElement()
Gets the native GStreamer element.
public Element GetElement()Returns
- Element
-
The underlying Gst.Element.
GetFilenameOrURL()
Gets the WHIP endpoint URL.
public string GetFilenameOrURL()Returns
- string
-
The WHIP endpoint URL.
GetInput(MediaBlockPadMediaType)
Gets an existing input pad matching the specified media type.
public MediaBlockPad GetInput(MediaBlockPadMediaType mediaType)Parameters
mediaTypeMediaBlockPadMediaType-
The media type to search for.
Returns
- MediaBlockPad
-
The matching pad, or null if not found.
IsAvailable()
Determines whether this media block is available.
public static bool IsAvailable()Returns
- bool
-
trueif this media block is available; otherwise,false.
SetFilenameOrURL(string)
Sets the WHIP endpoint URL.
public void SetFilenameOrURL(string value)Parameters
valuestring-
The WHIP endpoint URL.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The owning pipeline.