Class TSAnalyzerBlock
- Namespace
- VisioForge.Core.MediaBlocks.Special
- Assembly
- VisioForge.Core.dll
Analyzes an MPEG transport stream: parses PAT/PMT/PSI to enumerate programs and elementary streams, computes per-PID bitrate, detects continuity-counter errors and tracks PCR timing (intervals and discontinuities).
The block accepts a raw MPEG-TS byte stream (for example from
BasicFileSourceBlock, UDPRAWSourceBlock or
SRTRAWSourceBlock). In VisioForge.Core.Types.X.Special.TSAnalyzerMode.InputOutput mode the
stream is forwarded unchanged to the output pad for inline monitoring; in
VisioForge.Core.Types.X.Special.TSAnalyzerMode.Input mode the block is terminal.
Subscribe to VisioForge.Core.MediaBlocks.Special.TSAnalyzerBlock.OnAnalysisUpdated for periodic snapshots, or call VisioForge.Core.MediaBlocks.Special.TSAnalyzerBlock.GetReport for the current state.
Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals.
public class TSAnalyzerBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
TSAnalyzerBlock(TSAnalyzerMode, TSAnalyzerSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Special.TSAnalyzerBlock class.
public TSAnalyzerBlock(TSAnalyzerMode mode = TSAnalyzerMode.Input, TSAnalyzerSettings settings = null)Parameters
modeTSAnalyzerMode-
The operating mode. Defaults to VisioForge.Core.Types.X.Special.TSAnalyzerMode.Input.
settingsTSAnalyzerSettings-
Optional analyzer settings.
Properties
Input
Gets the input pad receiving the MPEG-TS byte stream.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets the array of input pads (a single auto-typed input).
public override MediaBlockPad[] Inputs { get; }Property Value
Mode
Gets the operating mode.
public TSAnalyzerMode Mode { get; }Property Value
Output
Gets the passthrough output pad, or null in VisioForge.Core.Types.X.Special.TSAnalyzerMode.Input mode.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets the array of output pads (one in passthrough mode, empty otherwise).
public override MediaBlockPad[] Outputs { get; }Property Value
Type
Gets the media block type identifier for this block.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds the block within the pipeline.
public override bool Build()Returns
- bool
-
trueon success.
CallAnalysisUpdated(TSAnalyzerEventArgs)
Raises the VisioForge.Core.MediaBlocks.Special.TSAnalyzerBlock.OnAnalysisUpdated event.
public void CallAnalysisUpdated(TSAnalyzerEventArgs args)Parameters
argsTSAnalyzerEventArgs-
The event data.
CleanUp()
Performs cleanup of internal resources.
public void CleanUp()Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected override void Dispose(bool disposing)Parameters
disposingbool-
trueto release managed resources.
GetCore()
Gets the core GStreamer element wrapper.
public BaseElement GetCore()Returns
- BaseElement
-
The wrapper.
GetElement()
Gets the underlying GStreamer element.
public Element GetElement()Returns
- Element
-
The element.
GetReport()
Gets the current analysis report.
public TSAnalyzerReport GetReport()Returns
- TSAnalyzerReport
-
The report, or
nullif the block has not been built.
IsAvailable()
Determines whether the analyzer is available in the current environment.
public static bool IsAvailable()Returns
- bool
-
trueif available.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Associates this MediaBlock with a pipeline and initializes its internal context. This method is called automatically when the block is added to a pipeline, providing access to shared resources and pipeline-wide configuration.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The MediaBlocksPipeline instance that will manage this block.
OnAnalysisUpdated
Occurs when a new analysis snapshot is available. Raised periodically (per VisioForge.Core.Types.X.Special.TSAnalyzerSettings.StatisticsInterval) and once more at end-of-stream (with VisioForge.Core.Types.X.TSAnalyzerEventArgs.IsFinal set). Periodic snapshots are raised on a background timer thread; the final (VisioForge.Core.Types.X.TSAnalyzerEventArgs.IsFinal) report is raised synchronously on the GStreamer streaming thread at end-of-stream. In both cases marshal to the UI thread as needed and keep handlers non-blocking.
public event EventHandler<TSAnalyzerEventArgs> OnAnalysisUpdated